35 #include "Utils/clusterspecifier.h" 62 std::array<int, 4> subLatticeSize);
66 static int rank() {
return m_rank; }
67 static int numProcs() {
return m_numProcs; }
68 static int activeProcs() {
return m_activeProcs; }
69 static bool isActive() {
return m_isActive; }
70 static MPI_Comm cartCoordComm() {
return m_cartCoordComm; }
71 static std::array<int, 4>& subBlocks() {
return m_subBlocks; }
72 static std::array<int, 4>& rankCoord() {
return m_rankCoord; }
73 static std::array<int, 4>& latticeSubSize() {
return m_latticeSubSize; }
74 static std::array<int, 4>& latticeFullSize() {
return m_latticeFullSize; }
75 static std::array<int, 4>& parity(){
return m_parity; }
80 int direction2,
int sign2);
83 static void openFile (MPI_File& file,
const char *fileName);
89 static int m_numProcs;
90 static int m_activeProcs;
91 static bool m_isActive;
92 static MPI_Comm m_cartCoordComm;
93 static std::array<int, 4> m_subBlocks;
94 static std::array<int, 4> m_rankCoord;
95 static std::array<int, 4> m_latticeSubSize;
96 static std::array<int, 4> m_latticeFullSize;
97 static std::array<int, 4> m_parity;
98 static MPI_Comm m_cartCoords;
99 static std::array< std::array<int, 2>, 4> m_neighbor;
100 static std::array< std::array<std::array<std::array<int, 2>, 4>, 2>, 4> m_secondNeighbor;
107 int dir2,
int shift2,
108 int &source,
int &dest);
static void createNeighborLists()
Create castesian coordinates and creates neighbor lists for every processor in every direction...
static void assignSecondNeighbor(int dir1, int dir2)
use MPI utilities to find the neighbors in two direction
static void initialize()
initializes MPI, gets the rank number and the total numer of processors
static void createGeometry(std::array< int, 4 > latticeSize, std::array< int, 4 > subLatticeSize)
creates the parallel gemometry of the lattice
Class to manage the parallelization scheme.
static void assignNeighbor(int direction)
use MPI utilities to find the neighbors in one direction
static void MyMPI_Cart_shift2(MPI_Comm comm, int dir1, int shift1, int dir2, int shift2, int &source, int &dest)
use MPI utilities to find the neighbors in two direction
static void closeFile(MPI_File &file)
closes a file with MPI
static int getSecondNeighbor(int direction1, int sign1, int direction2, int sign2)
return the rank of the neighbor along the two given directions and signs
static int getNeighbor(int direction, int sign)
return the rank of the neighbor along the given direction and sign
static void finalize()
finalizes MPI
static void openFile(MPI_File &file, const char *fileName)
opens a file with MPI