25 std::shared_ptr<Output::OutputWriter> writer,
26 mpi::environment& env,
27 mpi::communicator& world,
28 std::shared_ptr<MathLoggerDriver> mathLoggerDriver);
32 std::string BendersName()
const override
45 mpi::communicator& _world;
48 void step_1_solve_master();
49 void step_2_solve_subproblems_and_build_cuts();
50 void step_4_update_best_solution(
int rank);
52 void master_build_cuts(std::vector<SubProblemDataMap> gathered_subproblem_map);
53 SubProblemDataMap get_subproblem_cut_package();
55 void solve_master_and_create_trace();
57 void do_solve_master_create_trace_and_update_cuts();
59 virtual void gather_subproblems_cut_package_and_build_cuts(
60 const SubProblemDataMap& subproblem_data_map,
61 const Timer& process_timer);
63 void write_exception_message(
const std::exception& ex)
const;
65 void check_if_some_proc_had_a_failure(
int success);
67 mpi::environment& _env;
70 [[nodiscard]]
bool shouldParallelize()
const final
75 void PreRunInitialization();
83 void BroadCast(T& value,
int root)
const
85 mpi::broadcast(_world, value, root);
89 void BroadCast(T* values,
int n,
int root)
const
91 mpi::broadcast(_world, values, n, root);
95 void Gather(
const T& value, std::vector<T>& vector_of_values,
int root)
const
97 mpi::gather(_world, value, vector_of_values, root);
100 void BuildMasterProblem();
102 int WorldSize()
const
104 return _world.size();
112 template<
typename T,
typename Op>
113 void Reduce(
const T& in_value, T& out_value, Op op,
int root)
const
115 mpi::reduce(_world, in_value, out_value, op, root);
118 template<
typename T,
typename Op>
119 void AllReduce(
const T& in_value, T& out_value, Op op)
const
121 mpi::all_reduce(_world, in_value, out_value, op);
124 virtual void GatherCuts(
const SubProblemDataMap& subproblem_data_map,
const Timer& walltime);
125 void BroadCastVariablesIndices();
126 virtual void ComputeSubproblemsContributionToCriteria(
127 const SubProblemDataMap& subproblem_data_map);
129 const std::string& name,
130 const std::shared_ptr<SubproblemWorker>& worker)
override;
131 void UpdateMaxCriterionArea();