OpenFPM_pdata  1.1.0
Project that contain the implementation of distributed structures
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Pages
Metis< Graph > Class Template Reference

Helper class to define Metis graph. More...

Detailed Description

template<typename Graph>
class Metis< Graph >

Helper class to define Metis graph.

Template Parameters
graphstructure that store the graph

Definition at line 73 of file metis_util.hpp.

#include <metis_util.hpp>

Public Member Functions

 Metis (Graph &g, size_t nc, bool useWeights)
 Constructor. More...
 
 Metis (Graph &g, size_t nc)
 Constructor. More...
 
 Metis (Graph &g)
 Constructor. More...
 
void initMetisGraph (int nc, bool useWeights)
 Initialize the METIS graph. More...
 
 ~Metis ()
 destructor More...
 
template<unsigned int i>
void decompose ()
 Decompose the graph. More...
 
template<unsigned int i, typename Graph_part >
void decompose (Graph_part &gp)
 Decompose the graph. More...
 
void onTest (bool testing)
 It set Metis on test. More...
 
void setDistTol (real_t tol)
 Distribution tolerance. More...
 
size_t get_ndec ()
 Get the decomposition counter. More...
 
void inc_dec ()
 Increment the decomposition counter. More...
 

Private Member Functions

void constructAdjList (Graph &g)
 Construct Adjacency list. More...
 
void constructAdjListWithWeights (Graph &g)
 Construct Adjacency list. More...
 

Private Attributes

Metis_graph Mg
 Graph in metis reppresentation.
 
Graph & g
 Original graph.
 
size_t n_dec
 indicate how many time decompose/refine/re-decompose has been called
 
real_t dist_tol = 1.05
 Distribution tolerance.
 

Constructor & Destructor Documentation

template<typename Graph>
Metis< Graph >::Metis ( Graph &  g,
size_t  nc,
bool  useWeights 
)
inline

Constructor.

Construct a metis graph from Graph_CSR

Parameters
gGraph we want to convert to decompose
ncnumber of partitions
useWeightstells if weights are used or not

Definition at line 191 of file metis_util.hpp.

template<typename Graph>
Metis< Graph >::Metis ( Graph &  g,
size_t  nc 
)
inline

Constructor.

Construct a metis graph from Graph_CSR

Parameters
gGraph we want to convert to decompose
ncnumber of partitions

Definition at line 205 of file metis_util.hpp.

template<typename Graph>
Metis< Graph >::Metis ( Graph &  g)
inline

Constructor.

This constructor does not initialize the internal metis graph you have to use initMetisGraph to initialize

Parameters
gGraph we want to convert to decompose

Definition at line 219 of file metis_util.hpp.

template<typename Graph>
Metis< Graph >::~Metis ( )
inline

destructor

Destructor, It destroy all the memory allocated

Definition at line 307 of file metis_util.hpp.

Member Function Documentation

template<typename Graph>
void Metis< Graph >::constructAdjList ( Graph &  g)
inlineprivate

Construct Adjacency list.

Parameters
gGraph

starting point in the adjacency list

Definition at line 92 of file metis_util.hpp.

template<typename Graph>
void Metis< Graph >::constructAdjListWithWeights ( Graph &  g)
inlineprivate

Construct Adjacency list.

Parameters
gGraph

starting point in the adjacency list

Definition at line 133 of file metis_util.hpp.

template<typename Graph>
template<unsigned int i>
void Metis< Graph >::decompose ( )
inline

Decompose the graph.

Template Parameters
iwhich property store the decomposition

Definition at line 370 of file metis_util.hpp.

template<typename Graph>
template<unsigned int i, typename Graph_part >
void Metis< Graph >::decompose ( Graph_part &  gp)
inline

Decompose the graph.

Template Parameters
iwhich property store the decomposition

Definition at line 417 of file metis_util.hpp.

template<typename Graph>
size_t Metis< Graph >::get_ndec ( )
inline

Get the decomposition counter.

Returns
the decomposition counter

Definition at line 481 of file metis_util.hpp.

template<typename Graph>
void Metis< Graph >::inc_dec ( )
inline

Increment the decomposition counter.

Definition at line 490 of file metis_util.hpp.

template<typename Graph>
void Metis< Graph >::initMetisGraph ( int  nc,
bool  useWeights 
)
inline

Initialize the METIS graph.

Parameters
ncnumber of partitions
useWeightsuse the weights on the graph

Set to null the partition load imbalance tolerance

Set tp null additional option for the graph partitioning

set the objective value

Is an output vector containing the partition for each vertex

Definition at line 244 of file metis_util.hpp.

template<typename Graph>
void Metis< Graph >::onTest ( bool  testing)
inline

It set Metis on test.

Parameters
testingset to true to disable the testing

At the moment disable the seed randomness to keep the result reproducible

Definition at line 449 of file metis_util.hpp.

template<typename Graph>
void Metis< Graph >::setDistTol ( real_t  tol)
inline

Distribution tolerance.

Parameters
toltolerance

Definition at line 471 of file metis_util.hpp.


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