Skip to content
Snippets Groups Projects
Commit d739477e authored by Martin Nolte's avatar Martin Nolte
Browse files

migrate mpi dependence to aluparmetis.hh

parent 41fc66cb
No related branches found
No related tags found
No related merge requests found
......@@ -32,37 +32,39 @@ inline void CALL_ParMETIS_V3_PartKway(
idxtype *vtxdist, idxtype *xadj, idxtype *adjncy, idxtype *vwgt,
idxtype *adjwgt, idxtype *wgtflag, idxtype *numflag, idxtype *ncon, idxtype *nparts,
realtype *tpwgts, realtype *ubvec, idxtype *options, idxtype *edgecut, idxtype *part,
MPI_Comm *comm)
MpAccessGlobal &mpa )
{
#if HAVE_PARMETIS
// get communincator (see mpAccess_MPI.cc)
MPI_Comm comm = getMPICommunicator( mpa.communicator() );
:: ParMETIS_V3_PartKway(vtxdist, xadj, adjncy, vwgt, adjwgt,
wgtflag, numflag, ncon, nparts, tpwgts,
ubvec, options, edgecut, part, comm ) ;
#else
ubvec, options, edgecut, part, &comm ) ;
#else // #if HAVE_PARMETIS
std::cerr << "**ERROR The use of ParMETIS is not supported, when the ParMETIS library is missing! in: " << __FILE__ << " line: " << __LINE__ << "\n";
std::cerr << parmetmess << std::endl ;
exit(1);
#endif
return ;
exit( 1 );
#endif // #else // #if HAVE_PARMETIS
}
inline void CALL_ParMETIS_V3_AdaptiveRepart(
idxtype *vtxdist, idxtype *xadj, idxtype *adjncy, idxtype *vwgt,
idxtype *vsize, idxtype *adjwgt, idxtype *wgtflag, idxtype *numflag, idxtype *ncon,
idxtype *nparts, realtype *tpwgts, realtype *ubvec, realtype *ipc2redist,
idxtype *options, idxtype *edgecut, idxtype *part, MPI_Comm *comm)
idxtype *options, idxtype *edgecut, idxtype *part,
MpAccessGlobal &mpa )
{
#if HAVE_PARMETIS
// get communincator (see mpAccess_MPI.cc)
MPI_Comm comm = getMPICommunicator( mpa.communicator() );
:: ParMETIS_V3_AdaptiveRepart(vtxdist, xadj, adjncy, vwgt, vsize, adjwgt,
wgtflag, numflag, ncon, nparts, tpwgts,
ubvec, ipc2redist, options, edgecut, part, comm ) ;
#else
ubvec, ipc2redist, options, edgecut, part, &comm ) ;
#else // #if HAVE_PARMETIS
std::cerr << "**ERROR The use of ParMETIS is not supported, when the ParMETIS library is missing! in: " << __FILE__ << " line: " << __LINE__ << "\n";
std::cerr << parmetmess << std::endl ;
exit(1);
#endif
return ;
exit( 1 );
#endif // #else // #if HAVE_PARMETIS
}
}
#endif
#endif // #ifndef PARMETIS_H_INCLUDED
......@@ -805,15 +805,12 @@ bool LoadBalancer :: DataBase :: repartition (MpAccessGlobal & mpa,
idx_t options[4] = {0, 1, 15, 1}; // these are the default values
idx_t nparts = np ;
// get communincator (see mpAccess_MPI.cc)
MPI_Comm comm = getMPICommunicator( mpa.communicator() );
// for starting partitions use PartKway
if( usePartKway )
{
ALUGridParMETIS :: CALL_ParMETIS_V3_PartKway(vtxdist, edge_p, edge, vertex_wInt, edge_w,
& wgtflag, & numflag, &ncon, & nparts, tpwgts,
ubvec, options, & edgecut, neu, & comm ) ;
ubvec, options, & edgecut, neu, mpa );
}
else // otherwise do an adaptive repartition
{
......@@ -832,7 +829,7 @@ bool LoadBalancer :: DataBase :: repartition (MpAccessGlobal & mpa,
//cout << "Call AdaptiveRepart \n";
ALUGridParMETIS :: CALL_ParMETIS_V3_AdaptiveRepart(vtxdist, edge_p, edge, vertex_wInt, vsize, edge_w,
& wgtflag, & numflag, &ncon, & nparts, tpwgts,
ubvec, &itr, options, & edgecut, neu, & comm ) ;
ubvec, &itr, options, & edgecut, neu, mpa );
}
// delete vtxdist and set zero (see below)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment