LifeV
GraphCutterZoltan< MeshType > Class Template Reference

Class that partitions the graph associated with a mesh. More...

#include <GraphCutterZoltan.hpp>

+ Inheritance diagram for GraphCutterZoltan< MeshType >:
+ Collaboration diagram for GraphCutterZoltan< MeshType >:

Private Member Functions

 GraphCutterZoltan (const GraphCutterZoltan &)
 
GraphCutterZoltanoperator= (const GraphCutterZoltan &)
 

Private Attributes

commPtr_Type M_comm
 
Int M_myPID
 
Int M_numProcessors
 
Int M_numParts
 
Int M_numPartsPerProcessor
 
Int M_myFirstPart
 
Int M_myLastPart
 
std::vector< IntM_indexBounds
 
pList_Type M_parameters
 
meshPtr_Type M_mesh
 
table_Type M_partitionTable
 
table_Type M_graph
 
std::vector< IntM_elementList
 
std::vector< IntM_elementParts
 
struct Zoltan_Struct * M_zoltanStruct
 

Public Types

typedef Teuchos::ParameterList pList_Type
 
typedef std::shared_ptr< Epetra_Comm > commPtr_Type
 
typedef MeshType mesh_Type
 
typedef std::shared_ptr< mesh_TypemeshPtr_Type
 
typedef std::map< Int, idListPtr_Typetable_Type
 

Constructor & Destructor

Constructor taking the original mesh, the MPI comm and parameters

 GraphCutterZoltan (meshPtr_Type &mesh, commPtr_Type &comm, pList_Type &parameters)
 
virtual ~GraphCutterZoltan ()
 Destructor. More...
 

Public methods

virtual Int run ()
 Performs the graph partitioning. More...
 

Get Methods

virtual const idListPtr_TypegetPart (const UInt i) const
 Get a pointer to one of the parts. More...
 
virtual idListPtr_TypegetPart (const UInt i)
 
virtual const idTablePtr_Type getGraph () const
 Get the entire partitioned graph, wrapped in a smart pointer. More...
 
virtual const UInt numParts () const
 Return the number of parts. More...
 
UInt numStoredElements () const
 Get number of stored graph elements. More...
 
Int firstIndex (const Int i) const
 First global index that is initially assigned to process i. More...
 
Int lastIndex (const Int i) const
 Last global index that is initially assigned to process i. More...
 
const table_Typegraph () const
 The internally stored dual graph of the mesh. More...
 
const std::vector< Int > & elementList () const
 The vector of stored element GIDs. More...
 
std::vector< Int > & elementList ()
 The vector of stored element GIDs (non-const) More...
 
const std::vector< Int > & elementParts () const
 The vector of stored element partitions. More...
 
std::vector< Int > & elementParts ()
 The vector of stored element partitions (non-const) More...
 
Int myPID () const
 The PID of the process. More...
 
Int numProcessors () const
 The number of processes in the comm. More...
 

Static methods

static int getNumElements (void *data, int *ierr)
 
static void getElementList (void *data, int sizeGID, int sizeLID, ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID, int wgt_dim, float *obj_wgts, int *ierr)
 
static void getNumNeighboursList (void *data, int sizeGID, int sizeLID, int num_obj, ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID, int *numEdges, int *ierr)
 
static void getNeighbourList (void *data, int sizeGID, int sizeLID, int num_obj, ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID, int *num_edges, ZOLTAN_ID_PTR nborGID, int *nborProc, int wgt_dim, float *ewgts, int *ierr)
 
static void getTransferObjectSizes (void *data, int num_gid_entries, int num_lid_entries, int num_ids, ZOLTAN_ID_PTR global_ids, ZOLTAN_ID_PTR local_ids, int *sizes, int *ierr)
 
static void packObjects (void *data, int num_gid_entries, int num_lid_entries, int num_ids, ZOLTAN_ID_PTR global_ids, ZOLTAN_ID_PTR local_ids, int *dest, int *sizes, int *idx, char *buf, int *ierr)
 
