diff options
| author | Charlie Blake | 2018-06-14 13:42:03 +0100 |
|---|---|---|
| committer | Charlie Blake | 2018-06-14 13:42:03 +0100 |
| commit | 567b9aafddc84dfcdb9f8521529b74d18686b158 (patch) | |
| tree | a9ebcbc9a6e53ec4e6ca2a9efdac4b477cc08059 /src/main/input-output/input | |
| parent | Add parallelism (diff) | |
| download | metasol-567b9aafddc84dfcdb9f8521529b74d18686b158.tar.gz metasol-567b9aafddc84dfcdb9f8521529b74d18686b158.zip | |
Add cores cmdln arg
Diffstat (limited to 'src/main/input-output/input')
| -rw-r--r-- | src/main/input-output/input/command_line_helper.cpp | 13 | ||||
| -rw-r--r-- | src/main/input-output/input/command_line_helper.h | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/main/input-output/input/command_line_helper.cpp b/src/main/input-output/input/command_line_helper.cpp index 0f685cb..cfbfd2f 100644 --- a/src/main/input-output/input/command_line_helper.cpp +++ b/src/main/input-output/input/command_line_helper.cpp @@ -44,6 +44,8 @@ command_line_helper::command_line_helper() "percentage of the supplied solitaire game, given a timeout in milliseconds. Must supply " "either 'random', 'benchmark', 'solvability' or list of deals to be " "solved.") + ("cores", po::value<int>(), "the number of cores for the solvability percentages to be run across. " + "Must be supplied with the solvability option.") ("benchmark", "outputs performance statistics for the solver on the " "supplied solitaire game. Must supply " "either 'random', 'benchmark', 'solvability' or list of deals to be " @@ -116,6 +118,13 @@ bool command_line_helper::parse(int argc, const char* argv[]) { solvability = -1; } + if (vm.count("cores")) { + cores = vm["cores"].as<int>(); + } else { + cores = 1; + } + + benchmark = (vm.count("benchmark") != 0); // Handle logic error scenarios @@ -219,6 +228,10 @@ int command_line_helper::get_solvability() { return solvability; } +int command_line_helper::get_cores() { + return cores; +} + bool command_line_helper::get_available_game_types() { return available_game_types; } diff --git a/src/main/input-output/input/command_line_helper.h b/src/main/input-output/input/command_line_helper.h index 5220895..f3320da 100644 --- a/src/main/input-output/input/command_line_helper.h +++ b/src/main/input-output/input/command_line_helper.h @@ -18,6 +18,7 @@ public: int get_random_deal(); bool get_classify(); int get_solvability(); + int get_cores(); bool get_available_game_types(); bool get_benchmark(); uint64_t get_cache_capacity(); @@ -43,6 +44,7 @@ private: bool help; bool classify; int solvability; + int cores; bool available_game_types; bool benchmark; uint64_t cache_capacity; |
