ug4
ug::ProcessHierarchy Class Reference

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, VariantPartitionHintMap
 

Protected Member Functions

HLevelInfoget_hlevel_info (size_t lvl)
 
const HLevelInfoget_hlevel_info (size_t lvl) const
 
void init_cluster_procs (std::vector< int > &clusterProcs, size_t hlvl, size_t numProcsPerProc)
 

Private Attributes

std::vector< HLevelInfom_levels
 

Detailed Description

Defines how the different levels of a grid shall be distributed across the available processes.

Used by LoadBalancer and by different partitioners.

Member Typedef Documentation

◆ PartitionHintMap

typedef std::map<std::string, Variant> ug::ProcessHierarchy::PartitionHintMap
protected

Constructor & Destructor Documentation

◆ ~ProcessHierarchy()

ug::ProcessHierarchy::~ProcessHierarchy ( )

Member Function Documentation

◆ add_hierarchy_level()

◆ add_partition_hint()

void ug::ProcessHierarchy::add_partition_hint ( int  hlvl,
const std::string &  name,
const Variant value 
)

allows specification of partitioning hints per hierarchy level.

Note
A hint is valid for all subsequent hierarchy levels until it is specified again with a different value.
Partitioners are free to ignore any partitioning hints. For a list of supported hints please check the documentation of the respective partitioner.

References name, ug::Variant::to_bool(), and UG_LOG.

◆ cluster_procs()

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().

◆ create()

static SPProcessHierarchy ug::ProcessHierarchy::create ( )
inlinestatic

◆ empty()

bool ug::ProcessHierarchy::empty ( ) const

◆ get_hlevel_info() [1/2]

HLevelInfo& ug::ProcessHierarchy::get_hlevel_info ( size_t  lvl)
inlineprotected

References m_levels.

◆ get_hlevel_info() [2/2]

const HLevelInfo& ug::ProcessHierarchy::get_hlevel_info ( size_t  lvl) const
inlineprotected

References m_levels.

◆ global_proc_com()

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().

◆ grid_base_level()

size_t ug::ProcessHierarchy::grid_base_level ( size_t  hierarchyLevel) const

◆ hierarchy_level_from_grid_level()

size_t ug::ProcessHierarchy::hierarchy_level_from_grid_level ( size_t  gridLevel) const

◆ init_cluster_procs()

void ug::ProcessHierarchy::init_cluster_procs ( std::vector< int > &  clusterProcs,
size_t  hlvl,
size_t  numProcsPerProc 
)
protected

◆ num_global_procs_involved()

size_t ug::ProcessHierarchy::num_global_procs_involved ( size_t  hierarchyLevel) const

◆ num_hierarchy_levels()

size_t ug::ProcessHierarchy::num_hierarchy_levels ( ) const

◆ partition_hint()

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().

◆ to_string()

std::string ug::ProcessHierarchy::to_string ( ) const

Returns a string which describes the hierarchy layout.

References ug::Table< T >::to_string().

Member Data Documentation

◆ m_levels

std::vector<HLevelInfo> ug::ProcessHierarchy::m_levels
private

Referenced by get_hlevel_info().


The documentation for this class was generated from the following files: