SIRIUS 7.5.0
Electronic structure library and applications
|
MPI grid interface. More...
#include <mpi_grid.hpp>
Public Member Functions | |
Grid (std::vector< int > dimensions__, Communicator const &parent_communicator__) | |
int | num_dimensions () const |
Actual number of grid dimensions. More... | |
auto const & | communicator (int directions__=0xFF) const |
Private Member Functions | |
int | valid_directions (int directions__) const |
Return valid directions for the current grid dimensionality. More... | |
void | initialize () |
Initialize the grid. More... | |
Grid (Grid const &src)=delete | |
Grid & | operator= (Grid const &src)=delete |
Private Attributes | |
std::vector< int > | dimensions_ |
Dimensions of the grid. More... | |
Communicator const & | parent_communicator_ |
Parent communicator. More... | |
Communicator | base_grid_communicator_ |
Grid communicator of the enrire grid returned by MPI_Cart_create. More... | |
std::vector< Communicator > | communicators_ |
Grid communicators. More... | |
MPI grid interface.
The following terminology is used. Suppose we have a 4x5 grid of MPI ranks. We say it's a two-dimensional grid with the first dimension of the size 4 and the second dimensoion of the size 5. The actual number of grid dimensions is two, however we may also consider the grid as being a D-dimensional (D >= 2) with implicit dimension sizes equal to one, e.g. 4x5 := 4x5x1x1x1... The communication happens along single or multiple directions along the grid dimensions. We specify directions wth bits, eg. directions=00000101 reads as "communication along 1-st and 3-rd dimensions".
In the provided example the corresponding communicator is MPI_grid::communicator(1 << d0), where d0 is the integer index of dimension.
Definition at line 46 of file mpi_grid.hpp.
|
inline |
Definition at line 128 of file mpi_grid.hpp.
|
inlineprivate |
Return valid directions for the current grid dimensionality.
Definition at line 64 of file mpi_grid.hpp.
|
inlineprivate |
Initialize the grid.
Definition at line 70 of file mpi_grid.hpp.
|
inline |
Actual number of grid dimensions.
Definition at line 136 of file mpi_grid.hpp.
|
inline |
Definition at line 141 of file mpi_grid.hpp.
|
private |
Dimensions of the grid.
Definition at line 50 of file mpi_grid.hpp.
|
private |
Parent communicator.
Definition at line 53 of file mpi_grid.hpp.
|
private |
Grid communicator of the enrire grid returned by MPI_Cart_create.
Definition at line 56 of file mpi_grid.hpp.
|
private |
Grid communicators.
Grid comminicators are built for all possible combinations of directions, i.e. 001, 010, 011, etc. First communicator is the trivial "self" communicator; the last communicator handles the entire grid.
Definition at line 61 of file mpi_grid.hpp.