Skip to content

Commit 5c3a2a2

Browse files
this constexpr fix (#35)
1 parent 85d533a commit 5c3a2a2

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

include/osp/bsp/scheduler/LocalSearch/KernighanLin_v2/kl_improver.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ class kl_improver : public ImprovementScheduler<Graph_t> {
201201

202202
inline void process_other_steps_best_move(const unsigned idx, const unsigned node_step, const VertexType& node, const cost_t affinity_current_proc_step, cost_t& max_gain, unsigned& max_proc, unsigned& max_step, const std::vector<std::vector<cost_t>> &affinity_table_node) const {
203203
for (const unsigned p : proc_range.compatible_processors_vertex(node)) {
204-
if constexpr (active_schedule.use_memory_constraint) {
204+
if constexpr (active_schedule_t::use_memory_constraint) {
205205
if( not active_schedule.memory_constraint.can_move(node, p, node_step + idx - window_size)) continue;
206206
}
207207

@@ -236,7 +236,7 @@ class kl_improver : public ImprovementScheduler<Graph_t> {
236236
if (proc == node_proc)
237237
continue;
238238

239-
if constexpr (active_schedule.use_memory_constraint) {
239+
if constexpr (active_schedule_t::use_memory_constraint) {
240240
if( not active_schedule.memory_constraint.can_move(node, proc, node_step + idx - window_size)) continue;
241241
}
242242

@@ -610,7 +610,7 @@ class kl_improver : public ImprovementScheduler<Graph_t> {
610610
std::cout << "computed cost: " << comm_cost_f.compute_schedule_cost_test() << ", current cost: " << thread_data.active_schedule_data.cost << std::endl;
611611
std::cout << ">>>>>>>>>>>>>>>>>>>>>> compute cost not equal to new cost <<<<<<<<<<<<<<<<<<<<" << std::endl;
612612
}
613-
if constexpr (active_schedule.use_memory_constraint) {
613+
if constexpr (active_schedule_t::use_memory_constraint) {
614614
if ( not active_schedule.memory_constraint.satisfied_memory_constraint())
615615
std::cout << "memory constraint not satisfied" << std::endl;
616616
}
@@ -647,7 +647,7 @@ class kl_improver : public ImprovementScheduler<Graph_t> {
647647
std::cout << "computed cost: " << comm_cost_f.compute_schedule_cost_test() << ", current cost: " << thread_data.active_schedule_data.cost << std::endl;
648648
std::cout << ">>>>>>>>>>>>>>>>>>>>>> compute cost not equal to new cost <<<<<<<<<<<<<<<<<<<<" << std::endl;
649649
}
650-
if constexpr (active_schedule.use_memory_constraint) {
650+
if constexpr (active_schedule_t::use_memory_constraint) {
651651
if ( not active_schedule.memory_constraint.satisfied_memory_constraint())
652652
std::cout << "memory constraint not satisfied" << std::endl;
653653
}
@@ -661,7 +661,7 @@ class kl_improver : public ImprovementScheduler<Graph_t> {
661661
std::cout << "computed cost: " << comm_cost_f.compute_schedule_cost_test() << ", current cost: " << thread_data.active_schedule_data.cost << std::endl;
662662
std::cout << ">>>>>>>>>>>>>>>>>>>>>> compute cost not equal to new cost <<<<<<<<<<<<<<<<<<<<" << std::endl;
663663
}
664-
if constexpr (active_schedule.use_memory_constraint) {
664+
if constexpr (active_schedule_t::use_memory_constraint) {
665665
if ( not active_schedule.memory_constraint.satisfied_memory_constraint())
666666
std::cout << "memory constraint not satisfied" << std::endl;
667667
}
@@ -736,7 +736,7 @@ class kl_improver : public ImprovementScheduler<Graph_t> {
736736
std::cout << "computed cost: " << comm_cost_f.compute_schedule_cost_test() << ", current cost: " << thread_data.active_schedule_data.cost << std::endl;
737737
std::cout << ">>>>>>>>>>>>>>>>>>>>>> compute cost not equal to new cost <<<<<<<<<<<<<<<<<<<<" << std::endl;
738738
}
739-
if constexpr (active_schedule.use_memory_constraint) {
739+
if constexpr (active_schedule_t::use_memory_constraint) {
740740
if ( not active_schedule.memory_constraint.satisfied_memory_constraint())
741741
std::cout << "memory constraint not satisfied" << std::endl;
742742
}
@@ -774,7 +774,7 @@ class kl_improver : public ImprovementScheduler<Graph_t> {
774774
std::cout << "computed cost: " << comm_cost_f.compute_schedule_cost_test() << ", current cost: " << thread_data.active_schedule_data.cost << std::endl;
775775
std::cout << ">>>>>>>>>>>>>>>>>>>>>> compute cost not equal to new cost <<<<<<<<<<<<<<<<<<<<" << std::endl;
776776
}
777-
if constexpr (active_schedule.use_memory_constraint) {
777+
if constexpr (active_schedule_t::use_memory_constraint) {
778778
if ( not active_schedule.memory_constraint.satisfied_memory_constraint())
779779
std::cout << "memory constraint not satisfied" << std::endl;
780780
}
@@ -973,7 +973,7 @@ class kl_improver : public ImprovementScheduler<Graph_t> {
973973
std::cout << "computed cost: " << comm_cost_f.compute_schedule_cost_test() << ", current cost: " << thread_data.active_schedule_data.cost << std::endl;
974974
std::cout << ">>>>>>>>>>>>>>>>>>>>>> compute cost not equal to new cost <<<<<<<<<<<<<<<<<<<<" << std::endl;
975975
}
976-
if constexpr (active_schedule.use_memory_constraint) {
976+
if constexpr (active_schedule_t::use_memory_constraint) {
977977
if ( not active_schedule.memory_constraint.satisfied_memory_constraint())
978978
std::cout << "memory constraint not satisfied" << std::endl;
979979
}
@@ -1442,7 +1442,7 @@ void kl_improver<Graph_t, comm_cost_function_t, MemoryConstraint_t, window_size,
14421442
if ((max_step == step) && (max_proc == proc)) {
14431443
recompute_node_max_gain(node, affinity_table, thread_data);
14441444
} else {
1445-
if constexpr (active_schedule.use_memory_constraint) {
1445+
if constexpr (active_schedule_t::use_memory_constraint) {
14461446
if( not active_schedule.memory_constraint.can_move(node, proc, step)) return;
14471447
}
14481448
const unsigned idx = rel_step_idx(node_step, step);
@@ -1481,7 +1481,7 @@ void kl_improver<Graph_t, comm_cost_function_t, MemoryConstraint_t, window_size,
14811481
if (node_step != step) {
14821482
const unsigned idx = rel_step_idx(node_step, step);
14831483
for (const unsigned p : proc_range.compatible_processors_vertex(node)) {
1484-
if constexpr (active_schedule.use_memory_constraint) {
1484+
if constexpr (active_schedule_t::use_memory_constraint) {
14851485
if( not active_schedule.memory_constraint.can_move(node, p, step)) continue;
14861486
}
14871487
const cost_t gain = affinity_table[node][node_proc][window_size] - affinity_table[node][p][idx];
@@ -1495,7 +1495,7 @@ void kl_improver<Graph_t, comm_cost_function_t, MemoryConstraint_t, window_size,
14951495
for (const unsigned proc : proc_range.compatible_processors_vertex(node)) {
14961496
if (proc == node_proc)
14971497
continue;
1498-
if constexpr (active_schedule.use_memory_constraint) {
1498+
if constexpr (active_schedule_t::use_memory_constraint) {
14991499
if( not active_schedule.memory_constraint.can_move(node, proc, step)) continue;
15001500
}
15011501
const cost_t gain = affinity_table[node][node_proc][window_size] - affinity_table[node][proc][window_size];

0 commit comments

Comments
 (0)