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 55 of file BoxDistribution.hpp.
#include <BoxDistribution.hpp>
Public Member Functions | |
BoxDistribution (Vcluster<> &v_cl) | |
constructor | |
BoxDistribution (const BoxDistribution &mt) | |
Copy constructor. | |
BoxDistribution (BoxDistribution &&mt) | |
Copy constructor. | |
~BoxDistribution () | |
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. | |
BoxDistribution & | operator= (const BoxDistribution &mt) |
operator= | |
BoxDistribution & | operator= (BoxDistribution &&mt) |
operator= | |
bool | operator== (const BoxDistribution &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) | |
openfpm::vector< int > | subsub_own |
|
inline |
|
inline |
Copy constructor.
mt | distribution to copy |
Definition at line 128 of file BoxDistribution.hpp.
|
inline |
Copy constructor.
mt | distribution to copy |
Definition at line 143 of file BoxDistribution.hpp.
|
inline |
Destructor.
Definition at line 156 of file BoxDistribution.hpp.
|
inlineprivate |
Check that the sub-sub-domain id exist.
id | sub-sub-domain id |
Definition at line 79 of file BoxDistribution.hpp.
|
inlineprivate |
Check that the sub-sub-domain id exist.
id | sub-sub-domain id |
Definition at line 95 of file BoxDistribution.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 170 of file BoxDistribution.hpp.
|
inline |
Distribute the sub-sub-domains.
Definition at line 218 of file BoxDistribution.hpp.
|
inline |
Get the decomposition counter.
Definition at line 603 of file BoxDistribution.hpp.
|
inline |
function that get the computational cost of the sub-sub-domain
id | sub-sub-domain |
Definition at line 325 of file BoxDistribution.hpp.
|
inline |
Get the current graph (main)
Definition at line 207 of file BoxDistribution.hpp.
|
inline |
Return the total number of sub-sub-domains in the distribution graph.
Definition at line 431 of file BoxDistribution.hpp.
|
inline |
Returns total number of neighbors of one sub-sub-domain.
id | of the sub-sub-domain |
Definition at line 400 of file BoxDistribution.hpp.
|
inline |
Returns total number of sub-sub-domains.
Definition at line 388 of file BoxDistribution.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 443 of file BoxDistribution.hpp.
|
inline |
Compute the processor load.
Definition at line 483 of file BoxDistribution.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 304 of file BoxDistribution.hpp.
|
inline |
function that get the weight of the vertex
id | vertex id |
Definition at line 589 of file BoxDistribution.hpp.
|
inline |
Compute the unbalance of the processor compared to the optimal balance.
Definition at line 418 of file BoxDistribution.hpp.
|
inline |
It set the Classs on test mode.
At the moment it fix the seed to have reproducible results
Definition at line 453 of file BoxDistribution.hpp.
|
inline |
operator=
mt | object to copy |
Definition at line 536 of file BoxDistribution.hpp.
|
inline |
operator=
mt | object to copy |
Definition at line 515 of file BoxDistribution.hpp.
|
inline |
operator==
mt | Metis distribution to compare with |
Definition at line 556 of file BoxDistribution.hpp.
|
inline |
Redecompose current decomposition.
Definition at line 289 of file BoxDistribution.hpp.
|
inline |
Refine current decomposition.
In metis case it just re-decompose
Definition at line 277 of file BoxDistribution.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 372 of file BoxDistribution.hpp.
|
inline |
Set computation cost on a sub-sub domain.
id | sub-sub domain id |
cost |
Definition at line 341 of file BoxDistribution.hpp.
|
inline |
Set the tolerance for each partition.
tol | tolerance |
Definition at line 578 of file BoxDistribution.hpp.
|
inline |
Set migration cost on a sub-sub domain.
id | of the sub-sub domain |
cost |
Definition at line 356 of file BoxDistribution.hpp.
|
inline |
Write the distribution graph into file.
out | output filename |
Definition at line 466 of file BoxDistribution.hpp.
|
staticconstexpr |
Definition at line 108 of file BoxDistribution.hpp.
|
private |
rectangular domain to decompose
Definition at line 64 of file BoxDistribution.hpp.
|
private |
Global sub-sub-domain graph.
Definition at line 67 of file BoxDistribution.hpp.
|
private |
Structure that store the cartesian grid information.
Definition at line 61 of file BoxDistribution.hpp.
|
private |
Definition at line 72 of file BoxDistribution.hpp.
|
private |
Flag that indicate if we are doing a test (In general it fix the seed)
Definition at line 70 of file BoxDistribution.hpp.
|
private |
Definition at line 58 of file BoxDistribution.hpp.