Skip to content

Commit

Permalink
feat: use dense gain cache for Jet
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSeemaier committed May 8, 2024
1 parent 9ed1d20 commit 108e6da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions kaminpar-shm/refinement/balancer/greedy_balancer.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <tbb/task_arena.h>

#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"
Expand Down Expand Up @@ -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<true> *gain_cache) {
void track_moves(DenseGainCache<> *gain_cache) {
_gain_cache = gain_cache;
}

Expand Down Expand Up @@ -145,6 +145,6 @@ class GreedyBalancer : public Refiner {

Statistics _stats;

SparseGainCache<true> *_gain_cache = nullptr;
DenseGainCache<> *_gain_cache = nullptr;
};
} // namespace kaminpar::shm
4 changes: 2 additions & 2 deletions kaminpar-shm/refinement/jet/jet_refiner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -39,7 +39,7 @@ bool JetRefiner::refine(PartitionedGraph &p_graph, const PartitionContext &p_ctx
SCOPED_TIMER("Jet Refiner");

START_TIMER("Allocation");
SparseGainCache<true> gain_cache(_ctx, p_graph.n(), p_graph.k());
DenseGainCache<true> gain_cache(_ctx, p_graph.n(), p_graph.k());
gain_cache.initialize(p_graph);

NoinitVector<BlockID> next_partition(p_graph.n());
Expand Down

0 comments on commit 108e6da

Please sign in to comment.