DASH  0.3.0
dash::util::TeamLocality Class Reference

Hierarchical locality domains of a specified team. More...

#include <TeamLocality.h>

Public Member Functions

 TeamLocality (dash::Team &team, Scope_t scope=Scope_t::Global, std::string domain_tag=".")
 Constructor. More...
 
 TeamLocality (dash::Team &team, LocalityDomain_t &domain)
 Constructor. More...
 
 TeamLocality ()=default
 Default constructor. More...
 
 TeamLocality (const self_t &other)=default
 Copy constructor. More...
 
self_toperator= (const self_t &other)=default
 Assignment operator. More...
 
const LocalityDomain_tdomain () const
 The team locality domain descriptor. More...
 
LocalityDomain_tdomain ()
 The team locality domain descriptor. More...
 
self_tsplit (Scope_t scope, int num_split_parts=0)
 Split the team locality domain into the given number of parts on the specified locality scope. More...
 
self_tsplit_groups ()
 Split groups in locality domain into separate parts. More...
 
std::vector< LocalityDomain_t::iterator > & groups ()
 Parts of the team locality that resulted from a previous split. More...
 
const std::vector< LocalityDomain_t::iterator > & groups () const
 Parts of the team locality that have been created in a previous split. More...
 
std::vector< LocalityDomain_t > & parts ()
 Parts of the team locality that resulted from a previous split. More...
 
const std::vector< LocalityDomain_t > & parts () const
 Parts of the team locality that have been created in a previous split. More...
 
size_t num_nodes () const
 
size_t num_cores () const
 
dash::Teamteam () const
 
const std::vector< global_unit_t > & global_units () const
 
dash::util::UnitLocality unit_locality (team_unit_t unit_id) const
 
dash::util::UnitLocality unit_locality (global_unit_t unit_id) const
 
LocalityDomain_tgroup (const std::vector< std::string > &group_subdomain_tags)
 
self_tselect (const std::vector< std::string > &domain_tags)
 
self_texclude (const std::vector< std::string > &domain_tags)
 

Detailed Description

Hierarchical locality domains of a specified team.

Usage examples:

// Team locality at first node, split at module scope:
tloc.select(".0")
.split(dash::util::Locality::Scope::Module);
size_t num_module_parts = tloc.parts().size();
for (dash::util::LocalityDomain domain : tloc.parts()) {
int module_index = domain.relative_index();
int domain_max_core_mhz = domain.hwinfo().max_cpu_mhz;
int domain_min_core_threads = domain.hwinfo().min_threads;
int domain_core_perf = domain_max_core_mhz *
domain_min_core_threads;
size_t num_module_units = domain.units().size();
for (global_unit_t module_unit_id : domain.unit_ids()) {
dash::util::UnitLocality uloc(team, module_unit_id);
std::string unit_host = uloc.host();
int unit_numa_id = uloc.hwinfo().numa_id;
int unit_num_cores = uloc.hwinfo().num_cores;
int unit_num_threads = uloc.hwinfo().max_threads * unit_num_cores;
}
}

Definition at line 61 of file TeamLocality.h.

Constructor & Destructor Documentation

◆ TeamLocality() [1/4]

dash::util::TeamLocality::TeamLocality ( dash::Team team,
Scope_t  scope = Scope_t::Global,
std::string  domain_tag = "." 
)

Constructor.

Creates new instance of dash::util::TeamLocality by loading the locality domain of a specified team.

◆ TeamLocality() [2/4]

dash::util::TeamLocality::TeamLocality ( dash::Team team,
LocalityDomain_t domain 
)

Constructor.

Creates new instance of dash::util::TeamLocality for a specified team and locality domain.

◆ TeamLocality() [3/4]

dash::util::TeamLocality::TeamLocality ( )
default

Default constructor.

◆ TeamLocality() [4/4]

dash::util::TeamLocality::TeamLocality ( const self_t other)
default

Copy constructor.

Member Function Documentation

◆ domain() [1/2]

const LocalityDomain_t& dash::util::TeamLocality::domain ( ) const
inline

The team locality domain descriptor.

Definition at line 105 of file TeamLocality.h.

106  {
107  return _domain;
108  }

◆ domain() [2/2]

LocalityDomain_t& dash::util::TeamLocality::domain ( )
inline

The team locality domain descriptor.

Definition at line 113 of file TeamLocality.h.

114  {
115  return _domain;
116  }

◆ groups() [1/2]

std::vector<LocalityDomain_t::iterator>& dash::util::TeamLocality::groups ( )
inline

Parts of the team locality that resulted from a previous split.

Definition at line 154 of file TeamLocality.h.

155  {
156  return _domain.groups();
157  }

◆ groups() [2/2]

const std::vector<LocalityDomain_t::iterator>& dash::util::TeamLocality::groups ( ) const
inline

Parts of the team locality that have been created in a previous split.

Definition at line 162 of file TeamLocality.h.

163  {
164  return _domain.groups();
165  }

◆ operator=()

self_t& dash::util::TeamLocality::operator= ( const self_t other)
default

Assignment operator.

◆ parts() [1/2]

std::vector<LocalityDomain_t>& dash::util::TeamLocality::parts ( )
inline

Parts of the team locality that resulted from a previous split.

Definition at line 170 of file TeamLocality.h.

171  {
172  return _domain.parts();
173  }

◆ parts() [2/2]

const std::vector<LocalityDomain_t>& dash::util::TeamLocality::parts ( ) const
inline

Parts of the team locality that have been created in a previous split.

Definition at line 178 of file TeamLocality.h.

References dash::Team::dart_id(), dart_team_unit_g2l(), dash::util::LocalityDomain::exclude(), dash::util::LocalityDomain::group(), dash::Team::Null(), and dash::util::LocalityDomain::select().

179  {
180  return _domain.parts();
181  }

◆ split()

self_t& dash::util::TeamLocality::split ( Scope_t  scope,
int  num_split_parts = 0 
)
inline

Split the team locality domain into the given number of parts on the specified locality scope.

Team locality domains resulting from the split can be accessed using method parts().

Definition at line 136 of file TeamLocality.h.

References dash::util::LocalityDomain::split().

137  {
138  _domain.split(scope, num_split_parts);
139  return *this;
140  }
self_t & split(dash::util::Locality::Scope scope, int num_split_parts)
Split the team locality domain into the given number of parts on the specified locality scope...

◆ split_groups()

self_t& dash::util::TeamLocality::split_groups ( )
inline

Split groups in locality domain into separate parts.

Definition at line 145 of file TeamLocality.h.

References dash::util::LocalityDomain::split_groups().

146  {
147  _domain.split_groups();
148  return *this;
149  }
self_t & split_groups()
Split groups in locality domain into separate parts.

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