35 #include <boost/core/ignore_unused.hpp> 42 #define SCOTCH_CALL(scotchFunc, args) \ 44 ASSERTL0(scotchFunc args == 0, \ 45 std::string("Error in Scotch calling function ") \ 46 + std::string(#scotchFunc)); \ 51 namespace SpatialDomains
57 "Parallel partitioning using the PtScotch library.");
61 "use-ptscotch",
"",
"Use PtScotch for parallel mesh partitioning.");
66 std::map<int, MeshEntity> element,
85 boost::ignore_unused(nVertConds, vertSize, edgeWgt, volume);
90 ASSERTL0(mpiComm,
"PtScotch not supported in serial execution.");
92 SCOTCH_Dgraph scGraph;
93 SCOTCH_CALL(SCOTCH_dgraphInit, (&scGraph, mpiComm->GetComm()));
95 (&scGraph, 0, nVerts, nVerts, &xadj[0], &xadj[1], &vertWgt[0],
96 NULL, adjcy.num_elements(), adjcy.num_elements(),
97 &adjcy[0], NULL, NULL));
103 SCOTCH_CALL(SCOTCH_dgraphPart, (&scGraph, nparts, &strat, &part[0]));
static std::string RegisterCmdLineFlag(const std::string &pName, const std::string &pShortName, const std::string &pDescription)
Registers a command-line flag with the session reader.
#define ASSERTL0(condition, msg)
LibUtilities::CommSharedPtr m_comm
#define SCOTCH_CALL(scotchFunc, args)
virtual ~MeshPartitionPtScotch()
MeshPartitionPtScotch(const LibUtilities::SessionReaderSharedPtr session, int meshDim, std::map< int, MeshEntity > element, CompositeDescriptor compMap)
virtual void PartitionGraphImpl(int &nVerts, int &nVertConds, Nektar::Array< Nektar::OneD, int > &xadj, Nektar::Array< Nektar::OneD, int > &adjcy, Nektar::Array< Nektar::OneD, int > &vertWgt, Nektar::Array< Nektar::OneD, int > &vertSize, Nektar::Array< Nektar::OneD, int > &edgeWgt, int &nparts, int &volume, Nektar::Array< Nektar::OneD, int > &part)
std::map< int, std::pair< LibUtilities::ShapeType, std::vector< int > > > CompositeDescriptor
static MeshPartitionSharedPtr create(const LibUtilities::SessionReaderSharedPtr session, int meshDim, std::map< int, MeshEntity > element, CompositeDescriptor compMap)
Creates an instance of this class.
static std::string cmdSwitch
std::shared_ptr< CommMpi > CommMpiSharedPtr
Pointer to a Communicator object.
static std::string className
Name of class.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
MeshPartitionFactory & GetMeshPartitionFactory()
std::shared_ptr< SessionReader > SessionReaderSharedPtr