40#define SCOTCH_CALL(scotchFunc, args) \
42 ASSERTL0(scotchFunc args == 0, \
43 std::string("Error in Scotch calling function ") + \
44 std::string(#scotchFunc)); \
53 "Parallel partitioning using the PtScotch library.");
57 "use-ptscotch",
"",
"Use PtScotch for parallel mesh partitioning.");
80 std::dynamic_pointer_cast<LibUtilities::CommMpi>(
83 ASSERTL0(mpiComm,
"PtScotch not supported in serial execution.");
85 SCOTCH_Dgraph scGraph;
86 SCOTCH_CALL(SCOTCH_dgraphInit, (&scGraph, mpiComm->GetComm()));
88 (&scGraph, 0, nVerts, nVerts, &xadj[0], &xadj[1], &vertWgt[0],
89 nullptr, adjcy.size(), adjcy.size(), &adjcy[0],
nullptr,
96 (&strat, SCOTCH_STRATQUALITY, nparts, nparts, 0.05));
98 SCOTCH_CALL(SCOTCH_dgraphPart, (&scGraph, nparts, &strat, &part[0]));
#define ASSERTL0(condition, msg)
#define SCOTCH_CALL(scotchFunc, args)
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
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.
LibUtilities::CommSharedPtr m_comm
static std::string cmdSwitch
~MeshPartitionPtScotch() override
static MeshPartitionSharedPtr create(const LibUtilities::SessionReaderSharedPtr session, LibUtilities::CommSharedPtr comm, int meshDim, std::map< int, MeshEntity > element, CompositeDescriptor compMap)
Creates an instance of this class.
void v_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) final
static std::string className
Name of class.
MeshPartitionPtScotch(const LibUtilities::SessionReaderSharedPtr session, LibUtilities::CommSharedPtr comm, int meshDim, std::map< int, MeshEntity > element, CompositeDescriptor compMap)
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< CommMpi > CommMpiSharedPtr
Pointer to a Communicator object.
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
std::map< int, std::pair< LibUtilities::ShapeType, std::vector< int > > > CompositeDescriptor
MeshPartitionFactory & GetMeshPartitionFactory()