5#ifndef _MOLECULARDYNAMICS_COUPLING_PARALLELTOPOLOGY_ZYXTOPOLOGY_H_
6#define _MOLECULARDYNAMICS_COUPLING_PARALLELTOPOLOGY_ZYXTOPOLOGY_H_
8#include "coupling/CouplingMDDefinitions.h"
9#include "coupling/paralleltopology/ParallelTopology.h"
43 unsigned int help = rank - topologyOffset;
44 for (
unsigned int d = 0; d < dim; d++) {
45 processCoordinates[d] = help / _divisionFactor4NumberProcesses[d];
46 help = help - processCoordinates[d] * _divisionFactor4NumberProcesses[d];
48#if (COUPLING_MD_DEBUG == COUPLING_MD_YES)
49 std::cout <<
"Rank=" << rank <<
" corresponds to process coordinates=" << processCoordinates << std::endl;
51 return processCoordinates;
57 unsigned int rank = processCoordinates[0];
58 for (
unsigned int d = 1; d < dim; d++) {
59 rank = rank * _numberProcesses[d] + processCoordinates[d];
61 return rank + topologyOffset;
69 for (
int d = dim - 2; d > -1; d--) {
70 div[d] = div[d + 1] * numberProcesses[d + 1];
This class performs the conversion rank <-> process coordinates.
Definition ParallelTopology.h:27
The ZYXTopology orders the ranks in z-y-x manner.
Definition ZYXTopology.h:31
tarch::la::Vector< dim, unsigned int > getProcessCoordinates(unsigned int rank, unsigned int topologyOffset) const
converts rank into process coordinates.
Definition ZYXTopology.h:41
ZYXTopology(tarch::la::Vector< dim, unsigned int > numberProcesses)
Definition ZYXTopology.h:34
tarch::la::Vector< dim, unsigned int > initDivisionFactor(tarch::la::Vector< dim, unsigned int > numberProcesses) const
Definition ZYXTopology.h:67
unsigned int getRank(tarch::la::Vector< dim, unsigned int > processCoordinates, unsigned int topologyOffset) const
Definition ZYXTopology.h:56
virtual ~ZYXTopology()
Definition ZYXTopology.h:39
Definition ParallelTopology.h:12
everything necessary for coupling operations, is defined in here
Definition AdditiveMomentumInsertion.h:15