OGS
BaseLib::MPI::Setup Struct Reference

Detailed Description

Definition at line 24 of file MPI.h.

#include <MPI.h>

Public Member Functions

 Setup (int argc, char *argv[])
 ~Setup ()

Constructor & Destructor Documentation

◆ Setup()

BaseLib::MPI::Setup::Setup ( int argc,
char * argv[] )

Definition at line 15 of file MPI.cpp.

16{
17#ifdef USE_PETSC
18 {
19 int mpi_init;
20 MPI_Initialized(&mpi_init);
21 if (mpi_init == 1)
22 {
24 "MPI has already been initialized. OGS does not support "
25 "multiple MPI sessions in the same process");
26 }
27 }
28
29 {
30 int mpi_fin;
31 MPI_Finalized(&mpi_fin);
32 if (mpi_fin == 1)
33 {
35 "MPI has already been shut down. OGS does not support multiple "
36 "MPI sessions in the same process");
37 }
38 }
39
40 MPI_Init(&argc, &argv);
41#else
42 (void)argc;
43 (void)argv;
44#endif
45}
#define OGS_FATAL(...)
Definition Error.h:19

References OGS_FATAL.

◆ ~Setup()

BaseLib::MPI::Setup::~Setup ( )

Definition at line 47 of file MPI.cpp.

48{
49#ifdef USE_PETSC
50 int mpi_init;
51 MPI_Initialized(&mpi_init);
52 if (mpi_init == 1)
53 {
54 MPI_Finalize();
55 }
56#endif // USE_PETSC
57}

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