Class that distribute sub-sub-domains across processors using Metis Library. More...
Class that distribute sub-sub-domains across processors using Metis Library.
Given a graph and setting Computational cost, Communication cost (on the edge) and Migration cost or total Communication costs, it produce the optimal distribution
Definition at line 44 of file MetisDistribution.hpp.
#include <MetisDistribution.hpp>
Public Member Functions | |
MetisDistribution (Vcluster<> &v_cl) | |
constructor | |
MetisDistribution (const MetisDistribution &mt) | |
Copy constructor. | |
MetisDistribution (MetisDistribution &&mt) | |
Copy constructor. | |
~MetisDistribution () | |
Destructor. | |
void | createCartGraph (grid_sm< dim, void > &grid, Box< dim, T > dom) |
create a Cartesian distribution graph | |
Graph_CSR< nm_v< dim >, nm_e > & | getGraph () |
Get the current graph (main) | |
void | decompose () |
Distribute the sub-sub-domains. | |
void | refine () |
Refine current decomposition. | |
void | redecompose () |
Redecompose current decomposition. | |
void | getSSDomainPos (size_t id, T(&pos)[dim]) |
Function that return the position (point P1) of the sub-sub domain box in the space. | |
size_t | getComputationalCost (size_t id) |
function that get the computational cost of the sub-sub-domain | |
void | setComputationCost (size_t id, size_t cost) |
Set computation cost on a sub-sub domain. | |
void | setMigrationCost (size_t id, size_t cost) |
Set migration cost on a sub-sub domain. | |
void | setCommunicationCost (size_t id, size_t e, size_t cost) |
Set communication cost between neighborhood sub-sub-domains (weight on the edge) | |
size_t | getNSubSubDomains () |
Returns total number of sub-sub-domains. | |
size_t | getNSubSubDomainNeighbors (size_t id) |
Returns total number of neighbors of one sub-sub-domain. | |
float | getUnbalance () |
Compute the unbalance of the processor compared to the optimal balance. | |
size_t | getNOwnerSubSubDomains () const |
Return the total number of sub-sub-domains in the distribution graph. | |
size_t | getOwnerSubSubDomain (size_t id) const |
Return the id of the set sub-sub-domain. | |
void | onTest () |
It set the Classs on test mode. | |
void | write (std::string out) |
Write the distribution graph into file. | |
size_t | getProcessorLoad () |
Compute the processor load. | |
MetisDistribution & | operator= (const MetisDistribution &mt) |
operator= | |
MetisDistribution & | operator= (MetisDistribution &&mt) |
operator= | |
bool | operator== (const MetisDistribution &mt) |
operator== | |
void | setDistTol (double tol) |
Set the tolerance for each partition. | |
size_t | getSubSubDomainComputationCost (size_t id) |
function that get the weight of the vertex | |
size_t | get_ndec () |
Get the decomposition counter. | |
Static Public Attributes | |
static constexpr unsigned int | computation = nm_v_computation |
Private Member Functions | |
void | check_overflow (size_t id) |
Check that the sub-sub-domain id exist. | |
void | check_overflowe (size_t id, size_t e) |
Check that the sub-sub-domain id exist. | |
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 | |
Graph_CSR< nm_v< dim >, nm_e > | gp |
Global sub-sub-domain graph. | |
bool | testing = false |
Flag that indicate if we are doing a test (In general it fix the seed) | |
Metis< Graph_CSR< nm_v< dim >, nm_e > > | metis_graph |
Metis decomposer utility. | |
std::unordered_map< size_t, size_t > | owner_scs |
unordered map that map global sub-sub-domain to owned_cost_sub id | |
openfpm::vector< met_sub_w > | owner_cost_sub |
list owned sub-sub-domains set for computation cost | |
openfpm::vector< met_sub_w > | recv_ass |
received assignment | |
|
inline |
|
inline |
Copy constructor.
mt | distribution to copy |
Definition at line 127 of file MetisDistribution.hpp.
|
inline |
Copy constructor.
mt | distribution to copy |
Definition at line 142 of file MetisDistribution.hpp.
|
inline |
Destructor.
Definition at line 155 of file MetisDistribution.hpp.
|
inlineprivate |
Check that the sub-sub-domain id exist.
id | sub-sub-domain id |
Definition at line 78 of file MetisDistribution.hpp.
|
inlineprivate |
Check that the sub-sub-domain id exist.
id | sub-sub-domain id |
Definition at line 94 of file MetisDistribution.hpp.
|
inline |
create a Cartesian distribution graph
grid | grid info (sub-sub somains on each dimension) |
dom | domain (domain where the sub-sub-domains are defined) |
Definition at line 169 of file MetisDistribution.hpp.
|
inline |
Distribute the sub-sub-domains.
Definition at line 217 of file MetisDistribution.hpp.
|
inline |
Get the decomposition counter.
Definition at line 665 of file MetisDistribution.hpp.
|
inline |
function that get the computational cost of the sub-sub-domain
id | sub-sub-domain |
Definition at line 346 of file MetisDistribution.hpp.
|
inline |
Get the current graph (main)
Definition at line 206 of file MetisDistribution.hpp.
|
inline |
Return the total number of sub-sub-domains in the distribution graph.
Definition at line 484 of file MetisDistribution.hpp.
|
inline |
Returns total number of neighbors of one sub-sub-domain.
id | of the sub-sub-domain |
Definition at line 436 of file MetisDistribution.hpp.
|
inline |
Returns total number of sub-sub-domains.
Definition at line 424 of file MetisDistribution.hpp.
|
inline |
Return the id of the set sub-sub-domain.
id | id in the list of the set sub-sub-domains |
Definition at line 496 of file MetisDistribution.hpp.
|
inline |
Compute the processor load.
Definition at line 536 of file MetisDistribution.hpp.
|
inline |
Function that return the position (point P1) of the sub-sub domain box in the space.
id | vertex id |
pos | vector that contain x, y, z |
Definition at line 325 of file MetisDistribution.hpp.
|
inline |
function that get the weight of the vertex
id | vertex id |
Definition at line 642 of file MetisDistribution.hpp.
|
inline |
Compute the unbalance of the processor compared to the optimal balance.
Definition at line 454 of file MetisDistribution.hpp.
|
inline |
It set the Classs on test mode.
At the moment it fix the seed to have reproducible results
Definition at line 506 of file MetisDistribution.hpp.
|
inline |
operator=
mt | object to copy |
Definition at line 568 of file MetisDistribution.hpp.
|
inline |
operator=
mt | object to copy |
Definition at line 589 of file MetisDistribution.hpp.
|
inline |
operator==
mt | Metis distribution to compare with |
Definition at line 610 of file MetisDistribution.hpp.
|
inline |
Redecompose current decomposition.
Definition at line 310 of file MetisDistribution.hpp.
|
inline |
Refine current decomposition.
In metis case it just re-decompose
Definition at line 298 of file MetisDistribution.hpp.
|
inline |
Set communication cost between neighborhood sub-sub-domains (weight on the edge)
id | sub-sub domain |
e | id in the neighborhood list (id in the adjacency list) |
cost |
Definition at line 406 of file MetisDistribution.hpp.
|
inline |
Set computation cost on a sub-sub domain.
id | sub-sub domain id |
cost |
Definition at line 362 of file MetisDistribution.hpp.
|
inline |
Set the tolerance for each partition.
tol | tolerance |
Definition at line 630 of file MetisDistribution.hpp.
|
inline |
Set migration cost on a sub-sub domain.
id | of the sub-sub domain |
cost |
Definition at line 388 of file MetisDistribution.hpp.
|
inline |
Write the distribution graph into file.
out | output filename |
Definition at line 519 of file MetisDistribution.hpp.
|
staticconstexpr |
Definition at line 107 of file MetisDistribution.hpp.
|
private |
rectangular domain to decompose
Definition at line 53 of file MetisDistribution.hpp.
|
private |
Global sub-sub-domain graph.
Definition at line 56 of file MetisDistribution.hpp.
|
private |
Structure that store the cartesian grid information.
Definition at line 50 of file MetisDistribution.hpp.
|
private |
Metis decomposer utility.
Definition at line 62 of file MetisDistribution.hpp.
|
private |
list owned sub-sub-domains set for computation cost
Definition at line 68 of file MetisDistribution.hpp.
|
private |
unordered map that map global sub-sub-domain to owned_cost_sub id
Definition at line 65 of file MetisDistribution.hpp.
|
private |
received assignment
Definition at line 71 of file MetisDistribution.hpp.
|
private |
Flag that indicate if we are doing a test (In general it fix the seed)
Definition at line 59 of file MetisDistribution.hpp.
|
private |
Definition at line 47 of file MetisDistribution.hpp.