OPALX (Object Oriented Parallel Accelerator Library for Exascale) MINIorX
OPALX
Environment.cpp
Go to the documentation of this file.
1//
2// Class Environment
3//
4#include "Ippl.h"
5
6#include "Environment.h"
7
8namespace ippl {
9 namespace mpi {
10
11 Environment::Environment(int& argc, char**& argv, const MPI_Comm& comm)
12 : comm_m(comm) {
13 if (!initialized()) {
14 MPI_Init(&argc, &argv);
15 }
16 }
17
19 if (!finalized()) {
20 MPI_Finalize();
21 }
22 }
23
25 int flag = 0;
26 MPI_Initialized(&flag);
27 return (flag != 0);
28 }
29
31 int flag = 0;
32 MPI_Finalized(&flag);
33 return (flag != 0);
34 }
35 } // namespace mpi
36} // namespace ippl
Implementations for FFT constructor/destructor and transforms.
Definition: Archive.h:20
static bool initialized()
Definition: Environment.cpp:24
static bool finalized()
Definition: Environment.cpp:30