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
8
namespace
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
18
Environment::~Environment
() {
19
if
(!
finalized
()) {
20
MPI_Finalize();
21
}
22
}
23
24
bool
Environment::initialized
() {
25
int
flag = 0;
26
MPI_Initialized(&flag);
27
return
(flag != 0);
28
}
29
30
bool
Environment::finalized
() {
31
int
flag = 0;
32
MPI_Finalized(&flag);
33
return
(flag != 0);
34
}
35
}
// namespace mpi
36
}
// namespace ippl
Environment.h
Ippl.h
ippl
Implementations for FFT constructor/destructor and transforms.
Definition:
Archive.h:20
ippl::mpi::Environment::Environment
Environment()=delete
ippl::mpi::Environment::initialized
static bool initialized()
Definition:
Environment.cpp:24
ippl::mpi::Environment::finalized
static bool finalized()
Definition:
Environment.cpp:30
ippl::mpi::Environment::~Environment
~Environment()
Definition:
Environment.cpp:18
ippl
src
Communicate
Environment.cpp
Generated on Fri Jan 23 2026 14:39:59 for OPALX (Object Oriented Parallel Accelerator Library for Exascale) by
1.9.3