Skip to content
Snippets Groups Projects
Commit 3b98e735 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add missing MPI_Comm_free

parent ba6c638c
No related branches found
No related tags found
1 merge request!202Prepare PTScotch integration
......@@ -27,10 +27,8 @@ ParMETISPartitioner::partition(const CRSGraph& graph)
std::vector<float> ubvec{1.05};
std::vector<int> options{1, 0, 0};
int edgecut = 0;
Array<int> part(0);
MPI_Group world_group;
MPI_Comm_group(parallel::Messenger::getInstance().comm(), &world_group);
MPI_Group mesh_group;
......@@ -53,8 +51,9 @@ ParMETISPartitioner::partition(const CRSGraph& graph)
int local_number_of_nodes = graph.numberOfNodes();
Array<int> partition;
if (graph.numberOfNodes() > 0) {
part = Array<int>(local_number_of_nodes);
partition = Array<int>(local_number_of_nodes);
std::vector<int> vtxdist{0, local_number_of_nodes};
const Array<const int>& entries = graph.entries();
......@@ -65,7 +64,7 @@ ParMETISPartitioner::partition(const CRSGraph& graph)
int result =
ParMETIS_V3_PartKway(&(vtxdist[0]), entries_ptr, neighbors_ptr, NULL, NULL, &wgtflag, &numflag, &ncon, &npart,
&(tpwgts[0]), &(ubvec[0]), &(options[0]), &edgecut, &(part[0]), &parmetis_comm);
&(tpwgts[0]), &(ubvec[0]), &(options[0]), &edgecut, &(partition[0]), &parmetis_comm);
// LCOV_EXCL_START
if (result == METIS_ERROR) {
throw UnexpectedError("Metis Error");
......@@ -76,8 +75,9 @@ ParMETISPartitioner::partition(const CRSGraph& graph)
}
MPI_Group_free(&mesh_group);
MPI_Group_free(&world_group);
return part;
return partition;
}
#else // PUGS_HAS_PARMETIS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment