From 108e6daca71fc4b36b08b9eac7335a82cda28800 Mon Sep 17 00:00:00 2001 From: Daniel Seemaier Date: Wed, 8 May 2024 22:06:58 +0200 Subject: [PATCH] feat: use dense gain cache for Jet --- kaminpar-shm/refinement/balancer/greedy_balancer.h | 6 +++--- kaminpar-shm/refinement/jet/jet_refiner.cc | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/kaminpar-shm/refinement/balancer/greedy_balancer.h b/kaminpar-shm/refinement/balancer/greedy_balancer.h index 55f76e56..f09d5f6e 100644 --- a/kaminpar-shm/refinement/balancer/greedy_balancer.h +++ b/kaminpar-shm/refinement/balancer/greedy_balancer.h @@ -12,7 +12,7 @@ #include #include "kaminpar-shm/datastructures/partitioned_graph.h" -#include "kaminpar-shm/refinement/gains/sparse_gain_cache.h" +#include "kaminpar-shm/refinement/gains/dense_gain_cache.h" #include "kaminpar-shm/refinement/refiner.h" #include "kaminpar-common/datastructures/binary_heap.h" @@ -91,7 +91,7 @@ class GreedyBalancer : public Refiner { void initialize(const PartitionedGraph &p_graph) final; bool refine(PartitionedGraph &p_graph, const PartitionContext &p_ctx) final; - void track_moves(SparseGainCache *gain_cache) { + void track_moves(DenseGainCache<> *gain_cache) { _gain_cache = gain_cache; } @@ -145,6 +145,6 @@ class GreedyBalancer : public Refiner { Statistics _stats; - SparseGainCache *_gain_cache = nullptr; + DenseGainCache<> *_gain_cache = nullptr; }; } // namespace kaminpar::shm diff --git a/kaminpar-shm/refinement/jet/jet_refiner.cc b/kaminpar-shm/refinement/jet/jet_refiner.cc index 8342a7b2..083f65fd 100644 --- a/kaminpar-shm/refinement/jet/jet_refiner.cc +++ b/kaminpar-shm/refinement/jet/jet_refiner.cc @@ -12,7 +12,7 @@ #include "kaminpar-shm/datastructures/partitioned_graph.h" #include "kaminpar-shm/metrics.h" #include "kaminpar-shm/refinement/balancer/greedy_balancer.h" -#include "kaminpar-shm/refinement/gains/sparse_gain_cache.h" +#include "kaminpar-shm/refinement/gains/dense_gain_cache.h" #include "kaminpar-common/datastructures/noinit_vector.h" #include "kaminpar-common/degree_buckets.h" @@ -39,7 +39,7 @@ bool JetRefiner::refine(PartitionedGraph &p_graph, const PartitionContext &p_ctx SCOPED_TIMER("Jet Refiner"); START_TIMER("Allocation"); - SparseGainCache gain_cache(_ctx, p_graph.n(), p_graph.k()); + DenseGainCache gain_cache(_ctx, p_graph.n(), p_graph.k()); gain_cache.initialize(p_graph); NoinitVector next_partition(p_graph.n());