static void unpackObjects (void *data, int num_gid_entries, int num_ids, ZOLTAN_ID_PTR global_ids, int *sizes, int *idx, char *buf, int *ierr)
 

Private Methods

virtual void setParameters (pList_Type &parameters)
 Set values for all the parameters, with default values where needed. More...
 
void distributePartitions ()
 Distribute the partitions among available processors. More...
 
void buildGraph ()
 Build the dual graph of the unpartitioned mesh. More...
 
void localMigrate (int numExport, ZOLTAN_ID_PTR exportLocalGids, int *exportProcs, int *exportToPart)
 Migrate elements between locally stored partitions. More...
 
void buildPartitionTable ()
 Build the partition table that can be exported to the mesh builder. More...
 
void partitionGraph ()
 Partition the graph. More...
 

Additional Inherited Members

- Public Types inherited from GraphCutterBase< MeshType >
typedef Teuchos::ParameterList pList_Type
 
- Public Member Functions inherited from GraphCutterBase< MeshType >
 GraphCutterBase ()
 Default constructor. More...
 
virtual ~GraphCutterBase ()
 Destructor. More...
 

Detailed Description

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

Class that partitions the graph associated with a mesh.

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

This class uses the Zoltan package to partition the graph associated with a mesh. This class builds the dual graph of the mesh, partitions it according to a set of parameters and the stores the partitioning in a table (vector of vectors). At the end of the partition process, each vector will contain the GID of the elements in a part.

While this class can be used stand-alone, it is used automatically by the MeshPartitionTool class during the mesh partition process.

More on class functionality to follow. Stay tuned...

Definition at line 91 of file GraphCutterZoltan.hpp.

Member Typedef Documentation

◆ pList_Type

typedef Teuchos::ParameterList pList_Type

Definition at line 96 of file GraphCutterZoltan.hpp.

◆ commPtr_Type

typedef std::shared_ptr<Epetra_Comm> commPtr_Type

Definition at line 97 of file GraphCutterZoltan.hpp.

◆ mesh_Type

Definition at line 98 of file GraphCutterZoltan.hpp.

◆ meshPtr_Type

typedef std::shared_ptr<mesh_Type> meshPtr_Type

Definition at line 99 of file GraphCutterZoltan.hpp.

◆ table_Type

typedef std::map<Int, idListPtr_Type > table_Type

Definition at line 101 of file GraphCutterZoltan.hpp.

Constructor & Destructor Documentation

◆ GraphCutterZoltan() [1/2]

GraphCutterZoltan ( meshPtr_Type mesh,
commPtr_Type comm,
pList_Type parameters 
)

This constructor can be used to build the object and perform the graph partitioning in one shot.

Parameters
meshThe original mesh whose graph this object will partition
commThe Epetra MPI comm object which contains the processes which participate
parametersThe Teuchos parameter list which contains the partitioning parameters

Definition at line 313 of file GraphCutterZoltan.hpp.

+ Here is the caller graph for this function:

◆ ~GraphCutterZoltan()

virtual ~GraphCutterZoltan ( )
inlinevirtual

Destructor.

Definition at line 121 of file GraphCutterZoltan.hpp.

◆ GraphCutterZoltan() [2/2]

GraphCutterZoltan ( const GraphCutterZoltan< MeshType > &  )
private

Member Function Documentation

◆ run()

Int run ( )
virtual

Performs the graph partitioning.

Implements GraphCutterBase< MeshType >.

Definition at line 353 of file GraphCutterZoltan.hpp.

◆ getPart() [1/2]

virtual const idListPtr_Type& getPart ( const UInt  i) const
inlinevirtual

Get a pointer to one of the parts.

Implements GraphCutterBase< MeshType >.

Definition at line 133 of file GraphCutterZoltan.hpp.

◆ getPart() [2/2]

virtual idListPtr_Type& getPart ( const UInt  i)
inlinevirtual

Implements GraphCutterBase< MeshType >.

Definition at line 137 of file GraphCutterZoltan.hpp.

◆ getGraph()

virtual const idTablePtr_Type getGraph ( ) const
inlinevirtual

Get the entire partitioned graph, wrapped in a smart pointer.

Implements GraphCutterBase< MeshType >.

Definition at line 143 of file GraphCutterZoltan.hpp.

◆ numParts()

virtual const UInt numParts ( ) const
inlinevirtual

Return the number of parts.

Implements GraphCutterBase< MeshType >.

Definition at line 154 of file GraphCutterZoltan.hpp.

+ Here is the caller graph for this function:

◆ numStoredElements()

UInt numStoredElements ( ) const
inline

Get number of stored graph elements.

Definition at line 160 of file GraphCutterZoltan.hpp.

+ Here is the caller graph for this function:

◆ firstIndex()

Int firstIndex ( const Int  i) const
inline

First global index that is initially assigned to process i.

Definition at line 166 of file GraphCutterZoltan.hpp.

+ Here is the caller graph for this function:

◆ lastIndex()

Int lastIndex ( const Int  i) const
inline

Last global index that is initially assigned to process i.

Definition at line 172 of file GraphCutterZoltan.hpp.

◆ graph()

const table_Type& graph ( ) const
inline

The internally stored dual graph of the mesh.

Definition at line 178 of file GraphCutterZoltan.hpp.

◆ elementList() [1/2]

const std::vector<Int>& elementList ( ) const
inline

The vector of stored element GIDs.

Definition at line 184 of file GraphCutterZoltan.hpp.

◆ elementList() [2/2]

std::vector<Int>& elementList ( )
inline

The vector of stored element GIDs (non-const)

Definition at line 190 of file GraphCutterZoltan.hpp.

◆ elementParts() [1/2]

const std::vector<Int>& elementParts ( ) const
inline

The vector of stored element partitions.

Definition at line 196 of file GraphCutterZoltan.hpp.

◆ elementParts() [2/2]

std::vector<Int>& elementParts ( )
inline

The vector of stored element partitions (non-const)

Definition at line 202 of file GraphCutterZoltan.hpp.

◆ myPID()

Int myPID ( ) const
inline

The PID of the process.

Definition at line 208 of file GraphCutterZoltan.hpp.

◆ numProcessors()

Int numProcessors ( ) const
inline

The number of processes in the comm.

Definition at line 214 of file GraphCutterZoltan.hpp.

+ Here is the caller graph for this function:

◆ getNumElements()

int getNumElements ( void *  data,
int *  ierr 
)
static

Definition at line 367 of file GraphCutterZoltan.hpp.

+ Here is the caller graph for this function:

◆ getElementList()

void getElementList ( void *  data,
int  sizeGID,
int  sizeLID,
ZOLTAN_ID_PTR  globalID,
ZOLTAN_ID_PTR  localID,
int  wgt_dim,
float *  obj_wgts,
int *  ierr 
)
static

Definition at line 376 of file GraphCutterZoltan.hpp.

◆ getNumNeighboursList()

void getNumNeighboursList ( void *  data,
int  sizeGID,
int  sizeLID,
int  num_obj,
ZOLTAN_ID_PTR  globalID,
ZOLTAN_ID_PTR  localID,
int *  numEdges,
int *  ierr 
)
static

Definition at line 399 of file GraphCutterZoltan.hpp.

◆ getNeighbourList()

void getNeighbourList ( void *  data,
int  sizeGID,
int  sizeLID,
int  num_obj,
ZOLTAN_ID_PTR  globalID,
ZOLTAN_ID_PTR  localID,
int *  num_edges,
ZOLTAN_ID_PTR  nborGID,
int *  nborProc,
int  wgt_dim,
float *  ewgts,
int *  ierr 
)
static

Definition at line 420 of file GraphCutterZoltan.hpp.

◆ getTransferObjectSizes()

void getTransferObjectSizes ( void *  data,
int  num_gid_entries,
int  num_lid_entries,
int  num_ids,
ZOLTAN_ID_PTR  global_ids,
ZOLTAN_ID_PTR  local_ids,
int *  sizes,
int *  ierr 
)
static

Definition at line 465 of file GraphCutterZoltan.hpp.

◆ packObjects()

void packObjects ( void *  data,
int  num_gid_entries,
int  num_lid_entries,
int  num_ids,
ZOLTAN_ID_PTR  global_ids,
ZOLTAN_ID_PTR  local_ids,
int *  dest,
int *  sizes,
int *  idx,
char *  buf,
int *  ierr 
)
static

Definition at line 480 of file GraphCutterZoltan.hpp.

◆ unpackObjects()

void unpackObjects ( void *  data,
int  num_gid_entries,
int  num_ids,
ZOLTAN_ID_PTR  global_ids,
int *  sizes,
int *  idx,
char *  buf,
int *  ierr 
)
static

Definition at line 511 of file GraphCutterZoltan.hpp.

◆ setParameters()

void setParameters ( pList_Type parameters)
privatevirtual

Set values for all the parameters, with default values where needed.

Implements GraphCutterBase< MeshType >.

Definition at line 331 of file GraphCutterZoltan.hpp.

+ Here is the caller graph for this function:

◆ operator=()

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

◆ distributePartitions()

void distributePartitions ( )
private

Distribute the partitions among available processors.

Definition at line 538 of file GraphCutterZoltan.hpp.

+ Here is the caller graph for this function:

◆ buildGraph()

void buildGraph ( )
private

Build the dual graph of the unpartitioned mesh.

Definition at line 554 of file GraphCutterZoltan.hpp.

+ Here is the caller graph for this function:

◆ localMigrate()

void localMigrate ( int  numExport,
ZOLTAN_ID_PTR  exportLocalGids,
int *  exportProcs,
int *  exportToPart 
)
private

Migrate elements between locally stored partitions.

Definition at line 642 of file GraphCutterZoltan.hpp.

◆ buildPartitionTable()

void buildPartitionTable ( )
private

Build the partition table that can be exported to the mesh builder.

Definition at line 661 of file GraphCutterZoltan.hpp.

+ Here is the caller graph for this function:

◆ partitionGraph()

void partitionGraph ( )
private

Partition the graph.

Definition at line 706 of file GraphCutterZoltan.hpp.

+ Here is the caller graph for this function:

Field Documentation

◆ M_comm

commPtr_Type M_comm
private

Definition at line 282 of file GraphCutterZoltan.hpp.

◆ M_myPID

Int M_myPID
private

Definition at line 283 of file GraphCutterZoltan.hpp.

◆ M_numProcessors

Int M_numProcessors
private

Definition at line 284 of file GraphCutterZoltan.hpp.

◆ M_numParts

Int M_numParts
private

Definition at line 285 of file GraphCutterZoltan.hpp.

◆ M_numPartsPerProcessor

Int M_numPartsPerProcessor
private

Definition at line 286 of file GraphCutterZoltan.hpp.

◆ M_myFirstPart

Int M_myFirstPart
private

Definition at line 287 of file GraphCutterZoltan.hpp.

◆ M_myLastPart

Int M_myLastPart
private

Definition at line 288 of file GraphCutterZoltan.hpp.

◆ M_indexBounds

std::vector<Int> M_indexBounds
private

Definition at line 289 of file GraphCutterZoltan.hpp.

◆ M_parameters

pList_Type M_parameters
private

Definition at line 290 of file GraphCutterZoltan.hpp.

◆ M_mesh

meshPtr_Type M_mesh
private

Definition at line 291 of file GraphCutterZoltan.hpp.

◆ M_partitionTable

table_Type M_partitionTable
private

Definition at line 292 of file GraphCutterZoltan.hpp.

◆ M_graph

table_Type M_graph
private

Definition at line 293 of file GraphCutterZoltan.hpp.

◆ M_elementList

std::vector<Int> M_elementList
private

Definition at line 298 of file GraphCutterZoltan.hpp.

◆ M_elementParts

std::vector<Int> M_elementParts
private

Definition at line 299 of file GraphCutterZoltan.hpp.

◆ M_zoltanStruct

struct Zoltan_Struct* M_zoltanStruct
private

Definition at line 301 of file GraphCutterZoltan.hpp.


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