Skip to content

Commit

Permalink
fix(common): is_span() return'd wrong value when using the overcommit…
Browse files Browse the repository at this point in the history
… tag
  • Loading branch information
DanielSeemaier committed Sep 25, 2024
1 parent 3777844 commit fedefa2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kaminpar-common/datastructures/static_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ template <typename T> class StaticArray {
}

[[nodiscard]] bool is_span() const {
return _owned_data.get() == nullptr;
return _owned_data.get() == nullptr && _overcommited_data.get() == nullptr;
}

//
Expand Down
2 changes: 1 addition & 1 deletion kaminpar-shm/initial_partitioning/initial_coarsener.cc
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ InitialCoarsener::ContractionResult InitialCoarsener::contract_current_clusterin

std::fill(_cluster_sizes.begin(), _cluster_sizes.begin() + n, 0);
std::fill(_leader_node_mapping.begin(), _leader_node_mapping.begin() + n, 0);
// Note:_clustering does not need to be cleared
// Note: _clustering does not need to be cleared

_timings.contract_ms += timer.elapsed();

Expand Down
17 changes: 17 additions & 0 deletions kaminpar-shm/initial_partitioning/sequential_graph_hierarchy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@ void SequentialGraphHierarchy::init(const CSRGraph &graph) {
void SequentialGraphHierarchy::push(CSRGraph &&c_graph, StaticArray<NodeID> &&c_mapping) {
KASSERT(current().n() == c_mapping.size());

KASSERT(
!c_graph.raw_nodes().is_span(),
"span-based coarse graph should not be used with the sequential graph hierarchy"
);
KASSERT(
!c_graph.raw_edges().is_span(),
"span-based coarse graph should not be used with the sequential graph hierarchy"
);
KASSERT(
!c_graph.raw_node_weights().is_span(),
"span-based coarse graph should not be used with the sequential graph hierarchy"
);
KASSERT(
!c_graph.raw_edge_weights().is_span(),
"span-based coarse graph should not be used with the sequential graph hierarchy"
);

_coarse_mappings.push_back(std::move(c_mapping));
_coarse_graphs.push_back(std::move(c_graph));
}
Expand Down

0 comments on commit fedefa2

Please sign in to comment.