OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
IpplInfoWrapper.cpp
Go to the documentation of this file.
1 //
2 // Copyright & License: See Copyright.readme in src directory
3 //
4 
6 
7 #include <cstring>
8 
9 IpplInfoWrapper::IpplInfoWrapper(const std::string &inputFileName, int infoLevel, int warnLevel, MPI_Comm comm) {
10  std::string infoLevelStr = std::to_string(infoLevel);
11  std::string warnLevelStr = std::to_string(warnLevel);
12 
13  exeName_m = 0;
15  noComm_m = inputFileName_m + inputFileName.size() + 1;
16  info_m = noComm_m + 13;
17  infoLevel_m = info_m + 7;
18  warn_m = infoLevel_m + infoLevelStr.size() + 1;
19  warnLevel_m = warn_m + 7;
20 
21  unsigned int totalSize = warnLevel_m + warnLevelStr.size() + 1;
22  buffer_m = new char[totalSize];
23 
24  strcpy(buffer_m + exeName_m, "opal");
25  strcpy(buffer_m + inputFileName_m, inputFileName.c_str());
26  strcpy(buffer_m + noComm_m, "--nocomminit");
27  strcpy(buffer_m + info_m, "--info");
28  strcpy(buffer_m + infoLevel_m, infoLevelStr.c_str());
29  strcpy(buffer_m + warn_m, "--warn");
30  strcpy(buffer_m + warnLevel_m, warnLevelStr.c_str());
31 
32  arg_m = new char*[7];
33  arg_m[0] = buffer_m + exeName_m;
35  arg_m[2] = buffer_m + noComm_m;
36  arg_m[3] = buffer_m + info_m;
37  arg_m[4] = buffer_m + infoLevel_m;
38  arg_m[5] = buffer_m + warn_m;
39  arg_m[6] = buffer_m + warnLevel_m;
40 
41  int narg = 5;
42  instance_m = new Ippl(narg, arg_m, Ippl::KEEP, comm);
43 }
44 
46  delete instance_m;
47  delete[] buffer_m;
48  delete[] arg_m;
49 
51 }
IpplInfo Ippl
Definition: IpplInfo.h:353
int warnLevel
Definition: Options.cpp:34
int infoLevel
Definition: Options.cpp:29
IpplInfoWrapper(const std::string &inputFileName, int infoLevel, int warnLevel, MPI_Comm comm)
unsigned int noComm_m
unsigned int info_m
unsigned int inputFileName_m
unsigned int warnLevel_m
unsigned int warn_m
unsigned int infoLevel_m
unsigned int exeName_m
static void deleteGlobals()
Definition: IpplInfo.cpp:68
@ KEEP
Definition: IpplInfo.h:74