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

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

#include <XYZTopology.h>

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

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.
 
- Public Member Functions inherited from coupling::paralleltopology::ParallelTopology< dim >
virtual ~ParallelTopology ()
 

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::XYZTopology< dim >

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.

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

◆ XYZTopology()

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

Constructor

◆ ~XYZTopology()

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

Destructor

Member Function Documentation

◆ getProcessCoordinates()

template<unsigned int dim>
tarch::la::Vector< dim, unsigned int > coupling::paralleltopology::XYZTopology< 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::XYZTopology< dim >::getRank ( tarch::la::Vector< dim, unsigned int > processCoordinates,
unsigned int topologyOffset ) const
inlinevirtual

converts process coordinates into a rank.

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

Parameters
processCoordinatesProcess coordinates

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


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