MaMiCo 1.2
|
The XYZTopology orders the ranks in x-y-z manner. More...
#include <XYZTopology.h>
Public Member Functions | |
XYZTopology (tarch::la::Vector< dim, unsigned int > numberProcesses) | |
virtual | ~XYZTopology () |
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 |
converts process coordinates into a rank. | |
![]() | |
virtual | ~ParallelTopology () |
Private Attributes | |
const tarch::la::Vector< dim, unsigned int > | _numberProcesses |
const tarch::la::Vector< dim, unsigned int > | _divisionFactor4NumberProcesses |
The XYZTopology orders the ranks in x-y-z manner.
the XYZTopology orders the ranks in x-y-z manner, i.e. we obtain the rank from process coordinates (x,y,z) by z*nx*ny + y*nx + x=x + nx*(y+ny*z), where nx,ny,nz are the numbers of processes in x,y,z-direction. topologyOffset can be used to shift the whole topology by an offset of ranks. 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=1,y=0,z=0. Rank=2 for x=0,y=1,z=0. Rank=3 for x=1,y=1,z=0. Rank=4 for x=0,y=0,z=1. Rank=5 for x=1,y=0,z=1. Rank=6 for x=0,y=1,z=1. 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 |
converts process coordinates into a rank.
This function takes process coordinates as input and returns the correpsponding rank.
processCoordinates | Process coordinates |
Implements coupling::paralleltopology::ParallelTopology< dim >.