ug4
|
Defines how the different levels of a grid shall be distributed across the available processes. More...
#include <process_hierarchy.h>
Classes | |
struct | HLevelInfo |
Public Member Functions | |
void | add_hierarchy_level (size_t gridLvl, size_t numProcsPerProc) |
void | add_partition_hint (int hlvl, const std::string &name, const Variant &value) |
allows specification of partitioning hints per hierarchy level. More... | |
const std::vector< int > & | cluster_procs (size_t hierarchyLevel) const |
bool | empty () const |
pcl::ProcessCommunicator | global_proc_com (size_t hierarchyLevel) const |
size_t | grid_base_level (size_t hierarchyLevel) const |
size_t | hierarchy_level_from_grid_level (size_t gridLevel) const |
size_t | num_global_procs_involved (size_t hierarchyLevel) const |
size_t | num_hierarchy_levels () const |
bool | partition_hint (Variant &valOut, int hlvl, const std::string &name) const |
returns true if the queried partition hint exists and writes it value to 'valOut' More... | |
std::string | to_string () const |
Returns a string which describes the hierarchy layout. More... | |
~ProcessHierarchy () | |
Static Public Member Functions | |
static SPProcessHierarchy | create () |
Protected Types | |
typedef std::map< std::string, Variant > | PartitionHintMap |
Protected Member Functions | |
HLevelInfo & | get_hlevel_info (size_t lvl) |
const HLevelInfo & | get_hlevel_info (size_t lvl) const |
void | init_cluster_procs (std::vector< int > &clusterProcs, size_t hlvl, size_t numProcsPerProc) |
Private Attributes | |
std::vector< HLevelInfo > | m_levels |
Defines how the different levels of a grid shall be distributed across the available processes.
Used by LoadBalancer and by different partitioners.
|
protected |
ug::ProcessHierarchy::~ProcessHierarchy | ( | ) |
void ug::ProcessHierarchy::add_hierarchy_level | ( | size_t | gridLvl, |
size_t | numProcsPerProc | ||
) |
void ug::ProcessHierarchy::add_partition_hint | ( | int | hlvl, |
const std::string & | name, | ||
const Variant & | value | ||
) |
allows specification of partitioning hints per hierarchy level.
References name, ug::Variant::to_bool(), and UG_LOG.
const std::vector< int > & ug::ProcessHierarchy::cluster_procs | ( | size_t | hierarchyLevel | ) | const |
Contains only processes which are contained in the cluster of the given hierarchyLevel in which the local process is included.
Referenced by ug::Partitioner_DynamicBisection< TElem, dim >::partition().
|
inlinestatic |
Referenced by ug::CreateProcessHierarchy(), and ug::LoadBalancer::LoadBalancer().
bool ug::ProcessHierarchy::empty | ( | ) | const |
|
inlineprotected |
References m_levels.
|
inlineprotected |
References m_levels.
pcl::ProcessCommunicator ug::ProcessHierarchy::global_proc_com | ( | size_t | hierarchyLevel | ) | const |
Contains all processes which participate on the given hierarchy level, but only if the local process participates itself. If it doesn't, the returned communicator is empty.
Referenced by ug::LoadBalancer::estimate_distribution_quality_impl(), and ug::Partitioner_DynamicBisection< TElem, dim >::partition().
size_t ug::ProcessHierarchy::grid_base_level | ( | size_t | hierarchyLevel | ) | const |
Referenced by ug::Partitioner_DynamicBisection< TElem, dim >::partition().
size_t ug::ProcessHierarchy::hierarchy_level_from_grid_level | ( | size_t | gridLevel | ) | const |
References UG_THROW.
Referenced by ug::LoadBalancer::estimate_distribution_quality_impl().
|
protected |
References ug::ProcessHierarchy::HLevelInfo::numGlobalProcsInUse, pcl::ProcRank(), and UG_ASSERT.
size_t ug::ProcessHierarchy::num_global_procs_involved | ( | size_t | hierarchyLevel | ) | const |
size_t ug::ProcessHierarchy::num_hierarchy_levels | ( | ) | const |
Referenced by ug::Partitioner_DynamicBisection< TElem, dim >::partition().
bool ug::ProcessHierarchy::partition_hint | ( | Variant & | valOut, |
int | hlvl, | ||
const std::string & | name | ||
) | const |
returns true if the queried partition hint exists and writes it value to 'valOut'
The method searches hierarchy levels starting from the specified one down to level 0 and returns the first matching value.
References name, ug::Variant::to_bool(), and UG_LOG.
Referenced by ug::Partitioner_DynamicBisection< TElem, dim >::partition().
std::string ug::ProcessHierarchy::to_string | ( | ) | const |
Returns a string which describes the hierarchy layout.
References ug::Table< T >::to_string().
|
private |
Referenced by get_hlevel_info().