25#ifndef __MPI_GRID_HPP__
26#define __MPI_GRID_HPP__
66 return (directions__ & ((1 <<
dimensions_.size()) - 1));
73 RTE_THROW(
"no dimensions provided for the MPI grid");
83 s <<
"Number of MPI ranks doesn't match the size of the grid." << std::endl <<
" grid dimensions :";
103 for (
int i = 1; i < num_comm; i++) {
109 for (
int j = 0; j < (int)
dimensions_.size(); j++) {
125 Grid& operator=(
Grid const& src) =
delete;
128 Grid(std::vector<int> dimensions__,
Communicator const& parent_communicator__)
141 inline auto const& communicator(
int directions__ = 0xFF)
const
MPI communicator wrapper.
int size() const
Size of the communicator (number of ranks).
Communicator const & parent_communicator_
Parent communicator.
std::vector< int > dimensions_
Dimensions of the grid.
Communicator base_grid_communicator_
Grid communicator of the enrire grid returned by MPI_Cart_create.
std::vector< Communicator > communicators_
Grid communicators.
int valid_directions(int directions__) const
Return valid directions for the current grid dimensionality.
void initialize()
Initialize the grid.
int num_dimensions() const
Actual number of grid dimensions.
Contains declaration and implementation of mpi::Communicator class.
Namespace of the SIRIUS library.
Eror and warning handling during run-time execution.