Helper class to define Metis graph. More...
Helper class to define Metis graph.
graph | structure that store the graph |
Definition at line 99 of file parmetis_util.hpp.
#include <parmetis_util.hpp>
Public Member Functions | |
Parmetis (Vcluster<> &v_cl, size_t nc) | |
Constructor. | |
~Parmetis () | |
destructor | |
void | initSubGraph (Graph &g, const openfpm::vector< rid > &vtxdist, const std::unordered_map< rid, gid > &m2g, bool w) |
Set the Sub-graph. | |
void | decompose (const openfpm::vector< rid > &vtxdist) |
Decompose the graph. | |
void | refine (openfpm::vector< rid > &vtxdist) |
Refine the graph. | |
void | redecompose (openfpm::vector< rid > &vtxdist) |
Redecompose the graph. | |
idx_t * | getPartition () |
Get graph partition vector. | |
void | reset (Graph &g, const openfpm::vector< rid > &vtxdist, const std::unordered_map< rid, gid > &m2g, bool vgw) |
Reset graph and reconstruct it. | |
void | setDefaultParameters (bool w) |
Seth the default parameters for parmetis. | |
const Parmetis< Graph > & | operator= (const Parmetis< Graph > &pm) |
Copy the object. | |
const Parmetis< Graph > & | operator= (Parmetis< Graph > &&pm) |
Copy the object. | |
size_t | get_ndec () |
Get the decomposition counter. | |
void | setDistTol (real_t tol) |
Distribution tolerance. | |
Private Member Functions | |
void | constructAdjList (Graph &g, const std::unordered_map< rid, gid > &m2g) |
Construct Adjacency list. | |
Private Attributes | |
Parmetis_graph | Mg |
Graph in metis reppresentation. | |
MPI_Comm | comm = (MPI_Comm)NULL |
Communticator for OpenMPI. | |
Vcluster & | v_cl |
VCluster. | |
int | p_id = 0 |
Process rank information. | |
size_t | nc = 0 |
nc Number of partition | |
rid | first |
first re-mapped id | |
rid | last |
last re-mapped id | |
size_t | nvertex |
number of vertices that the processor has | |
size_t | n_dec |
indicate how many time decompose/refine/re-decompose has been called | |
real_t | dist_tol = 1.05 |
Distribution tolerance. | |
|
inline |
Constructor.
Construct a metis graph from Graph_CSR
v_cl | Vcluster object |
nc | number of partitions |
Definition at line 225 of file parmetis_util.hpp.
destructor
Destructor, It destroy all the memory allocated
Definition at line 269 of file parmetis_util.hpp.
|
inlineprivate |
Construct Adjacency list.
g | Global graph |
m2g | map from local index to global index |
starting point in the adjacency list
Definition at line 140 of file parmetis_util.hpp.
|
inline |
Decompose the graph.
i | which property store the decomposition |
Definition at line 391 of file parmetis_util.hpp.
|
inline |
Get the decomposition counter.
Definition at line 594 of file parmetis_util.hpp.
|
inline |
Get graph partition vector.
Definition at line 429 of file parmetis_util.hpp.
|
inline |
Set the Sub-graph.
g | Global graph to set |
vtxdist | indicate how the vertex of the graph are distrubuted across processors. |
m2g | map the local ids of the vertex into global-ids |
w | true if vertices have weights |
Definition at line 369 of file parmetis_util.hpp.
|
inline |
Copy the object.
pm | object to copy |
Definition at line 553 of file parmetis_util.hpp.
|
inline |
Copy the object.
pm | object to copy |
Definition at line 574 of file parmetis_util.hpp.
|
inline |
Redecompose the graph.
i | which property |
Definition at line 419 of file parmetis_util.hpp.
|
inline |
Refine the graph.
i | which property store the refined decomposition |
Definition at line 405 of file parmetis_util.hpp.
|
inline |
Reset graph and reconstruct it.
g | Global graph |
vtxdist | Distribution vector |
m2g | Mapped id to global id map |
vgw | Using weights on vertices |
Definition at line 441 of file parmetis_util.hpp.
|
inline |
Seth the default parameters for parmetis.
Set option for the graph partitioning (set as default)
is an output vector containing the partition for each vertex
adaptiveRepart itr value
init tpwgts to have balanced vertices and ubvec
This is used to indicate the numbering scheme that is used for the vtxdist, xadj, adjncy, and part arrays. (0 for C-style, start from 0 index)
This is used to indicate if the graph is weighted. wgtflag can take one of four values:
Definition at line 459 of file parmetis_util.hpp.
|
inline |
|
private |
Communticator for OpenMPI.
Definition at line 108 of file parmetis_util.hpp.
|
private |
Distribution tolerance.
Definition at line 132 of file parmetis_util.hpp.
first re-mapped id
Definition at line 120 of file parmetis_util.hpp.
last re-mapped id
Definition at line 123 of file parmetis_util.hpp.
|
private |
Graph in metis reppresentation.
Definition at line 102 of file parmetis_util.hpp.
|
private |
indicate how many time decompose/refine/re-decompose has been called
Definition at line 129 of file parmetis_util.hpp.
|
private |
nc Number of partition
Definition at line 117 of file parmetis_util.hpp.
|
private |
number of vertices that the processor has
Definition at line 126 of file parmetis_util.hpp.
|
private |
Process rank information.
Definition at line 114 of file parmetis_util.hpp.
VCluster.
Definition at line 111 of file parmetis_util.hpp.