TRIQS/mpi 1.3.0
C++ interface to MPI
|
Simplify the initialization/finalization of an MPI environment and the usage of an MPI_Comm
object by wrapping it in a C++ class.
A typical Hello world!
program using mpi::environment and mpi::communicator is as easy as:
Output (depends on the number of processes and the order is arbitrary):
Classes | |
class | mpi::communicator |
C++ wrapper around MPI_Comm providing various convenience functions. More... | |
struct | mpi::environment |
RAII class to initialize and finalize MPI. More... | |
Functions | |
bool | mpi::is_initialized () noexcept |
Check if MPI has been initialized. | |
Variables | |
static const bool | mpi::has_env |
Boolean variable that is true, if one of the environment variables OMPI_COMM_WORLD_RANK , PMI_RANK , CRAY_MPICH_VERSION or FORCE_MPI_INIT is set, false otherwise. | |
|
inlinenodiscardnoexcept |
#include <mpi/environment.hpp>
Check if MPI has been initialized.
It throws an exception in case a call to the MPI C library fails.
MPI_Init
has been called, false otherwise. Definition at line 42 of file environment.hpp.
|
static |
#include <mpi/environment.hpp>
Boolean variable that is true, if one of the environment variables OMPI_COMM_WORLD_RANK
, PMI_RANK
, CRAY_MPICH_VERSION
or FORCE_MPI_INIT
is set, false otherwise.
The environment variables are set, when a program is executed with mpirun
or mpiexec
.
Definition at line 54 of file environment.hpp.