1 #ifndef COMMAND_LINE_INPUTS_HPP
2 #define COMMAND_LINE_INPUTS_HPP
16 std::string arg = argv[i+1];
19 int x = std::stoi(arg, &pos);
20 if (pos >= arg.size()) {
52 bool check(std::string input, std::string name, std::string explanation){
63 std::string msg =
"Available options are:\n";
64 for(
int j = 0; j <
options.size(); j++)
65 msg +=
"\t" +
options[j].name +
"\t" +
options[j].explanation +
"\n";
66 printf(
"%s", msg.c_str());
70 printf(
"ERROR: %s\n", msg.c_str());
88 for (
int i = 1; i < argc; ++i) {
89 std::string input = std::string(argv[i]);
92 if(
check(input,
"--test",
"Checks particles against reference data")){
95 if(
check(input,
"--update-test",
"Updates reference data used in particle test")){
98 if(
check(input,
"--moments-test",
"Checks moments against reference data")){
101 if(
check(input,
"--update-moments-test",
"Updates reference data used in moments test")){
104 if(
check(input,
"--debug",
"Activates extra barriered checkpoints and validity checks (not intended for production)")){
107 if(
check(input,
"--dryrun",
"Partially runs XGC setup to check for some common input errors")){
111 if(
check(input,
"-n_ranks",
"Optional input if using --dryrun: Specify the number of MPI ranks you plan to use")){
113 error(
"-n_ranks can only be used with --dryrun");
116 if(ierr!=0)
error(
"Expected integer after -n_ranks");
120 error(
"Unknown command line argument " + input);
Option
Definition: streamed_parallel_for.hpp:13