TRIQS/mpi 1.3.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.

All functions that make direct calls to the MPI C library throw an exception in case the call fails.

Definition at line 70 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.

Parameters
argcNumber of command line arguments.
argvCommand line arguments.

Definition at line 80 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. Called automatically when the environment object goes out of scope.

Definition at line 90 of file environment.hpp.


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