Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
a-zakir committed Jan 13, 2025
1 parent 3f84ae6 commit 89ed269
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ class CriterionComputation {
*/
const CriterionInputData &getCriterionInputData() const;

bool IsEmpty() const {
return criterion_input_data_.Criteria().empty();
}

private:
std::vector<std::vector<int>> var_indices_ = {};
CriterionInputData criterion_input_data_;
Expand Down
7 changes: 4 additions & 3 deletions src/cpp/benders/benders_mpi/BendersMPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,10 @@ void BendersMpi::GatherCuts(const SubProblemDataMap &subproblem_data_map,

// only rank_0 receive non-emtpy gathered_subproblem_map
master_build_cuts(gathered_subproblem_map);

ComputeSubproblemsContributionToCriteria(subproblem_data_map);
if (_world.rank() == rank_0) {
if (!criterion_computation_.IsEmpty()) {
ComputeSubproblemsContributionToCriteria(subproblem_data_map);
}
if (_world.rank() == rank_0 && !criterion_computation_.IsEmpty()) {
criteria_vector_for_each_iteration_.push_back(
_data.criteria_current_iteration_data.criteria);
UpdateMaxCriterionArea();
Expand Down

0 comments on commit 89ed269

Please sign in to comment.