OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
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.
 
 Metis (Graph &g, size_t nc)
 Constructor.
 
 Metis (Graph &g)
 Constructor.
 
void initMetisGraph (int nc, bool useWeights)
 Initialize the METIS graph.
 
 ~Metis ()
 destructor
 
template<unsigned int i>
void decompose ()
 Decompose the graph.
 
template<unsigned int i, typename Graph_part >
void decompose (Graph_part &gp)
 Decompose the graph.
 
void onTest (bool testing)
 It set Metis on test.
 
void setDistTol (real_t tol)
 Distribution tolerance.
 
size_t get_ndec ()
 Get the decomposition counter.
 
void inc_dec ()
 Increment the decomposition counter.
 

Private Member Functions

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

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

◆ Metis() [1/3]

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 219 of file metis_util.hpp.

◆ Metis() [2/3]

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 234 of file metis_util.hpp.

◆ Metis() [3/3]

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 249 of file metis_util.hpp.

◆ ~Metis()

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

destructor

Destructor, It destroy all the memory allocated

Definition at line 346 of file metis_util.hpp.

Member Function Documentation

◆ constructAdjList()

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.

◆ constructAdjListWithWeights()

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.

◆ decompose() [1/2]

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 413 of file metis_util.hpp.

◆ decompose() [2/2]

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 460 of file metis_util.hpp.

◆ get_ndec()

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

Get the decomposition counter.

Returns
the decomposition counter

Definition at line 524 of file metis_util.hpp.

◆ inc_dec()

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

Increment the decomposition counter.

Definition at line 533 of file metis_util.hpp.

◆ initMetisGraph()

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 262 of file metis_util.hpp.

◆ onTest()

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 492 of file metis_util.hpp.

◆ reset_pointer()

template<typename Graph >
void Metis< Graph >::reset_pointer ( )
inlineprivate

Definition at line 191 of file metis_util.hpp.

◆ setDistTol()

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

Distribution tolerance.

Parameters
toltolerance

Definition at line 514 of file metis_util.hpp.

Field Documentation

◆ dist_tol

template<typename Graph >
real_t Metis< Graph >::dist_tol = 1.05
private

Distribution tolerance.

Definition at line 85 of file metis_util.hpp.

◆ g

template<typename Graph >
Graph& Metis< Graph >::g
private

Original graph.

Definition at line 79 of file metis_util.hpp.

◆ Mg

template<typename Graph >
Metis_graph Metis< Graph >::Mg
private

Graph in metis reppresentation.

Definition at line 76 of file metis_util.hpp.

◆ n_dec

template<typename Graph >
size_t Metis< Graph >::n_dec
private

indicate how many time decompose/refine/re-decompose has been called

Definition at line 82 of file metis_util.hpp.


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