A polymorphic structure to store information about a halo exchange. More...
#include <haloExchange.h>
Data Fields | |
| int | nbrRank [6] |
| The MPI ranks of the six face neighbors of the local domain. More... | |
| int | bufCapacity |
| The maximum send/recv buffer size (in bytes) that will be needed for this halo exchange. More... | |
| int(* | loadBuffer )(void *parms, void *data, int face, char *buf) |
| Pointer to a sub-class specific function to load the send buffer. More... | |
| void(* | unloadBuffer )(void *parms, void *data, int face, int bufSize, char *buf) |
| Pointer to a sub-class specific function to unload the recv buffer. More... | |
| void(* | destroy )(void *parms) |
| Pointer to a function to deallocate any memory used by the sub-class parms. More... | |
| void * | parms |
| A pointer to a sub-class specific structure that contains additional data members needed by the sub-class. More... | |
A polymorphic structure to store information about a halo exchange.
This structure can be thought of as an abstract base class that specifies the interface and implements the communication patterns of a halo exchange. Concrete sub-classes supply actual implementations of the loadBuffer, unloadBuffer, and destroy functions, that are specific to the actual data being exchanged. If the subclass needs additional data members, these can be stored in a structure that is pointed to by parms.
Designing the structure this way allows us to re-use the communication code for both atom data and partial force data.
Definition at line 26 of file haloExchange.h.
| int HaloExchangeSt::bufCapacity |
The maximum send/recv buffer size (in bytes) that will be needed for this halo exchange.
Definition at line 33 of file haloExchange.h.
| void(* HaloExchangeSt::destroy)(void *parms) |
Pointer to a function to deallocate any memory used by the sub-class parms.
Essentially this is a virtual destructor.
Definition at line 64 of file haloExchange.h.
| int(* HaloExchangeSt::loadBuffer)(void *parms, void *data, int face, char *buf) |
Pointer to a sub-class specific function to load the send buffer.
| [in] | parms | The parms member of the structure. This is a pointer to a sub-class specific structure that can be used by the load and unload functions to store sub-class specific data. |
| [in] | data | A pointer to a structure that the contains the data that is needed by the loadBuffer function. The loadBuffer function will cast the pointer to a concrete type that is appropriate for the data being exchanged. |
| [in] | face | Specifies the face across which data is being sent. |
| [in] | buf | The send buffer to be loaded |
Definition at line 47 of file haloExchange.h.
| int HaloExchangeSt::nbrRank[6] |
The MPI ranks of the six face neighbors of the local domain.
Ranks are stored in the order specified in HaloFaceOrder.
Definition at line 30 of file haloExchange.h.
| void* HaloExchangeSt::parms |
A pointer to a sub-class specific structure that contains additional data members needed by the sub-class.
Definition at line 67 of file haloExchange.h.
| void(* HaloExchangeSt::unloadBuffer)(void *parms, void *data, int face, int bufSize, char *buf) |
Pointer to a sub-class specific function to unload the recv buffer.
| [in] | parms | The parms member of the structure. This is a pointer to a sub-class specific structure that can be used by the load and unload functions to store sub-class specific data. |
| [out] | data | A pointer to a structure that the contains the data that is needed by the unloadBuffer function. The unloadBuffer function will cast the pointer to a concrete type that is appropriate for the data being exchanged. |
| [in] | face | Specifies the face across which data is being sent. |
| [in] | bufSize | The number of bytes in the recv buffer. |
| [in] | buf | The recv buffer to be unloaded. |
Definition at line 61 of file haloExchange.h.