44
55#pragma once
66
7+ #include " batch_parameter.hpp"
78#include " job_interface.hpp"
89
910#include " main_core/calculation_info.hpp"
@@ -40,7 +41,7 @@ class JobDispatch {
4041 }
4142
4243 // calculate once to cache, ignore results
43- adapter.cache_calculate (std::forward<Calculate>(calculation_fn));
44+ adapter.cache_calculate (std::forward<Calculate>(calculation_fn)); // TODO(figueroa1395): Time this step
4445
4546 // error messages
4647 std::vector<std::string> exceptions (n_scenarios, " " );
@@ -85,13 +86,15 @@ class JobDispatch {
8586 adapter.winddown ();
8687 };
8788
88- auto recover_from_bad = [&adapter, ©_adapter_functor, &thread_info]() {
89- main_core::merge_into (thread_info, adapter.get_calculation_info ());
89+ auto recover_from_bad = [&adapter, ©_adapter_functor]() {
90+ // TODO(figueroa1395): Time this step
91+ // how do we want to deal with exceptions and timing?
9092 adapter = copy_adapter_functor ();
9193 };
9294
93- auto run = [&adapter, &calculation_fn_, &result_data](Idx scenario_idx) {
95+ auto run = [&adapter, &calculation_fn_, &result_data, &thread_info ](Idx scenario_idx) {
9496 adapter.calculate (calculation_fn_, result_data, scenario_idx);
97+ main_core::merge_into (thread_info, adapter.get_calculation_info ());
9598 };
9699
97100 auto calculate_scenario = JobDispatch::call_with<Idx>(
@@ -104,7 +107,6 @@ class JobDispatch {
104107 }
105108
106109 t_total.stop ();
107- main_core::merge_into (thread_info, adapter.get_calculation_info ());
108110 base_adapter.thread_safe_add_calculation_info (thread_info);
109111 };
110112 }
0 commit comments