diff --git a/kaminpar-shm/initial_partitioning/initial_coarsener.cc b/kaminpar-shm/initial_partitioning/initial_coarsener.cc index dc833046..3631bbd2 100644 --- a/kaminpar-shm/initial_partitioning/initial_coarsener.cc +++ b/kaminpar-shm/initial_partitioning/initial_coarsener.cc @@ -182,9 +182,9 @@ InitialCoarsener::ContractionResult InitialCoarsener::contract_current_clusterin timer::LocalTimer timer; timer.reset(); - ScalableVector node_mapping = _hierarchy.alloc_mapping_memory(); + StaticArray node_mapping = _hierarchy.alloc_mapping_memory(); if (node_mapping.size() < _current_graph->n()) { - node_mapping.resize(_current_graph->n()); + node_mapping.resize(_current_graph->n(), static_array::seq); } CSRGraphMemory c_memory = _hierarchy.alloc_graph_memory(); @@ -194,10 +194,10 @@ InitialCoarsener::ContractionResult InitialCoarsener::contract_current_clusterin StaticArray c_edge_weights = std::move(c_memory.edge_weights); if (c_nodes.size() < c_n + 1) { - c_nodes.resize(c_n + 1, static_array::small, static_array::seq); + c_nodes.resize(c_n + 1, static_array::seq); } if (c_node_weights.size() < c_n) { - c_node_weights.resize(c_n, static_array::small, static_array::seq); + c_node_weights.resize(c_n, static_array::seq); } // CSRGraph determines the number of nodes based on the size of the c_nodes array: @@ -206,14 +206,10 @@ InitialCoarsener::ContractionResult InitialCoarsener::contract_current_clusterin c_node_weights.restrict(c_n); if (c_edges.size() < _current_graph->m()) { - c_edges.resize( - _current_graph->m(), static_array::small, static_array::seq, static_array::noinit - ); + c_edges.resize(_current_graph->m(), static_array::seq, static_array::noinit); } if (c_edge_weights.size() < _current_graph->m()) { - c_edge_weights.resize( - _current_graph->m(), static_array::small, static_array::seq, static_array::noinit - ); + c_edge_weights.resize(_current_graph->m(), static_array::seq, static_array::noinit); } // Similarly to the c_nodes array, we must restrict the size of the c_edges array: this is diff --git a/kaminpar-shm/initial_partitioning/initial_coarsener.h b/kaminpar-shm/initial_partitioning/initial_coarsener.h index c29ad304..1b9bc7a4 100644 --- a/kaminpar-shm/initial_partitioning/initial_coarsener.h +++ b/kaminpar-shm/initial_partitioning/initial_coarsener.h @@ -43,7 +43,7 @@ class InitialCoarsener { static constexpr std::size_t kChunkSize = 256; static constexpr std::size_t kNumberOfNodePermutations = 16; - using ContractionResult = std::pair>; + using ContractionResult = std::pair>; public: struct Cluster { diff --git a/kaminpar-shm/initial_partitioning/initial_pool_bipartitioner.cc b/kaminpar-shm/initial_partitioning/initial_pool_bipartitioner.cc index 22595a17..1eab7065 100644 --- a/kaminpar-shm/initial_partitioning/initial_pool_bipartitioner.cc +++ b/kaminpar-shm/initial_partitioning/initial_pool_bipartitioner.cc @@ -79,10 +79,10 @@ void InitialPoolBipartitioner::init(const CSRGraph &graph, const PartitionContex } if (_current_partition.size() < _graph->n()) { - _current_partition.resize(_graph->n(), static_array::small, static_array::seq); + _current_partition.resize(_graph->n(), static_array::seq); } if (_best_partition.size() < _graph->n()) { - _best_partition.resize(_graph->n(), static_array::small, static_array::seq); + _best_partition.resize(_graph->n(), static_array::seq); } reset(); diff --git a/kaminpar-shm/initial_partitioning/sequential_graph_hierarchy.cc b/kaminpar-shm/initial_partitioning/sequential_graph_hierarchy.cc index 081fad8d..dc44d725 100644 --- a/kaminpar-shm/initial_partitioning/sequential_graph_hierarchy.cc +++ b/kaminpar-shm/initial_partitioning/sequential_graph_hierarchy.cc @@ -21,7 +21,7 @@ void SequentialGraphHierarchy::init(const CSRGraph &graph) { _coarse_graphs.clear(); } -void SequentialGraphHierarchy::push(CSRGraph &&c_graph, ScalableVector &&c_mapping) { +void SequentialGraphHierarchy::push(CSRGraph &&c_graph, StaticArray &&c_mapping) { KASSERT(current().n() == c_mapping.size()); _coarse_mappings.push_back(std::move(c_mapping)); @@ -37,7 +37,7 @@ PartitionedCSRGraph SequentialGraphHierarchy::pop(PartitionedCSRGraph &&coarse_p KASSERT(&_coarse_graphs.back() == &coarse_p_graph.graph()); // Goal: project partition of p_graph == c_graph onto new_c_graph - ScalableVector c_mapping = std::move(_coarse_mappings.back()); + StaticArray c_mapping = std::move(_coarse_mappings.back()); _coarse_mappings.pop_back(); const CSRGraph &graph = get_second_coarsest_graph(); @@ -79,7 +79,7 @@ void SequentialGraphHierarchy::recover_partition_memory(StaticArray par _partition_memory_cache.push_back(std::move(partition)); } -void SequentialGraphHierarchy::recover_mapping_memory(ScalableVector mapping) { +void SequentialGraphHierarchy::recover_mapping_memory(StaticArray mapping) { _mapping_memory_cache.push_back(std::move(mapping)); } @@ -107,9 +107,9 @@ StaticArray SequentialGraphHierarchy::alloc_partition_memory() { return memory; } -ScalableVector SequentialGraphHierarchy::alloc_mapping_memory() { +StaticArray SequentialGraphHierarchy::alloc_mapping_memory() { if (_mapping_memory_cache.empty()) { - _mapping_memory_cache.emplace_back(); + _mapping_memory_cache.emplace_back(0, static_array::seq); } auto memory = std::move(_mapping_memory_cache.back()); @@ -120,10 +120,10 @@ ScalableVector SequentialGraphHierarchy::alloc_mapping_memory() { CSRGraphMemory SequentialGraphHierarchy::alloc_graph_memory() { if (_graph_memory_cache.empty()) { _graph_memory_cache.push_back(CSRGraphMemory{ - StaticArray{0, static_array::small, static_array::seq}, - StaticArray{0, static_array::small, static_array::seq}, - StaticArray{0, static_array::small, static_array::seq}, - StaticArray{0, static_array::small, static_array::seq}, + StaticArray{0, static_array::seq}, + StaticArray{0, static_array::seq}, + StaticArray{0, static_array::seq}, + StaticArray{0, static_array::seq}, }); } diff --git a/kaminpar-shm/initial_partitioning/sequential_graph_hierarchy.h b/kaminpar-shm/initial_partitioning/sequential_graph_hierarchy.h index fcf6c791..0645e02e 100644 --- a/kaminpar-shm/initial_partitioning/sequential_graph_hierarchy.h +++ b/kaminpar-shm/initial_partitioning/sequential_graph_hierarchy.h @@ -28,7 +28,7 @@ class SequentialGraphHierarchy { void init(const CSRGraph &graph); - void push(CSRGraph &&c_graph, ScalableVector &&c_mapping); + void push(CSRGraph &&c_graph, StaticArray &&c_mapping); [[nodiscard]] const CSRGraph ¤t() const; @@ -43,23 +43,23 @@ class SequentialGraphHierarchy { } StaticArray alloc_partition_memory(); - ScalableVector alloc_mapping_memory(); + StaticArray alloc_mapping_memory(); CSRGraphMemory alloc_graph_memory(); private: [[nodiscard]] const CSRGraph &get_second_coarsest_graph() const; void recover_partition_memory(StaticArray partition); - void recover_mapping_memory(ScalableVector mapping); + void recover_mapping_memory(StaticArray mapping); void recover_graph_memory(CSRGraph graph); const CSRGraph *_finest_graph; - ScalableVector> _coarse_mappings; + ScalableVector> _coarse_mappings; ScalableVector _coarse_graphs; ScalableVector _graph_memory_cache; - ScalableVector> _mapping_memory_cache; + ScalableVector> _mapping_memory_cache; ScalableVector> _partition_memory_cache; }; } // namespace kaminpar::shm diff --git a/kaminpar-shm/partitioning/helper.cc b/kaminpar-shm/partitioning/helper.cc index e5e84877..aa3a2f34 100644 --- a/kaminpar-shm/partitioning/helper.cc +++ b/kaminpar-shm/partitioning/helper.cc @@ -296,8 +296,7 @@ void extend_partition( return a += b; }); - constexpr bool kShowTimings = false; - if constexpr (kShowTimings) { + if (true) { LOG << "bipartitioner_init_ms: " << static_cast(timings.bipartitioner_init_ms / 1e6); LOG << "bipartitioner_ms: " << static_cast(timings.bipartitioner_ms / 1e6);