TRIQS/mpi 2.0.0
C++ interface to MPI
Loading...
Searching...
No Matches
mpi::environment

#include <mpi/environment.hpp>

Detailed Description

RAII class to initialize and finalize MPI.

Calls MPI_Init upon construction and MPI_Finalize upon destruction i.e. when the environment object goes out of scope. If mpi::has_env is false, this struct does nothing.

Definition at line 79 of file environment.hpp.

Public Member Functions

 environment (int argc, char *argv[])
 Construct a new mpi environment object by calling MPI_Init.
 ~environment ()
 Destroy the mpi environment object by calling MPI_Finalize.

Constructor & Destructor Documentation

◆ environment()

mpi::environment::environment ( int argc,
char * argv[] )
inline

Construct a new mpi environment object by calling MPI_Init.

Checks first if the program is run with an MPI runtime environment and if it has not been initialized before to avoid errors.

Direct calls the MPI C API are checked for success with mpi::check_mpi_call.

Parameters
argcNumber of command line arguments.
argvCommand line arguments.

Definition at line 91 of file environment.hpp.

◆ ~environment()

mpi::environment::~environment ( )
inline

Destroy the mpi environment object by calling MPI_Finalize.

Checks first if the program is run with an MPI runtime environment and if it has not been finalized before to avoid errors.

Definition at line 101 of file environment.hpp.


The documentation for this struct was generated from the following file: