Communicate halo data such as "ghost" atoms with neighboring tasks. More...
#include "mytype.h"

Go to the source code of this file.
Data Structures | |
| struct | HaloExchangeSt |
| A polymorphic structure to store information about a halo exchange. More... | |
Typedefs | |
| typedef struct HaloExchangeSt | HaloExchange |
| A polymorphic structure to store information about a halo exchange. More... | |
Functions | |
| HaloExchange * | initAtomHaloExchange (struct DomainSt *domain, struct LinkCellSt *boxes) |
| Create a HaloExchange for atom data. More... | |
| HaloExchange * | initForceHaloExchange (struct DomainSt *domain, struct LinkCellSt *boxes) |
| Create a HaloExchange for force data. More... | |
| void | destroyHaloExchange (HaloExchange **haloExchange) |
| HaloExchange destructor. More... | |
| void | haloExchange (HaloExchange *haloExchange, void *data) |
| Execute a halo exchange. More... | |
| void | sortAtomsInCell (struct AtomsSt *atoms, struct LinkCellSt *boxes, int iBox) |
| Sort the atoms by gid in the specified link cell. More... | |
Communicate halo data such as "ghost" atoms with neighboring tasks.
Definition in file haloExchange.h.
| typedef struct HaloExchangeSt HaloExchange |
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.
| void destroyHaloExchange | ( | HaloExchange ** | haloExchange | ) |
HaloExchange destructor.
Definition at line 239 of file haloExchange.c.

| void haloExchange | ( | HaloExchange * | haloExchange, |
| void * | data | ||
| ) |
Execute a halo exchange.
Definition at line 246 of file haloExchange.c.


| HaloExchange* initAtomHaloExchange | ( | Domain * | domain, |
| LinkCell * | boxes | ||
| ) |
Create a HaloExchange for atom data.
When called in proper sequence by redistributeAtoms, the atom halo exchange helps serve three purposes:
This constructor does the following:
Definition at line 144 of file haloExchange.c.


| HaloExchange* initForceHaloExchange | ( | Domain * | domain, |
| LinkCell * | boxes | ||
| ) |
Create a HaloExchange for force data.
Create a HaloExchange for force data.
In the force case we only need to exchange data that is needed to complete the force calculation. Since the atoms have not moved we only need to send data from local link cells and we are guaranteed that the same atoms exist in the same order in corresponding halo cells on remote tasks. The only tricky part is the size of the plane of local cells that needs to be sent grows in each direction. This is because the y-axis send must send some of the data that was received from the x-axis send, and the z-axis must send some data from the y-axis send. This accumulation of data to send is responsible for data reaching neighbor cells that share only edges or corners.
Definition at line 205 of file haloExchange.c.


Sort the atoms by gid in the specified link cell.
The force exchange assumes that the atoms are in the same order in both a given local link cell and the corresponding remote cell(s). However, the atom exchange does not guarantee this property, especially when atoms cross a domain decomposition boundary and move from one task to another. Trying to maintain the atom order during the atom exchange would immensely complicate that code. Instead, we just sort the atoms after the atom exchange.
Definition at line 612 of file haloExchange.c.

