From 567b9aafddc84dfcdb9f8521529b74d18686b158 Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Thu, 14 Jun 2018 13:42:03 +0100 Subject: Add cores cmdln arg --- src/main/input-output/input/command_line_helper.cpp | 13 +++++++++++++ src/main/input-output/input/command_line_helper.h | 2 ++ 2 files changed, 15 insertions(+) (limited to 'src/main/input-output/input') 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(), "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(); + } 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; -- cgit v1.2.1