13 #include "SubdomainGraphNodes.hpp" 
   14 #include "VTKWriter/VTKWriter.hpp" 
   63 #define BALANCE_CC_O(c) c+1 
   72 template<
typename Graph>
 
   97         Mg.
xadj = 
new idx_t[g.getNVertex() + 1];
 
  107         for (
size_t i = 0; i < g.getNVertex(); i++)
 
  113             for (
size_t s = 0; s < g.getNChilds(i); s++)
 
  115                 Mg.
adjncy[prev + s] = g.getChild(i, s);
 
  119             prev += g.getNChilds(i);
 
  136         Mg.
xadj = 
new idx_t[g.getNVertex() + 1];
 
  137         Mg.
adjncy = 
new idx_t[g.getNEdge()];
 
  138         Mg.
vwgt = 
new idx_t[g.getNVertex()];
 
  139         Mg.
adjwgt = 
new idx_t[g.getNEdge()];
 
  140         Mg.
vsize = 
new idx_t[g.getNVertex()];
 
  149         for (
size_t i = 0; i < g.getNVertex(); i++)
 
  152             Mg.
vwgt[i] = g.vertex(i).template get<nm_v::computation>();
 
  154             Mg.
vsize[i] = g.vertex(i).template get<nm_v::migration>();
 
  161             for (
size_t s = 0; s < g.getNChilds(i); s++)
 
  163                 Mg.
adjncy[prev + s] = g.getChild(i, s);
 
  166                 Mg.
adjwgt[prev + s] = g.getChildEdge(i, s).template get<nm_e::communication>();
 
  171             prev += g.getNChilds(i);
 
  191     Metis(Graph & 
g, 
size_t nc, 
bool useWeights)
 
  296         Mg.
part = 
new idx_t[
g.getNVertex()];
 
  298         for (
size_t i = 0; i < 
g.getNVertex(); i++)
 
  369     template<
unsigned int i>
 
  375             METIS_PartGraphRecursive(
Mg.
nvtxs, 
Mg.
ncon, 
Mg.
xadj, 
Mg.
adjncy, 
Mg.
vwgt, 
Mg.
vsize, 
Mg.
adjwgt, 
Mg.
nparts, 
Mg.
tpwgts, 
Mg.
ubvec, 
Mg.
options, 
Mg.
objval, 
Mg.
part);
 
  383             auto it = 
g.getVertexIterator();
 
  387                 g.vertex(it).template get<i>() = 
Mg.
part[
id];
 
  397             auto it = 
g.getVertexIterator();
 
  401                 g.vertex(it).template get<i>() = 0;
 
  416     template<
unsigned int i, 
typename Graph_part>
 
  420         METIS_PartGraphRecursive(
Mg.
nvtxs, 
Mg.
ncon, 
Mg.
xadj, 
Mg.
adjncy, 
Mg.
vwgt, 
Mg.
vsize, 
Mg.
adjwgt, 
Mg.
nparts, 
Mg.
tpwgts, 
Mg.
ubvec, 
Mg.
options, 
Mg.
objval, 
Mg.
part);
 
  428         auto it = gp.getVertexIterator();
 
  432             gp.vertex(it).template get<i>() = 
Mg.
part[
id];
 
  451         if (testing == 
false)
 
real_t dist_tol
Distribution tolerance. 
 
idx_t * nvtxs
The number of vertices in the graph. 
 
void onTest(bool testing)
It set Metis on test. 
 
void decompose()
Decompose the graph. 
 
void constructAdjList(Graph &g)
Construct Adjacency list. 
 
Helper class to define Metis graph. 
 
idx_t * vwgt
Array that store the weight for each vertex. 
 
idx_t * nparts
number of part to partition the graph 
 
Metis(Graph &g, size_t nc)
Constructor. 
 
void constructAdjListWithWeights(Graph &g)
Construct Adjacency list. 
 
Metis(Graph &g, size_t nc, bool useWeights)
Constructor. 
 
Metis_graph Mg
Graph in metis reppresentation. 
 
void setDistTol(real_t tol)
Distribution tolerance. 
 
idx_t * xadj
For each vertex it store the adjacency lost start for the vertex i. 
 
idx_t * objval
return the total comunication cost for each partition 
 
idx_t * adjncy
For each vertex it store a list of all neighborhood vertex. 
 
idx_t * part
Is a output vector containing the partition for each vertex. 
 
idx_t * options
Additional option for the graph partitioning. 
 
idx_t * adjwgt
The weight of the edge. 
 
size_t get_ndec()
Get the decomposition counter. 
 
Metis(Graph &g)
Constructor. 
 
real_t * tpwgts
Desired weight for each partition (one for each constrain) 
 
void inc_dec()
Increment the decomposition counter. 
 
void decompose(Graph_part &gp)
Decompose the graph. 
 
idx_t * vsize
Array of the vertex size, basically is the total communication amount. 
 
real_t * ubvec
For each partition load imbalance tollerated. 
 
void initMetisGraph(int nc, bool useWeights)
Initialize the METIS graph. 
 
size_t n_dec
indicate how many time decompose/refine/re-decompose has been called