8 #include "CommandLineArguments.hpp" 9 #include "include/pv_common.h" 11 #include "utils/PVAssert.hpp" 12 #include "utils/PVLog.hpp" 20 char const *
const *argv,
21 bool allowUnrecognizedArguments) {
23 initialize(argc, argv, allowUnrecognizedArguments);
30 char const *
const *argv,
31 bool allowUnrecognizedArguments) {
32 resetState(argc, argv, allowUnrecognizedArguments);
38 char const *
const *argv,
39 bool allowUnrecognizedArguments) {
40 bool paramUsage[argc];
41 bool requireReturn =
false;
42 char *outputPath =
nullptr;
43 char *paramsFile =
nullptr;
44 char *logFile =
nullptr;
45 char *gpuDevices =
nullptr;
46 unsigned int randomSeed = 0U;
47 char *workingDir =
nullptr;
49 char *checkpointReadDir =
nullptr;
50 bool useDefaultNumThreads =
false;
69 &useDefaultNumThreads,
75 std::string configString = ConfigParser::createString(
77 std::string{outputPath ? outputPath :
""},
78 std::string{paramsFile ? paramsFile :
""},
79 std::string{logFile ? logFile :
""},
80 std::string{gpuDevices ? gpuDevices :
""},
82 std::string{workingDir ? workingDir :
""},
84 std::string{checkpointReadDir ? checkpointReadDir :
""},
91 std::istringstream configStream{configString};
98 free(checkpointReadDir);
CommandLineArguments(int argc, char const *const *argv, bool allowUnrecognizedArguments)
int initialize(int argc, char const *const *argv, bool allowUnrecognizedArguments)