LifeV
MeshPartitionTool< MeshType > Class Template Reference

Class that does flexible mesh partitioning. More...

#include <MeshPartitionTool.hpp>

+ Collaboration diagram for MeshPartitionTool< MeshType >:

Private Member Functions

 MeshPartitionTool (const MeshPartitionTool &)
 
MeshPartitionTooloperator= (const MeshPartitionTool &)
 

Public Types

typedef MeshType mesh_Type
 
typedef GraphCutterBase< mesh_TypegraphCutter_Type
 
typedef MeshPartBuilder< mesh_TypemeshPartBuilder_Type
 
typedef std::shared_ptr< mesh_TypemeshPtr_Type
 
typedef std::vector< meshPtr_TypepartMesh_Type
 
typedef std::shared_ptr< partMesh_TypepartMeshPtr_Type
 
typedef std::vector< idTablePtr_TypevertexPartitionTable_Type
 
typedef std::shared_ptr< vertexPartitionTable_TypevertexPartitionTablePtr_Type
 

Constructors & Destructors

 MeshPartitionTool (const meshPtr_Type &mesh, const std::shared_ptr< Epetra_Comm > &comm, const Teuchos::ParameterList parameters=Teuchos::ParameterList())
 Constructor. More...
 
 ~MeshPartitionTool ()
 Empty destructor. More...
 

Public Methods

Prints information about the state (data) of the object

void showMe (std::ostream &output=std::cout) const
 

Get Methods

bool success () const
 Return the succeess state of the partitioning (true || false) More...
 
const meshPtr_TypemeshPart () const
 Return a shared pointer to the mesh part (online mode, const ver.) More...
 
const partMeshPtr_TypeallMeshParts () const
 Return a shared pointer to the mesh parts. More...
 
const vertexPartitionTablePtr_TypesecondStageParts () const
 Return a shared pointer to the second stage graph parts (for ShyLU-MT) More...
 
const idTablePtr_TypemySecondStageParts () const
 Return a shared pointer to the second stage graph parts (for ShyLU-MT) More...
 

Private methods

void run ()
 This method performs all the steps for the mesh and graph partitioning. More...
 
void fillEntityPID (idTablePtr_Type graph)
 Initialize M_entityPID. More...
 
void globalToLocal (const Int curPart)
 Global to local element ID conversion for second stage. More...
 
std::shared_ptr< Epetra_Comm > M_comm
 Private Data Members. More...
 
Int M_myPID
 
Teuchos::ParameterList M_parameters
 
meshPtr_Type M_originalMesh
 
meshPtr_Type M_meshPart
 
partMeshPtr_Type M_allMeshParts
 
std::string M_graphLib
 
std::shared_ptr< graphCutter_TypeM_graphCutter
 
std::shared_ptr< meshPartBuilder_TypeM_meshPartBuilder
 
bool M_success
 
bool M_secondStage
 
Int M_secondStageNumParts
 
vertexPartitionTablePtr_Type M_secondStageParts
 
meshPartBuilder_Type::entityPID_Type M_entityPID
 Store ownership for each entity, subdivided by entity type. More...
 

Detailed Description

template<typename MeshType>
class LifeV::MeshPartitionTool< MeshType >

Class that does flexible mesh partitioning.

Author
Radu Popescu radu..nosp@m.pope.nosp@m.scu@e.nosp@m.pfl..nosp@m.ch

This class implements the partitioning of a global mesh and allows choosing the graph partitioning tool and the method to build the mesh parts.

The class is configured through the Teuchos::Parameter list passed to the constructor. The following parameters are used:

graph-lib - std::string - "parmetis" or "zoltan" selects the graph partition library to be used (default "parmetis") overlap - UInt - level of overlap for the mesh partition process (default 0) offline-mode - bool - mode of operation; offline mode can only be used in serial (default false == online) num-parts - Int - (for offline-mode only) sets the number of parts for the mesh partition process (no default value) hierarchical - bool - enable hierarchical partitioning mode (default false) topology - std::string - value which represents the number of mesh parts per compute node (N == num-parts; topology="m"; N % m == 0) (default "1")

Notes:

The value of the "topology" parameter is given as a string due to a requirement of the Zoltan interface When using Zoltan as a graph partition library, additional advanced parameters are available. See GraphCutterZoltan.hpp for more information. Hierarchical partitioning is available in online mode ONLY when using Zoltan and in offline mode ONLY when using ParMETIS.

Definition at line 99 of file MeshPartitionTool.hpp.

Member Typedef Documentation

◆ mesh_Type

Definition at line 104 of file MeshPartitionTool.hpp.

◆ graphCutter_Type

Definition at line 105 of file MeshPartitionTool.hpp.

◆ meshPartBuilder_Type

◆ meshPtr_Type

typedef std::shared_ptr<mesh_Type> meshPtr_Type

Definition at line 107 of file MeshPartitionTool.hpp.

◆ partMesh_Type

typedef std::vector<meshPtr_Type> partMesh_Type

Definition at line 108 of file MeshPartitionTool.hpp.

◆ partMeshPtr_Type

typedef std::shared_ptr<partMesh_Type> partMeshPtr_Type

Definition at line 109 of file MeshPartitionTool.hpp.

◆ vertexPartitionTable_Type

Definition at line 110 of file MeshPartitionTool.hpp.

