@@ -86,30 +86,6 @@ class BspScheduleCostEvaluator {
8686 return max_comm_per_step;
8787 }
8888
89- std::vector<v_workw_t <Graph_t>> compute_max_work_per_step_helper () const {
90- const unsigned number_of_supersteps = schedule.numberOfSupersteps ();
91- std::vector<std::vector<v_workw_t <Graph_t>>> work = std::vector<std::vector<v_workw_t <Graph_t>>>(
92- number_of_supersteps, std::vector<v_workw_t <Graph_t>>(instance.numberOfProcessors (), 0 ));
93- for (const auto &node : instance.vertices ()) {
94- work[schedule.assignedSuperstep (node)][schedule.assignedProcessor (node)] +=
95- instance.getComputationalDag ().vertex_work_weight (node);
96- }
97-
98- std::vector<v_workw_t <Graph_t>> max_work_per_step (number_of_supersteps, 0 );
99- for (unsigned step = 0 ; step < number_of_supersteps; step++) {
100- v_workw_t <Graph_t> max_work = 0 ;
101- for (unsigned proc = 0 ; proc < instance.numberOfProcessors (); proc++) {
102- if (max_work < work[step][proc]) {
103- max_work = work[step][proc];
104- }
105- }
106-
107- max_work_per_step[step] = max_work;
108- }
109-
110- return max_work_per_step;
111- }
112-
11389 public:
11490 /* *
11591 * @brief Construct a new Bsp Schedule Cost Evaluator object.
@@ -150,6 +126,35 @@ class BspScheduleCostEvaluator {
150126 return costs;
151127 }
152128
129+ /* *
130+ * @brief Computes the work costs for each superstep.
131+ *
132+ * @return The work cost per superstep.
133+ */
134+ std::vector<v_workw_t <Graph_t>> compute_max_work_per_step_helper () const {
135+ const unsigned number_of_supersteps = schedule.numberOfSupersteps ();
136+ std::vector<std::vector<v_workw_t <Graph_t>>> work = std::vector<std::vector<v_workw_t <Graph_t>>>(
137+ number_of_supersteps, std::vector<v_workw_t <Graph_t>>(instance.numberOfProcessors (), 0 ));
138+ for (const auto &node : instance.vertices ()) {
139+ work[schedule.assignedSuperstep (node)][schedule.assignedProcessor (node)] +=
140+ instance.getComputationalDag ().vertex_work_weight (node);
141+ }
142+
143+ std::vector<v_workw_t <Graph_t>> max_work_per_step (number_of_supersteps, 0 );
144+ for (unsigned step = 0 ; step < number_of_supersteps; step++) {
145+ v_workw_t <Graph_t> max_work = 0 ;
146+ for (unsigned proc = 0 ; proc < instance.numberOfProcessors (); proc++) {
147+ if (max_work < work[step][proc]) {
148+ max_work = work[step][proc];
149+ }
150+ }
151+
152+ max_work_per_step[step] = max_work;
153+ }
154+
155+ return max_work_per_step;
156+ }
157+
153158 /* *
154159 * @brief Computes the total work costs of the schedule.
155160 *
0 commit comments