Skip to content

Commit

Permalink
[dKaMinPar:Coarsening] Fix crash when a PE does not get any vertices
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSeemaier committed Jan 9, 2024
1 parent b0cdb01 commit 0c7127a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion kaminpar-dist/coarsening/coarsener.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ const DistributedGraph *Coarsener::coarsen_once_global(const GlobalNodeWeight ma
_global_clusterer->initialize(*graph);
auto &clustering =
_global_clusterer->cluster(*graph, static_cast<NodeWeight>(max_cluster_weight));
if (clustering.empty()) { // Empty --> converged

bool empty = clustering.empty();
MPI_Allreduce(MPI_IN_PLACE, &empty, 1, MPI_CXX_BOOL, MPI_LAND, graph->communicator());
if (empty) { // Empty --> converged
DBG << "... converged with empty clustering";
return graph;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ ContractionResult contract_clustering(
auto nonlocal_nodes = find_nonlocal_nodes(graph, lnode_to_gcluster);

IF_STATS {
const GlobalNodeID total_num_nonlocal_nodes =
const auto total_num_nonlocal_nodes =
mpi::allreduce<GlobalNodeID>(nonlocal_nodes.size(), MPI_SUM, graph.communicator());
STATS << "Total number of nonlocal nodes: " << total_num_nonlocal_nodes;
}
Expand Down

0 comments on commit 0c7127a

Please sign in to comment.