MaMiCo 1.2
Loading...
Searching...
No Matches
coupling::paralleltopology::ZYXTopology< dim > Class Template Reference

The ZYXTopology orders the ranks in z-y-x manner. More...

#include <ZYXTopology.h>

Inheritance diagram for coupling::paralleltopology::ZYXTopology< dim >:
Collaboration diagram for coupling::paralleltopology::ZYXTopology< dim >:

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
 
- Public Member Functions inherited from coupling::paralleltopology::ParallelTopology< dim >
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
 

Detailed Description

template<unsigned int dim>
class coupling::paralleltopology::ZYXTopology< dim >

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.

Template Parameters
dimNumber of dimensions; it can be 1, 2 or 3
Author
Philipp Neumann
Todo
Philipp could you please take a look on this class

Constructor & Destructor Documentation

◆ ZYXTopology()

template<unsigned int dim>
coupling::paralleltopology::ZYXTopology< dim >::ZYXTopology ( tarch::la::Vector< dim, unsigned int > numberProcesses)
inline

Constructor

◆ ~ZYXTopology()

template<unsigned int dim>
virtual coupling::paralleltopology::ZYXTopology< dim >::~ZYXTopology ( )
inlinevirtual

Destructor

Member Function Documentation

◆ getProcessCoordinates()

template<unsigned int dim>
tarch::la::Vector< dim, unsigned int > coupling::paralleltopology::ZYXTopology< dim >::getProcessCoordinates ( unsigned int rank,
unsigned int topologyOffset ) const
inlinevirtual

converts rank into process coordinates.

This function takes rank as input and return the correpsponding process coordinates.

Parameters
rankRank

Implements coupling::paralleltopology::ParallelTopology< dim >.

◆ getRank()

template<unsigned int dim>
unsigned int coupling::paralleltopology::ZYXTopology< dim >::getRank ( tarch::la::Vector< dim, unsigned int > processCoordinates,
unsigned int topologyOffset ) const
inlinevirtual

computes the rank as shown above, see second formula of class definition

Implements coupling::paralleltopology::ParallelTopology< dim >.

◆ initDivisionFactor()

template<unsigned int dim>
tarch::la::Vector< dim, unsigned int > coupling::paralleltopology::ZYXTopology< dim >::initDivisionFactor ( tarch::la::Vector< dim, unsigned int > numberProcesses) const
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).


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