From 5f6d6a789f09b255718a4e859226d3b5d6f8703a Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Wed, 25 Jul 2018 11:14:49 +0100 Subject: Replace openmp with std::thread --- src/main/evaluation/solvability_calc.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/main/evaluation/solvability_calc.h') diff --git a/src/main/evaluation/solvability_calc.h b/src/main/evaluation/solvability_calc.h index 128b0b3..cbc3394 100644 --- a/src/main/evaluation/solvability_calc.h +++ b/src/main/evaluation/solvability_calc.h @@ -20,11 +20,11 @@ public: void calculate_solvability_percentage(uint64_t, int, uint, command_line_helper::streamliner_opt, const std::vector&); - typedef std::pair seed_result; private: + typedef std::pair seed_result; struct seed_results { - explicit seed_results(std::vector); + seed_results(); void add_result(solver::result::type); std::atomic solvable; @@ -34,17 +34,26 @@ private: }; // Printing methods - void print_header(long, command_line_helper::streamliner_opt) const; + void print_header(long) const; static void print_general_info(const seed_results&); static void print_seed_info(seed_result); static void print_null_seed_info(); static void print_seeds_in_prog(std::set&); // Solving methods + static void solver_thread(solvability_calc*, uint core); static seed_result solve_seed(int, std::chrono::milliseconds, const sol_rules&, uint64_t, game_state::streamliner_options); const sol_rules& rules; const uint64_t cache_capacity; + std::chrono::milliseconds timeout; + std::mutex results_mutex; + seed_results seed_res; + std::set seeds_in_progress; + std::vector resume_seeds; + std::atomic current_seed; + int seed_count; + command_line_helper::streamliner_opt stream_opt; }; -- cgit v1.2.1