55 if (std::getenv(
"OMPI_COMM_WORLD_RANK") !=
nullptr or std::getenv(
"PMI_RANK") !=
nullptr or std::getenv(
"CRAY_MPICH_VERSION") !=
nullptr
56 or std::getenv(
"FORCE_MPI_INIT") !=
nullptr)
static const bool has_env
Boolean variable that is true, if one of the environment variables OMPI_COMM_WORLD_RANK,...
bool is_initialized() noexcept
Check if MPI has been initialized.
void check_mpi_call(int errcode, const std::string &mpi_routine)
Check the success of an MPI call.
RAII class to initialize and finalize MPI.
~environment()
Destroy the mpi environment object by calling MPI_Finalize.
environment(int argc, char *argv[])
Construct a new mpi environment object by calling MPI_Init.
Provides general utilities related to MPI.