◆ vertexPartitionTablePtr_Type

Definition at line 112 of file MeshPartitionTool.hpp.

Constructor & Destructor Documentation

◆ MeshPartitionTool() [1/2]

MeshPartitionTool ( const meshPtr_Type mesh,
const std::shared_ptr< Epetra_Comm > &  comm,
const Teuchos::ParameterList  parameters = Teuchos::ParameterList() 
)

Constructor.

The constructor takes as parameters the global uncut mesh, the Epetra comm of the group or processes involved in the mesh partition process and a Teuchos parameter list.

After initializing the object, the constructor will call the private run() method and perform the mesh partition

Parameters
mesh- shared pointer to the global uncut mesh
comm- shared pointer to the Epetra comm object containing the processes involved in the mesh partition process
parameters- Teuchos parameter list

Definition at line 235 of file MeshPartitionTool.hpp.

+ Here is the caller graph for this function:

◆ ~MeshPartitionTool()

~MeshPartitionTool ( )
inline

Empty destructor.

Definition at line 137 of file MeshPartitionTool.hpp.

◆ MeshPartitionTool() [2/2]

MeshPartitionTool ( const MeshPartitionTool< MeshType > &  )
private

Member Function Documentation

◆ showMe()

void showMe ( std::ostream &  output = std::cout) const

Definition at line 505 of file MeshPartitionTool.hpp.

◆ success()

bool success ( ) const
inline

Return the succeess state of the partitioning (true || false)

Definition at line 148 of file MeshPartitionTool.hpp.

◆ meshPart()

const meshPtr_Type& meshPart ( ) const
inline

Return a shared pointer to the mesh part (online mode, const ver.)

Definition at line 153 of file MeshPartitionTool.hpp.

◆ allMeshParts()

const partMeshPtr_Type& allMeshParts ( ) const
inline

Return a shared pointer to the mesh parts.

Return a shared pointer to the mesh parts on offline partition (const)

Definition at line 161 of file MeshPartitionTool.hpp.

◆ secondStageParts()

const vertexPartitionTablePtr_Type& secondStageParts ( ) const
inline

Return a shared pointer to the second stage graph parts (for ShyLU-MT)

Return a shared pointer to the second stage graph parts (for ShyLU-MT) Offline mode

Definition at line 171 of file MeshPartitionTool.hpp.

◆ mySecondStageParts()

const idTablePtr_Type& mySecondStageParts ( ) const
inline

Return a shared pointer to the second stage graph parts (for ShyLU-MT)

Return a shared pointer to the second stage graph parts (for ShyLU-MT) Online mode

Definition at line 181 of file MeshPartitionTool.hpp.

◆ run()

void run ( )
private

This method performs all the steps for the mesh and graph partitioning.

Definition at line 274 of file MeshPartitionTool.hpp.

+ Here is the caller graph for this function:

◆ fillEntityPID()

void fillEntityPID ( idTablePtr_Type  graph)
private

Initialize M_entityPID.

Definition at line 436 of file MeshPartitionTool.hpp.

◆ globalToLocal()

void globalToLocal ( const Int  curPart)
private

Global to local element ID conversion for second stage.

Definition at line 486 of file MeshPartitionTool.hpp.

+ Here is the caller graph for this function:

◆ operator=()

MeshPartitionTool& operator= ( const MeshPartitionTool< MeshType > &  )
private

Field Documentation

◆ M_comm

std::shared_ptr<Epetra_Comm> M_comm
private

Private Data Members.

Definition at line 206 of file MeshPartitionTool.hpp.

◆ M_myPID

Int M_myPID
private

Definition at line 207 of file MeshPartitionTool.hpp.

◆ M_parameters

Teuchos::ParameterList M_parameters
private

Definition at line 208 of file MeshPartitionTool.hpp.

◆ M_originalMesh

meshPtr_Type M_originalMesh
private

Definition at line 209 of file MeshPartitionTool.hpp.

◆ M_meshPart

meshPtr_Type M_meshPart
private

Definition at line 210 of file MeshPartitionTool.hpp.

◆ M_allMeshParts

partMeshPtr_Type M_allMeshParts
private

Definition at line 211 of file MeshPartitionTool.hpp.

◆ M_graphLib

std::string M_graphLib
private

Definition at line 212 of file MeshPartitionTool.hpp.

◆ M_graphCutter

std::shared_ptr<graphCutter_Type> M_graphCutter
private

Definition at line 213 of file MeshPartitionTool.hpp.

◆ M_meshPartBuilder

std::shared_ptr<meshPartBuilder_Type> M_meshPartBuilder
private

Definition at line 214 of file MeshPartitionTool.hpp.

◆ M_success

bool M_success
private

Definition at line 215 of file MeshPartitionTool.hpp.

◆ M_secondStage

bool M_secondStage
private

Definition at line 216 of file MeshPartitionTool.hpp.

◆ M_secondStageNumParts

Int M_secondStageNumParts
private

Definition at line 217 of file MeshPartitionTool.hpp.

◆ M_secondStageParts

vertexPartitionTablePtr_Type M_secondStageParts
private

Definition at line 218 of file MeshPartitionTool.hpp.

◆ M_entityPID

Store ownership for each entity, subdivided by entity type.

Definition at line 221 of file MeshPartitionTool.hpp.


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