MaMiCo 1.2
|
The ZYXTopology orders the ranks in z-y-x manner. More...
#include <ZYXTopology.h>
Public Member Functions | |
ZYXTopology (tarch::la::Vector< dim, unsigned int > numberProcesses) | |
virtual | ~ZYXTopology () |
tarch::la::Vector< dim, unsigned int > | getProcessCoordinates (unsigned int rank, unsigned int topologyOffset) const |
converts rank into process coordinates. | |
unsigned int | getRank (tarch::la::Vector< dim, unsigned int > processCoordinates, unsigned int topologyOffset) const |
![]() | |
virtual | ~ParallelTopology () |
Private Member Functions | |
tarch::la::Vector< dim, unsigned int > | initDivisionFactor (tarch::la::Vector< dim, unsigned int > numberProcesses) const |
Private Attributes | |
const tarch::la::Vector< dim, unsigned int > | _numberProcesses |
const tarch::la::Vector< dim, unsigned int > | _divisionFactor4NumberProcesses |
The ZYXTopology orders the ranks in z-y-x manner.
In the ZYXTopology, the process coordinates convert to a rank as rank = x*ny*nz + y*nz + z = z + nz*(y+ny*x) (for 3D). topologyOffset is used for linearized access of multiple MD instances. Derived class from the class ParallelTopology. E.g. assuming ParallelTopologyType = XYZ and there is a cubic domain, splitted into 8 sub-domains (2 sub-domains in each dimension). Then the ordering of the MPI processes is: Rank=0 for x=0,y=0,z=0. Rank=1 for x=0,y=0,z=1. Rank=2 for x=0,y=1,z=0. Rank=3 for x=0,y=1,z=1. Rank=4 for x=1,y=0,z=0. Rank=5 for x=1,y=0,z=1. Rank=6 for x=1,y=1,z=0. Rank=7 for x=1,y=1,z=1.
dim | Number of dimensions; it can be 1, 2 or 3 |
|
inline |
Constructor
|
inlinevirtual |
Destructor
|
inlinevirtual |
converts rank into process coordinates.
This function takes rank as input and return the correpsponding process coordinates.
rank | Rank |
Implements coupling::paralleltopology::ParallelTopology< dim >.
|
inlinevirtual |
computes the rank as shown above, see second formula of class definition
Implements coupling::paralleltopology::ParallelTopology< dim >.
|
inlineprivate |
sets the division factor for each vector entry. For ZYX, this corresponds to (in 3D) (ny*nz,nz,1) and to (2D) (ny,1).