Skip to content

Commit d205740

Browse files
removed unused variables (#33)
1 parent 32eca8f commit d205740

File tree

5 files changed

+23
-11
lines changed

5 files changed

+23
-11
lines changed

include/osp/auxiliary/datastructures/heaps/PairingHeap.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ template <typename Key, typename Value, typename Compare> class PairingHeap {
202202
void push(const Key &key, const Value &value) {
203203
Node *new_node = new Node{key, value};
204204
// emplace and check for success to avoid a separate lookup with contains()
205-
auto [it, success] = node_map.emplace(key, new_node);
205+
const auto pair = node_map.emplace(key, new_node);
206+
const bool &success = pair.second;
206207
if (!success) {
207208
delete new_node; // Avoid memory leak if key already exists
208209
throw std::invalid_argument("Key already exists in the heap.");

include/osp/bsp/model/BspScheduleRecomp.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,10 @@ void BspScheduleRecomp<Graph_t>::mergeSupersteps()
324324
new_assignment.emplace_back(entry.first, new_step_idx[entry.second]);
325325
node_to_processor_and_supertep_assignment[node] = new_assignment;
326326
}
327-
for (auto &[key, step] : commSchedule)
327+
for (auto &key_step_pair : commSchedule) {
328+
auto &step = key_step_pair.second;
328329
step = new_step_idx[step];
330+
}
329331

330332
number_of_supersteps = current_step_idx;
331333
}

include/osp/bsp/scheduler/LocalSearch/KernighanLin_v2/comm_cost_modules/kl_hyper_total_comm_cost.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ struct kl_hyper_total_comm_cost_function {
9696
for(const auto vertex : graph->vertices()) {
9797
const unsigned vertex_proc = active_schedule->assigned_processor(vertex);
9898
const cost_t v_comm_cost = graph->vertex_comm_weight(vertex);
99-
for (const auto [lambda_proc, mult] : node_lambda_map.iterate_proc_entries(vertex)) {
99+
for (const auto lambdaproc_mult_pair : node_lambda_map.iterate_proc_entries(vertex)) {
100+
const auto &lambda_proc = lambdaproc_mult_pair.first;
100101
comm_costs += v_comm_cost * instance->communicationCosts(vertex_proc, lambda_proc);
101102
}
102103
}
@@ -521,7 +522,8 @@ struct kl_hyper_total_comm_cost_function {
521522
if (p == node_proc)
522523
continue;
523524

524-
for (const auto [lambda_proc, mult] : node_lambda_map.iterate_proc_entries(node)) {
525+
for (const auto lambda_pair : node_lambda_map.iterate_proc_entries(node)) {
526+
const auto &lambda_proc = lambda_pair.first;
525527
const cost_t comm_cost = change_comm_cost(instance->communicationCosts(p, lambda_proc), instance->communicationCosts(node_proc, lambda_proc), comm_gain);
526528
for (unsigned idx = node_start_idx; idx < window_bound; idx++) {
527529
affinity_table_node[p][idx] += comm_cost;

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,8 @@ class kl_improver : public ImprovementScheduler<Graph_t> {
430430
std::vector<VertexType> quick_moves_stack;
431431
quick_moves_stack.reserve(10 + thread_data.active_schedule_data.new_violations.size() * 2);
432432

433-
for (const auto& [key, value] : thread_data.active_schedule_data.new_violations) {
433+
for (const auto& key_value_pair : thread_data.active_schedule_data.new_violations) {
434+
const auto &key = key_value_pair.first;
434435
quick_moves_stack.push_back(key);
435436
}
436437

@@ -458,7 +459,8 @@ class kl_improver : public ImprovementScheduler<Graph_t> {
458459
if (thread_data.active_schedule_data.new_violations.size() > 0) {
459460
bool abort = false;
460461

461-
for (const auto& [key, value] : thread_data.active_schedule_data.new_violations) {
462+
for (const auto& key_value_pair : thread_data.active_schedule_data.new_violations) {
463+
const auto &key = key_value_pair.first;
462464
if(local_lock.find(key) != local_lock.end()) {
463465
abort = true;
464466
break;
@@ -545,7 +547,8 @@ class kl_improver : public ImprovementScheduler<Graph_t> {
545547
if (new_num_violations == 0) break;
546548

547549
if (thread_data.active_schedule_data.new_violations.size() > 0) {
548-
for (const auto & [vertex, edge] : thread_data.active_schedule_data.new_violations) {
550+
for (const auto & vertex_edge_pair : thread_data.active_schedule_data.new_violations) {
551+
const auto &vertex = vertex_edge_pair.first;
549552
thread_data.affinity_table.insert(vertex);
550553
}
551554
}
@@ -720,7 +723,8 @@ class kl_improver : public ImprovementScheduler<Graph_t> {
720723

721724
#ifdef KL_DEBUG
722725
std::cout << "recmopute max gain: {";
723-
for (const auto [key, value] : recompute_max_gain) {
726+
for (const auto map_pair : recompute_max_gain) {
727+
const auto &key = map_pair.first;
724728
std::cout << key << ", ";
725729
}
726730
std::cout << "}" << std::endl;
@@ -833,7 +837,8 @@ class kl_improver : public ImprovementScheduler<Graph_t> {
833837

834838
inline bool blocked_edge_strategy(VertexType node, std::vector<VertexType> & unlock_nodes, ThreadSearchContext & thread_data) {
835839
if (thread_data.unlock_edge_backtrack_counter > 1) {
836-
for (const auto [v,e] : thread_data.active_schedule_data.new_violations) {
840+
for (const auto vertex_edge_pair : thread_data.active_schedule_data.new_violations) {
841+
const auto &e = vertex_edge_pair.second;
837842
const auto source_v = source(e, *graph);
838843
const auto target_v = target(e, *graph);
839844

@@ -958,7 +963,8 @@ class kl_improver : public ImprovementScheduler<Graph_t> {
958963
//thread_data.selection_strategy.add_neighbours_to_selection(node, thread_data.affinity_table, thread_data.start_step, thread_data.end_step);
959964
if (thread_data.active_schedule_data.new_violations.size() > 0) {
960965

961-
for (const auto & [vertex, edge] : thread_data.active_schedule_data.new_violations) {
966+
for (const auto & vertex_edge_pair : thread_data.active_schedule_data.new_violations) {
967+
const auto &vertex = vertex_edge_pair.first;
962968
thread_data.affinity_table.insert(vertex);
963969
}
964970
}

include/osp/dag_divider/isomorphism_divider/OrbitGraphProcessor.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,8 @@ class OrbitGraphProcessor {
552552
contraction_map_.assign(dag.num_vertices(), 0);
553553
VertexType coarse_node_idx = 0;
554554

555-
for (const auto &[hash, vertices] : orbits) {
555+
for (const auto &hash_vertices_pair : orbits) {
556+
const auto &vertices = hash_vertices_pair.second;
556557
for (const auto v : vertices) {
557558
contraction_map_[v] = coarse_node_idx;
558559
}

0 commit comments

Comments
 (0)