DASH  0.3.0
dash::util::LocalityDomain Class Reference

Wrapper of a single dart_domain_locality_t object. More...

#include <LocalityDomain.h>

Public Types

typedef internal::LocalityDomainIterator< self_titerator
 
typedef internal::LocalityDomainIterator< const self_tconst_iterator
 

Public Member Functions

 LocalityDomain (const dart_domain_locality_t &domain)
 
 LocalityDomain (dart_domain_locality_t *domain)
 
 LocalityDomain (const self_t &other)
 
 LocalityDomain (self_t &&other)
 
self_toperator= (const self_t &other)
 
self_toperator= (self_t &&other)
 
bool operator== (const self_t &rhs) const
 
bool operator!= (const self_t &rhs) const
 
self_tselect (const std::vector< std::string > &subdomain_tags)
 Remove subdomains that do not match one of the specified domain tags and are not a subdomain of a matched domain. More...
 
self_texclude (const std::vector< std::string > &subdomain_tags)
 Remove subdomains that match the specified domain tags or are a subdomain of a matched domain. More...
 
self_tgroup (const std::vector< std::string > &group_subdomain_tags)
 Add a group subdomain consisting of domains with the specified tags. More...
 
self_tsplit (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. More...
 
self_tsplit_groups ()
 Split groups in locality domain into separate parts. More...
 
const self_tat (int relative_index) const
 Lazy-load instance of LocalityDomain for child subdomain at relative index. More...
 
self_tat (int relative_index)
 Lazy-load instance of LocalityDomain for child subdomain at relative index. More...
 
const_iterator find (const std::string &subdomain_tag) const
 Find locality subdomain with specified domain tag. More...
 
iterator find (const std::string &subdomain_tag)
 Find locality subdomain with specified domain tag. More...
 
std::vector< iterator > & groups ()
 
const std::vector< iterator > & groups () const
 
std::vector< self_t > & parts ()
 
const std::vector< self_t > & parts () const
 
std::vector< self_tscope_domains (dash::util::Locality::Scope scope) const
 
dart_team_t dart_team () const
 
const std::string & domain_tag () const
 
const dart_domain_locality_tdart_type () const
 
std::string host () const
 
int shared_mem_bytes () const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
size_t size () const
 
const std::vector< global_unit_t > & units () const
 
std::vector< global_unit_t > & units ()
 
global_unit_t leader_unit () const
 ID of leader unit in the locality domain. More...
 
int level () const
 
Scope_t scope () const
 
int node_id () const
 
int num_nodes () const
 
int num_cores () const
 
int global_index () const
 
int relative_index () const
 

Detailed Description

Wrapper of a single dart_domain_locality_t object.

Usage examples:

dash::util::LocalityDomain & domain = team_locality.domain();
// Leader unit in second subdomain:
global_unit_t leader_id = domain[1].leader_unit();
// Unit locality data of leader unit:
dash::util::UnitLocality & leader_loc = domain[1].unit_locality(leader_id);
auto leader_ncores = leader_loc.num_cores();
domain.split_groups(dash::util::Locality::Scope::Module);
for (auto part : domain.groups()) {
// Iterate over all domains in Module locality scope
}

Definition at line 154 of file LocalityDomain.h.

Member Function Documentation

◆ at() [1/2]

const self_t& dash::util::LocalityDomain::at ( int  relative_index) const

Lazy-load instance of LocalityDomain for child subdomain at relative index.

◆ at() [2/2]

self_t& dash::util::LocalityDomain::at ( int  relative_index)

Lazy-load instance of LocalityDomain for child subdomain at relative index.

◆ exclude()

self_t& dash::util::LocalityDomain::exclude ( const std::vector< std::string > &  subdomain_tags)

Remove subdomains that match the specified domain tags or are a subdomain of a matched domain.

Referenced by dash::util::TeamLocality::parts().

◆ find() [1/2]

const_iterator dash::util::LocalityDomain::find ( const std::string &  subdomain_tag) const

Find locality subdomain with specified domain tag.

◆ find() [2/2]

iterator dash::util::LocalityDomain::find ( const std::string &  subdomain_tag)

Find locality subdomain with specified domain tag.

◆ group()

self_t& dash::util::LocalityDomain::group ( const std::vector< std::string > &  group_subdomain_tags)

Add a group subdomain consisting of domains with the specified tags.

Referenced by dash::util::TeamLocality::parts().

◆ leader_unit()

global_unit_t dash::util::LocalityDomain::leader_unit ( ) const
inline

ID of leader unit in the locality domain.

Definition at line 439 of file LocalityDomain.h.

References dash::find(), dart_domain_locality_s::global_index, dash::init(), dart_domain_locality_s::level, and dart_domain_locality_s::scope.

440  {
441  // TODO: Optimize
442 
443  // Unit 0 is default leader if contained in the domain:
444  if (std::find(_unit_ids.begin(), _unit_ids.end(), global_unit_t(0))
445  != _unit_ids.end()) {
446  return global_unit_t(0);
447  }
448  return _unit_ids.front();
449  }
struct dash::unit_id< dash::global_unit, dart_global_unit_t > global_unit_t
Unit ID to use for global IDs.
Definition: Types.h:332
GlobIter find(GlobIter first, GlobIter last, const ElementType &value)
Returns an iterator to the first element in the range [first,last) that compares equal to val...
Definition: Find.h:22

◆ select()

self_t& dash::util::LocalityDomain::select ( const std::vector< std::string > &  subdomain_tags)

Remove subdomains that do not match one of the specified domain tags and are not a subdomain of a matched domain.

Referenced by dash::util::TeamLocality::parts().

◆ split()

self_t& dash::util::LocalityDomain::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.

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

Referenced by dash::util::TeamLocality::split().

◆ split_groups()

self_t& dash::util::LocalityDomain::split_groups ( )

Split groups in locality domain into separate parts.

Referenced by dash::util::TeamLocality::split_groups().


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