Definition at line 17 of file DistParMetisDistribution.hpp.
Public Member Functions | |
DistParMetisDistribution (Vcluster<> &v_cl) | |
void | createCartGraph (grid_sm< dim, void > &grid, Box< dim, T > dom) |
Initialize the distribution graph. | |
DistGraph_CSR< nm_v< dim >, nm_e > & | getGraph () |
Get the current graph (main) | |
void | decompose () |
Create first decomposition, it divides the graph in slices and give each slice to a processor. | |
void | refine () |
Refine current decomposition. | |
float | getUnbalance () |
Compute the unbalance value. | |
void | getSubSubDomainPosition (size_t id, T(&pos)[dim]) |
function that return the position of the vertex in the space | |
void | setComputationCost (size_t id, size_t weight) |
Function that set the weight of the vertex. | |
bool | weightsAreUsed () |
Checks if weights are used on the vertices. | |
size_t | getVertexWeight (size_t id) |
function that get the weight of the vertex | |
size_t | getProcessorLoad () |
Compute the processor load counting the total weights of its vertices. | |
size_t | getTotalMovedV () |
return number of moved vertices in all iterations so far | |
size_t | getMaxMovedV () |
return number of moved vertices in all iterations so far | |
void | setMigrationCost (size_t id, size_t migration) |
Set migration cost of the vertex id. | |
void | setCommunicationCost (size_t v_id, size_t e, size_t communication) |
Set communication cost of the edge id. | |
size_t | getNSubSubDomains () |
Returns total number of sub-sub-domains in the distribution graph. | |
size_t | getNSubSubDomainNeighbors (size_t id) |
Returns total number of neighbors of the sub-sub-domain id. | |
void | write (const std::string &file) |
Print current graph and save it to file. | |
const DistParMetisDistribution< dim, T > & | operator= (const DistParMetisDistribution< dim, T > &dist) |
copy operator | |
const DistParMetisDistribution< dim, T > & | operator= (DistParMetisDistribution< dim, T > &&dist) |
copy operator | |
Static Private Member Functions | |
static void * | message_receive (size_t msg_i, size_t total_msg, size_t total_p, size_t i, size_t ri, void *ptr) |
Callback of the sendrecv to set the size of the array received. | |
Private Attributes | |
Vcluster & | v_cl |
Vcluster. | |
grid_sm< dim, void > | gr |
Structure that store the cartesian grid information. | |
Box< dim, T > | domain |
rectangular domain to decompose | |
DistGraph_CSR< nm_v< dim >, nm_e > | g |
Processor sub-sub-domain graph. | |
DistParmetis< DistGraph_CSR< nm_v< dim >, nm_e > > | parmetis_graph |
Convert the graph to parmetis format. | |
openfpm::vector< idx_t > | vtxdist |
Init vtxdist needed for Parmetis. | |
openfpm::vector< openfpm::vector< idx_t > > | partitions |
partitions | |
openfpm::vector< openfpm::vector< size_t > > | v_per_proc |
Init data structure to keep trace of new vertices distribution in processors (needed to update main graph) | |
size_t | g_moved = 0 |
Number of moved vertices in all iterations. | |
size_t | m_moved = 0 |
Max number of moved vertices in all iterations. | |
bool | verticesGotWeights = false |
Flag to check if weights are used on vertices. | |
|
inline |
Constructor for the ParMetis class
v_cl | Vcluster to use as communication object in this class |
Definition at line 76 of file DistParMetisDistribution.hpp.
|
inline |
Initialize the distribution graph.
/param grid Grid /param dom Domain
Set grid and domain
Create sub graph
Definition at line 87 of file DistParMetisDistribution.hpp.
|
inline |
Create first decomposition, it divides the graph in slices and give each slice to a processor.
Init sub graph in parmetis format
Decompose
Get result partition for this processors
Definition at line 115 of file DistParMetisDistribution.hpp.
|
inline |
Get the current graph (main)
Definition at line 107 of file DistParMetisDistribution.hpp.
|
inline |
return number of moved vertices in all iterations so far
Definition at line 278 of file DistParMetisDistribution.hpp.
|
inline |
Returns total number of neighbors of the sub-sub-domain id.
id | id of the sub-sub-domain |
Definition at line 326 of file DistParMetisDistribution.hpp.
|
inline |
Returns total number of sub-sub-domains in the distribution graph.
Definition at line 314 of file DistParMetisDistribution.hpp.
|
inline |
Compute the processor load counting the total weights of its vertices.
Definition at line 252 of file DistParMetisDistribution.hpp.
|
inline |
function that return the position of the vertex in the space
id | vertex id |
pos | vector that will contain x, y, z |
Definition at line 190 of file DistParMetisDistribution.hpp.
|
inline |
return number of moved vertices in all iterations so far
Definition at line 268 of file DistParMetisDistribution.hpp.
|
inline |
Compute the unbalance value.
Definition at line 163 of file DistParMetisDistribution.hpp.
|
inline |
function that get the weight of the vertex
id | vertex id |
Definition at line 238 of file DistParMetisDistribution.hpp.
|
inlinestaticprivate |
Callback of the sendrecv to set the size of the array received.
msg_i | Index of the message |
total_msg | Total numeber of messages |
total_p | Total number of processors to comunicate with |
i | Processor id |
ri | Request id |
ptr | Void pointer parameter for additional data to pass to the call-back |
Definition at line 61 of file DistParMetisDistribution.hpp.
|
inline |
copy operator
dist | object to copy |
Definition at line 352 of file DistParMetisDistribution.hpp.
|
inline |
copy operator
dist | object to copy |
Definition at line 372 of file DistParMetisDistribution.hpp.
|
inline |
Refine current decomposition.
It makes a refinement of the current decomposition using Parmetis function RefineKWay After that it also does the remapping of the graph
Reset parmetis graph and reconstruct it
Refine
Get result partition for this processors
Definition at line 140 of file DistParMetisDistribution.hpp.
|
inline |
Set communication cost of the edge id.
v_id | Id of the source vertex of the edge |
e | i child of the vertex |
communication | Communication value |
Definition at line 304 of file DistParMetisDistribution.hpp.
|
inline |
Function that set the weight of the vertex.
id | vertex id |
weight | to give to the vertex |
Definition at line 209 of file DistParMetisDistribution.hpp.
|
inline |
Set migration cost of the vertex id.
id | of the vertex to update |
migration | cost of the migration |
Definition at line 288 of file DistParMetisDistribution.hpp.
|
inline |
Checks if weights are used on the vertices.
Definition at line 226 of file DistParMetisDistribution.hpp.
|
inline |
Print current graph and save it to file.
file | file |
Definition at line 339 of file DistParMetisDistribution.hpp.
|
private |
rectangular domain to decompose
Definition at line 26 of file DistParMetisDistribution.hpp.
|
private |
Processor sub-sub-domain graph.
Definition at line 29 of file DistParMetisDistribution.hpp.
|
private |
Number of moved vertices in all iterations.
Definition at line 44 of file DistParMetisDistribution.hpp.
|
private |
Structure that store the cartesian grid information.
Definition at line 23 of file DistParMetisDistribution.hpp.
|
private |
Max number of moved vertices in all iterations.
Definition at line 47 of file DistParMetisDistribution.hpp.
|
private |
Convert the graph to parmetis format.
Definition at line 32 of file DistParMetisDistribution.hpp.
|
private |
partitions
Definition at line 38 of file DistParMetisDistribution.hpp.
|
private |
Definition at line 20 of file DistParMetisDistribution.hpp.
|
private |
Init data structure to keep trace of new vertices distribution in processors (needed to update main graph)
Definition at line 41 of file DistParMetisDistribution.hpp.
|
private |
Flag to check if weights are used on vertices.
Definition at line 50 of file DistParMetisDistribution.hpp.
|
private |
Init vtxdist needed for Parmetis.
Definition at line 35 of file DistParMetisDistribution.hpp.