21 std::shared_ptr<ILogger> logger,
22 std::shared_ptr<Output::OutputWriter> writer,
23 mpi::communicator& world,
24 std::shared_ptr<MathLoggerDriver> mathLoggerDriver);
28 std::string BendersName()
const override
40 void master_build_cuts(
const std::vector<SubProblemDataMap>& gathered_subproblem_map);
41 void SetSubproblemDataCostAndSimplexIter(
42 const std::vector<SubProblemDataMap>& gathered_subproblem_map);
44 mpi::communicator& _world;
47 void step_1_solve_master();
48 void step_2_solve_subproblems_and_build_cuts();
49 void step_4_update_best_solution(
int rank);
51 std::vector<SubProblemNamesInCut> get_subs_per_cut(
const std::vector<SubProblemNamesInCut>&,
54 SubProblemDataMap get_subproblem_cut_package();
56 void solve_master_and_create_trace();
58 void do_solve_master_create_trace_and_update_cuts();
60 virtual void gather_subproblems_cut_package_and_build_cuts(
61 const SubProblemDataMap& subproblem_data_map,
62 const Timer& process_timer);
64 void write_exception_message(
const std::exception& ex)
const;
66 void check_if_some_proc_had_a_failure(
int success);
68 std::vector<SubProblemNamesInCut> subproblem_per_cut_indices_;
71 void InitializeMaster();
73 [[nodiscard]]
bool shouldParallelize()
const final
78 void PreRunInitialization();
86 void BroadCast(T& value,
int root)
const
88 mpi::broadcast(_world, value, root);
92 void BroadCast(T* values,
int n,
int root)
const
94 mpi::broadcast(_world, values, n, root);
98 void Gather(
const T& value, std::vector<T>& vector_of_values,
int root)
const
100 mpi::gather(_world, value, vector_of_values, root);
103 virtual void BuildMasterProblem();
105 int WorldSize()
const
107 return _world.size();
115 template<
typename T,
typename Op>
116 void Reduce(
const T& in_value, T& out_value, Op op,
int root)
const
118 mpi::reduce(_world, in_value, out_value, op, root);
121 template<
typename T,
typename Op>
122 void AllReduce(
const T& in_value, T& out_value, Op op)
const
124 mpi::all_reduce(_world, in_value, out_value, op);
127 virtual void GatherCuts(
const SubProblemDataMap& subproblem_data_map,
const Timer& walltime);
128 void BroadCastVariablesIndices();
129 virtual void ComputeSubproblemsContributionToCriteria(
130 const SubProblemDataMap& subproblem_data_map);
132 const std::string& name,
133 const std::shared_ptr<SubproblemWorker>& worker)
override;
134 void UpdateMaxCriterionArea();
Definition BendersMPI.h:138