CEPS  24.01
Cardiac ElectroPhysiology Simulator
PtscotchPartitioner Class Reference

Detailed Description

Geometry partitioning with PtScotch.

Namespace that regroups the necessary methods to compute a geometry (collection of meshes) partitioning using the PTscotch library. The inputs and outputs for these methods are explained in more detail in the PTScotch documentation.

Definition at line 46 of file PtscotchPartitioner.hpp.

#include <PtscotchPartitioner.hpp>

Inheritance diagram for PtscotchPartitioner:
[legend]

Public Member Functions

 PtscotchPartitioner ()=delete
 no default constructor More...
 
 PtscotchPartitioner (Geometry *geom)
 Constructor with geometry, simply calls base class constructor. More...
 
 ~PtscotchPartitioner () override=default
 Destructor. More...
 
CepsUInt computePartition () override
 Calls the partitioning method specified in the Geometry. More...
 
- Public Member Functions inherited from GeometryPartitioner
 GeometryPartitioner ()=delete
 Deleted constructor. More...
 
 GeometryPartitioner (Geometry *geometry)
 Constructor based on Geometry instance. More...
 
 ~GeometryPartitioner () override
 Destructor. More...
 
- Public Member Functions inherited from CepsObject
 CepsObject ()=default
 default constructor More...
 
 CepsObject (const CepsObject &)=default
 Copy constructor. More...
 
virtual ~CepsObject ()=default
 Destructor. More...
 
CepsObjectoperator= (const CepsObject &)=default
 Assignment operator. More...
 
CepsObjecttoBaseObject ()
 Returns a pointer to CepsObject class. More...
 
const CepsObjecttoBaseObject () const
 Returns a pointer to CepsObject class, const version. More...
 
ProfilergetProfiler () const
 Access to profiler. More...
 

Private Member Functions

CepsVector< CepsIntnodePartitioning ()
 Compute a Partitioning using Scotch on the primal graph GeomNode,. More...
 
void buildDualGraph (CepsVector< CepsInt > &verttab, CepsVector< CepsInt > &edgetab)
 Convert a graph from elements (nodeIndicesOffset,nodeIndices) to a GeomNode graph in Scotch format. More...
 
void removeFalseDuplicates (CepsVector< CepsInt > &nodeOwnership)
 Internal routine that removes the nodes prev. added for multiple unknowns per node. More...
 
void buildCellPartitionMap (CepsVector< CepsInt > &nodeOwnership)
 Gives new labels to cell such that they are grouped on each cpu. More...
 
void restrictCoupledNodesToLocal ()
 Keep only coupled nodes local to the cpu. More...
 

Additional Inherited Members

- Protected Member Functions inherited from GeometryPartitioner
void readMeshOnMaster ()
 Read the Mesh on master process before distribution. More...
 
void broadcastMeshData ()
 Copies geometrical information from master on all other processes. More...
 
void setUpHalo (const CepsVector< CepsInt > &nodeOwnership, const CepsVector< CepsInt > *cellOwnership=nullptr)
 Register nodes in halo regions, and set up communication matrices of data in halos. More...
 
void buildNodeAdjacency ()
 For each node, stores its adjacent nodes and cells. (indices before partitioning) More...
 
void buildCellAdjacency ()
 For each cell, stores its adjacent cells. (indices before partitioning) More...
 
void nodeAttribution (const CepsVector< CepsInt > &nodeOwnership)
 Creates the lists of nodes in linked geometry according to partition. More...
 
void cellAttribution ()
 Creates the lists of cells and bdry cells in geometry according to partition. More...
 
template<CepsUInt _Dim>
void addCellToMesh (CepsUInt index, CepsBool isOnBoundary, Mesh *mesh)
 Create local simplex structures from geometrical data to fill meshes with. More...
 
CepsUInt getDimensionByNodeId (CepsUInt i) const
 Get the correct dimension, deduced by node id. More...
 
CepsUInt getDimensionByCellId (CepsUInt i) const
 Get the correct dimension, deduced by cell id. More...
 
- Protected Attributes inherited from GeometryPartitioner
Geometrym_geom
 Linked geometry to partition. More...
 
CepsSet< CepsCellGlobalIndexm_ownedCells
 Indices of local cells and boundary cells. More...
 
CepsSet< CepsNodeGlobalIndexm_ownedNodes
 Indices of local nodes. More...
 
CepsSet< CepsNodeGlobalIndexm_haloNodes
 Indices of local halo nodes. More...
 
CepsArray4< CepsUIntm_nodeOffset
 GeomNode offset. More...
 
CepsArray4< CepsUIntm_cellOffset
 Cell offset. More...
 
CepsUInt m_nbNodes
 Number of nodes in all combined meshes. More...
 
CepsVector< CepsRealm_coords
 GeomNode positions. More...
 
CepsVector< CepsAttributem_nodeAttr
 Attributes for each node. More...
 
CepsVector< CepsUIntm_nodeAttrOffset
 Offset in m_nodeAttr array for each node. More...
 
CepsUInt m_nodeAttrSize
 Size of combined lists of attributes per node. More...
 
CepsMap< CepsNodeGlobalIndex, CepsSet< CepsNodeGlobalIndex > > m_nodeNodeAdj
 lists of adjacent nodes More...
 
