CoMD
A Mini-app for Co-Design of Classical Molecular Dynamics.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
HaloExchangeSt Struct Reference

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...
 

Detailed Description

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.

See Also
eamForce
redistributeAtoms

Definition at line 26 of file haloExchange.h.

Field Documentation

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.

Parameters
[in]parmsThe 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]dataA 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]faceSpecifies the face across which data is being sent.
[in]bufThe send buffer to be loaded
Returns
The number of bytes loaded into the send buffer.

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.

Parameters
[in]parmsThe 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]dataA 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]faceSpecifies the face across which data is being sent.
[in]bufSizeThe number of bytes in the recv buffer.
[in]bufThe recv buffer to be unloaded.

Definition at line 61 of file haloExchange.h.


The documentation for this struct was generated from the following file: