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