CepsMap< CepsNodeGlobalIndex, CepsSet< CepsCellGlobalIndex > > m_nodeCellAdj
 lists of adjacent cells More...
 
CepsMap< CepsCellGlobalIndex, CepsSet< CepsCellGlobalIndex > > m_cellCellAdj
 lists of adjacent cells More...
 
CepsSet< CepsCellGlobalIndexm_markedCells
 algorithmic flags More...
 
CepsMap< CepsCellGlobalIndex, CepsMathVertexm_cellBarycenters
 For cells with 1 node on bdry. More...
 
CepsMultiMap< CepsNodeGlobalIndex, CepsNodeGlobalIndexm_coupledNodes
 Links between meshes expressed with coupled nodes. More...
 
CepsUInt m_nbCells
 Number of cells and boundary cells in all combined meshes. More...
 
CepsVector< CepsIntm_nodeIndices
 Node indices for each cell (signed ints for lib compatibility) More...
 
CepsVector< CepsUIntm_nodeIndicesOffset
 Offset in m_nodeIndices array for each cell. More...
 
CepsUInt m_nodeIndicesSize
 Size of combined lists of nodes per cell. More...
 
CepsVector< CepsAttributem_cellAttr
 Cells attributes for each cell. More...
 
CepsVector< CepsUIntm_cellAttrOffset
 Offset in m_cellAttr array for each cell. More...
 
CepsUInt m_cellAttrSize
 Size of combined lists of attributes per cell. More...
 
CepsVector< CepsCharm_isBoundary
 Indicates which cell is on the boundary. More...
 
- Static Protected Attributes inherited from CepsObject
static Profiler m_profiler
 The same profiler for each big object. More...
 

Constructor & Destructor Documentation

◆ PtscotchPartitioner() [1/2]

PtscotchPartitioner::PtscotchPartitioner ( )
delete

no default constructor

◆ PtscotchPartitioner() [2/2]

PtscotchPartitioner::PtscotchPartitioner ( Geometry geom)
explicit

Constructor with geometry, simply calls base class constructor.

Definition at line 37 of file PtscotchPartitioner.cpp.

◆ ~PtscotchPartitioner()

PtscotchPartitioner::~PtscotchPartitioner ( )
overridedefault

Destructor.

Member Function Documentation

◆ buildCellPartitionMap()

void PtscotchPartitioner::buildCellPartitionMap ( CepsVector< CepsInt > &  nodeOwnership)
private

Gives new labels to cell such that they are grouped on each cpu.

Definition at line 281 of file PtscotchPartitioner.cpp.

◆ buildDualGraph()

void PtscotchPartitioner::buildDualGraph ( CepsVector< CepsInt > &  verttab,
CepsVector< CepsInt > &  edgetab 
)
private

Convert a graph from elements (nodeIndicesOffset,nodeIndices) to a GeomNode graph in Scotch format.

Parameters
verttabadjacency list
edgetaboffsets in verttab for each node

For example : consider the following graph

           0---3
           |\  |\
           | \ | 4
           |  \|/
           1---2

 eptr = [0, 3, 6, 9]
         |  |  |
         |  |  -------------
         |  -------        |
         |        |        |
         |        |        |
 eind = [0, 1, 2, 0, 2, 3, 3, 2, 4]

Element 0 has nodes 0,1,2, element 1 has nodes 0,2,3, element 2 has nodes 3,2,4.

convertGraphElemToNode will build the following two vectors

 edgetab = [0, 3, 5, 9, 12, 14]
            |  |  |  |   |
            |  |  |  |   |
            |  |  |  |   ------------------------
            |  |  |  -------------------        |
            |  |  ----------           |        |
            |  -------     |           |        |
            |        |     |           |        |
 verttab = [1, 2, 3, 0, 2, 0, 1, 3, 4, 0, 2, 4, 2, 3]

GeomNode 0 is connected to 1,2,3, node 1 is connected to 0,2, etc.

Definition at line 193 of file PtscotchPartitioner.cpp.

◆ computePartition()

CepsUInt PtscotchPartitioner::computePartition ( )
overridevirtual

Calls the partitioning method specified in the Geometry.

The different partitioning methods are defined in the enum type PartitioningMethod::method. The partitioning method is set via the method Geometry::setPartitioningMethod

Returns
non zero value on failure

Implements GeometryPartitioner.

Definition at line 42 of file PtscotchPartitioner.cpp.

◆ nodePartitioning()

CepsVector< CepsInt > PtscotchPartitioner::nodePartitioning ( )
private

Compute a Partitioning using Scotch on the primal graph GeomNode,.

Returns
node ownership, indexed by node label before partitioning

Definition at line 94 of file PtscotchPartitioner.cpp.

◆ removeFalseDuplicates()

void PtscotchPartitioner::removeFalseDuplicates ( CepsVector< CepsInt > &  nodeOwnership)
private

Internal routine that removes the nodes prev. added for multiple unknowns per node.

Definition at line 251 of file PtscotchPartitioner.cpp.

◆ restrictCoupledNodesToLocal()

void PtscotchPartitioner::restrictCoupledNodesToLocal ( )
private

Keep only coupled nodes local to the cpu.

Definition at line 393 of file PtscotchPartitioner.cpp.


The documentation for this class was generated from the following files: