Flow123d  master-f44eb46
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Partitioning Class Reference

Class for the mesh partitioning. This should provide: More...

#include <partitioning.hh>

Collaboration diagram for Partitioning:
Collaboration graph
[legend]

Public Member Functions

 TYPEDEF_ERR_INFO (EI_MeshFile, std::string)
 
 TYPEDEF_ERR_INFO (EI_NElems, unsigned int)
 
 TYPEDEF_ERR_INFO (EI_NProcs, unsigned int)
 
 DECLARE_INPUT_EXCEPTION (ExcDecomposeMesh,<< "Number of processors "<< EI_NProcs::val<< " greater then number of elements "<< EI_NElems::val<< ". Can not make partitioning of the mesh "<< EI_MeshFile::qval<< ".\n")
 
 Partitioning (Mesh *mesh, Input::Record in)
 
const Distributionget_init_distr () const
 
const LongIdxget_loc_part () const
 
shared_ptr< vector< int > > subdomain_id_field_data ()
 
void id_maps (int n_ids, LongIdx *id_4_old, Distribution *&new_ds, LongIdx *&id_4_loc, LongIdx *&new_4_id)
 
 ~Partitioning ()
 Destructor. More...
 

Static Public Member Functions

static const Input::Type::Selectionget_graph_type_sel ()
 Input specification objects. More...
 
static const Input::Type::Selectionget_tool_sel ()
 
static const Input::Type::Recordget_input_type ()
 
static void id_maps (int n_ids, LongIdx *id_4_old, const Distribution &old_ds, LongIdx *loc_part, Distribution *&new_ds, LongIdx *&id_4_loc, LongIdx *&new_4_id)
 

Private Types

enum  PartitionTool { PETSc , METIS }
 
enum  PartitionGraphType { any_neighboring , any_weight_lower_dim_cuts , same_dimension_neighboring }
 

Private Member Functions

void make_element_connection_graph ()
 
void make_partition ()
 

Private Attributes

Meshmesh_
 The input mesh. More...
 
Input::Record in_
 Input Record accessor. More...
 
SparseGraphgraph_
 Graph used to partitioning the mesh. More...
 
LongIdxloc_part_
 Partition numbers for local elements in original distribution of elements given be init_el_ds_. More...
 
Distributioninit_el_ds_
 Original distribution of elements. Depends on type of partitioner. More...
 
shared_ptr< vector< int > > seq_part_
 Sequential partitioning for output. More...
 

Detailed Description

Class for the mesh partitioning. This should provide:

Definition at line 52 of file partitioning.hh.

Member Enumeration Documentation

◆ PartitionGraphType

Types of weights used for element partitioning.

Enumerator
any_neighboring 

Add edge for any pair of neighboring elements.

any_weight_lower_dim_cuts 

Same as before and assign higher weight to cuts of lower dimension in order to make them stick to one face.

same_dimension_neighboring 

Add edge for any pair of neighboring elements of same dimension (bad for matrix multiply)

Definition at line 112 of file partitioning.hh.

◆ PartitionTool

Types of partitioning algorithms.

Enumerator
PETSc 

Use PETSc interface to various partitioing tools.

METIS 

Use direct interface to Metis.

Definition at line 104 of file partitioning.hh.

Constructor & Destructor Documentation

◆ Partitioning()

Partitioning::Partitioning ( Mesh mesh,
Input::Record  in 
)

Constructor. A pointer to the mesh and accessor to an input record have to be provided.

Definition at line 61 of file partitioning.cc.

◆ ~Partitioning()

Partitioning::~Partitioning ( )

Destructor.

Definition at line 69 of file partitioning.cc.

Member Function Documentation

◆ DECLARE_INPUT_EXCEPTION()

Partitioning::DECLARE_INPUT_EXCEPTION ( ExcDecomposeMesh  ,
<< "Number of processors "<< EI_NProcs::val<< " greater then number of elements "<< EI_NElems::val<< ". Can not make partitioning of the mesh "<< EI_MeshFile::qval<< ".\n"   
)

◆ get_graph_type_sel()

const IT::Selection & Partitioning::get_graph_type_sel ( )
static

Input specification objects.

Definition at line 31 of file partitioning.cc.

Here is the caller graph for this function:

◆ get_init_distr()

const Distribution * Partitioning::get_init_distr ( ) const

Get initial distribution.

Definition at line 78 of file partitioning.cc.

◆ get_input_type()

const IT::Record & Partitioning::get_input_type ( )
static

Definition at line 49 of file partitioning.cc.

Here is the caller graph for this function:

◆ get_loc_part()

const LongIdx * Partitioning::get_loc_part ( ) const

Get local part of mesh partition.

Definition at line 85 of file partitioning.cc.

Here is the caller graph for this function:

◆ get_tool_sel()

const IT::Selection & Partitioning::get_tool_sel ( )
static

Definition at line 42 of file partitioning.cc.

Here is the caller graph for this function:

◆ id_maps() [1/2]

void Partitioning::id_maps ( int  n_ids,
LongIdx id_4_old,
const Distribution old_ds,
LongIdx loc_part,
Distribution *&  new_ds,
LongIdx *&  id_4_loc,
LongIdx *&  new_4_id 
)
static

Old UGLY, PETSC dependent method for getting new numbering after partitioning.

n_ids - given maximal ID used in id_4_old id_4_old - given array of size init_el_ds_.size() - assign ID to an old index

new_ds - new distribution of elements according to current distributed partitioning loc_part_ id_4_loc - IDs for local elements in new distribution, has size new_ds->lsize() new_4_id - for given ID, the new index, -1 for unknown IDs

Definition at line 184 of file partitioning.cc.

◆ id_maps() [2/2]

void Partitioning::id_maps ( int  n_ids,
LongIdx id_4_old,
Distribution *&  new_ds,
LongIdx *&  id_4_loc,
LongIdx *&  new_4_id 
)

Obsolete see source file for doc.

Definition at line 232 of file partitioning.cc.

Here is the caller graph for this function:

◆ make_element_connection_graph()

void Partitioning::make_element_connection_graph ( )
private

Creates sparse parallel graph from the mesh (using algorithm given by the key "graph_type" of the input record accessor in_

Definition at line 92 of file partitioning.cc.

Here is the caller graph for this function:

◆ make_partition()

void Partitioning::make_partition ( )
private

Creates sparse parallel graph from the mesh (using algorithm given by the key "graph_type" of the input record accessor in_) calls partitioning tool given by the key "tool" of the input record accessor in_) result is local part of the partitioning. Can be retrieved by get_loc_part().

Definition at line 141 of file partitioning.cc.

Here is the caller graph for this function:

◆ subdomain_id_field_data()

shared_ptr< vector< int > > Partitioning::subdomain_id_field_data ( )

Creates and returns vector with element partitioning for output.

Definition at line 238 of file partitioning.cc.

◆ TYPEDEF_ERR_INFO() [1/3]

Partitioning::TYPEDEF_ERR_INFO ( EI_MeshFile  ,
std::string   
)

◆ TYPEDEF_ERR_INFO() [2/3]

Partitioning::TYPEDEF_ERR_INFO ( EI_NElems  ,
unsigned int   
)

◆ TYPEDEF_ERR_INFO() [3/3]

Partitioning::TYPEDEF_ERR_INFO ( EI_NProcs  ,
unsigned int   
)

Member Data Documentation

◆ graph_

SparseGraph* Partitioning::graph_
private

Graph used to partitioning the mesh.

Definition at line 124 of file partitioning.hh.

◆ in_

Input::Record Partitioning::in_
private

Input Record accessor.

Definition at line 121 of file partitioning.hh.

◆ init_el_ds_

Distribution* Partitioning::init_el_ds_
private

Original distribution of elements. Depends on type of partitioner.

Definition at line 128 of file partitioning.hh.

◆ loc_part_

LongIdx* Partitioning::loc_part_
private

Partition numbers for local elements in original distribution of elements given be init_el_ds_.

Definition at line 126 of file partitioning.hh.

◆ mesh_

Mesh* Partitioning::mesh_
private

The input mesh.

Definition at line 119 of file partitioning.hh.

◆ seq_part_

shared_ptr< vector<int> > Partitioning::seq_part_
private

Sequential partitioning for output.

Definition at line 130 of file partitioning.hh.


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