File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed
Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -112,14 +112,14 @@ class MaxBspSchedule : public BspSchedule<Graph_t> {
112112 const std::vector<v_commw_t <Graph_t>> max_comm_per_step = this ->compute_max_comm_per_step_helper (rec, send);
113113 const std::vector<v_workw_t <Graph_t>> max_work_per_step = this ->compute_max_work_per_step_helper ();
114114
115- v_workw_t <Graph_t> costs = 0 ;
116- for (unsigned step = 0 ; step < this ->number_of_supersteps ; step++) {
117- const auto step_comm_cost = (step == 0 ) ? 0 : max_comm_per_step[step - 1 ];
115+ v_workw_t <Graph_t> costs = 0U ;
116+ for (unsigned step = 0U ; step < this ->number_of_supersteps ; step++) {
117+ const auto step_comm_cost = (step == 0U ) ? 0U : max_comm_per_step[step - 1U ];
118+ if (step_comm_cost > 0U ) {
119+ step_comm_cost += this ->instance ->synchronisationCosts ();
120+ }
118121 costs += std::max (step_comm_cost, max_work_per_step[step]);
119122
120- if (step_comm_cost > 0 ) {
121- costs += this ->instance ->synchronisationCosts ();
122- }
123123 }
124124 return costs;
125125 }
Original file line number Diff line number Diff line change @@ -106,14 +106,14 @@ class MaxBspScheduleCS : public BspScheduleCS<Graph_t> {
106106 const std::vector<v_commw_t <Graph_t>> max_comm_per_step = this ->compute_max_comm_per_step_helper (rec, send);
107107 const std::vector<v_workw_t <Graph_t>> max_work_per_step = this ->compute_max_work_per_step_helper ();
108108
109- v_workw_t <Graph_t> costs = 0 ;
110- for (unsigned step = 0 ; step < this ->number_of_supersteps ; step++) {
111- const auto step_comm_cost = (step == 0 ) ? 0 : max_comm_per_step[step - 1 ];
109+ v_workw_t <Graph_t> costs = 0U ;
110+ for (unsigned step = 0U ; step < this ->number_of_supersteps ; step++) {
111+ const auto step_comm_cost = (step == 0U ) ? 0U : max_comm_per_step[step - 1U ];
112+ if (step_comm_cost > 0U ) {
113+ step_comm_cost += this ->instance ->synchronisationCosts ();
114+ }
112115 costs += std::max (step_comm_cost, max_work_per_step[step]);
113116
114- if (step_comm_cost > 0 ) {
115- costs += this ->instance ->synchronisationCosts ();
116- }
117117 }
118118 return costs;
119119 }
You can’t perform that action at this time.
0 commit comments