OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
IpplInfoWrapper.cpp
Go to the documentation of this file.
1//
2// Copyright & License: See Copyright.readme in src directory
3//
4
6#include <cstring>
7#include "Utility/Inform.h"
8
9extern Inform* gmsg;
11 const std::string& inputFileName, int infoLevel, int warnLevel, MPI_Comm /*comm*/) {
12 std::string infoLevelStr = std::to_string(infoLevel);
13 std::string warnLevelStr = std::to_string(warnLevel);
14
15 exeName_m = 0;
17 noComm_m = inputFileName_m + inputFileName.size() + 1;
18 info_m = noComm_m + 13;
19 infoLevel_m = info_m + 7;
20 warn_m = infoLevel_m + infoLevelStr.size() + 1;
21 warnLevel_m = warn_m + 7;
22
23 unsigned int totalSize = warnLevel_m + warnLevelStr.size() + 1;
24 buffer_m = new char[totalSize];
25
26 strcpy(buffer_m + exeName_m, "opal");
27 strcpy(buffer_m + inputFileName_m, inputFileName.c_str());
28 strcpy(buffer_m + noComm_m, "--nocomminit");
29 strcpy(buffer_m + info_m, "--info");
30 strcpy(buffer_m + infoLevel_m, infoLevelStr.c_str());
31 strcpy(buffer_m + warn_m, "--warn");
32 strcpy(buffer_m + warnLevel_m, warnLevelStr.c_str());
33
34 arg_m = new char*[7];
37 arg_m[2] = buffer_m + noComm_m;
38 arg_m[3] = buffer_m + info_m;
40 arg_m[5] = buffer_m + warn_m;
42
43 // int narg = 5;
44 // instance_m = new Ippl(narg, arg_m, Ippl::KEEP, comm);
45 *gmsg << "passed MPI_Comm argument not used in IpplInfoWrapper constructor" << endl;
46}
47
49 // delete instance_m;
50 delete[] buffer_m;
51 delete[] arg_m;
52
53 // Ippl::deleteGlobals();
54}
Inform * gmsg
Definition changes.cpp:7
Inform * gmsg
Definition changes.cpp:7
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