Skip to content
Snippets Groups Projects

Feature/utils coverage

3 files
+ 99
3
Compare changes
  • Side-by-side
  • Inline

Files

+ 7
3
@@ -26,7 +26,7 @@ Partitioner::partition(const CRSGraph& graph)
std::vector<float> tpwgts(npart, 1. / npart);
std::vector<float> ubvec{1.05};
std::vector<int> options{1, 1, 0};
std::vector<int> options{1, 0, 0};
int edgecut = 0;
Array<int> part(0);
@@ -66,9 +66,11 @@ Partitioner::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);
// LCOV_EXCL_START
if (result == METIS_ERROR) {
throw UnexpectedError("Metis Error");
}
// LCOV_EXCL_STOP
MPI_Comm_free(&parmetis_comm);
}
@@ -81,9 +83,11 @@ Partitioner::partition(const CRSGraph& graph)
#else // PUGS_HAS_MPI
Array<int>
Partitioner::partition(const CRSGraph&)
Partitioner::partition(const CRSGraph& graph)
{
return Array<int>(0);
Array<int> partition{graph.entries().size() - 1};
partition.fill(0);
return partition;
}
#endif // PUGS_HAS_MPI
Loading