1 #ifndef DASH__UTIL__TEAM_LOCALITY_H__INCLUDED 2 #define DASH__UTIL__TEAM_LOCALITY_H__INCLUDED 4 #include <dash/util/Locality.h> 5 #include <dash/util/LocalityDomain.h> 6 #include <dash/util/UnitLocality.h> 11 #include <dash/algorithm/internal/String.h> 13 #include <dash/Exception.h> 14 #include <dash/Team.h> 18 #include <unordered_map> 65 typedef dash::util::Locality::Scope Scope_t;
76 Scope_t scope = Scope_t::Global,
77 std::string domain_tag =
".");
85 LocalityDomain_t &
domain);
100 self_t &
operator=(
const self_t & other) =
default;
105 inline const LocalityDomain_t &
domain()
const 136 inline self_t &
split(Scope_t scope,
int num_split_parts = 0)
138 _domain.
split(scope, num_split_parts);
154 inline std::vector<LocalityDomain_t::iterator> &
groups()
156 return _domain.groups();
162 inline const std::vector<LocalityDomain_t::iterator> &
groups()
const 164 return _domain.groups();
170 inline std::vector<LocalityDomain_t> &
parts()
172 return _domain.parts();
178 inline const std::vector<LocalityDomain_t> &
parts()
const 180 return _domain.parts();
183 inline size_t num_nodes()
const 185 return _domain.size();
188 inline size_t num_cores()
const 190 return _domain.num_cores();
198 inline const std::vector<global_unit_t> & global_units()
const 200 return _domain.units();
217 inline LocalityDomain_t & group(
218 const std::vector<std::string> & group_subdomain_tags)
220 return _domain.
group(group_subdomain_tags);
223 inline self_t & select(
224 const std::vector<std::string> & domain_tags)
226 _domain.
select(domain_tags);
230 inline self_t & exclude(
231 const std::vector<std::string> & domain_tags)
240 Scope_t _scope = Scope_t::Undefined;
242 LocalityDomain_t _domain;
249 #endif // DASH__UTIL__TEAM_LOCALITY_H__INCLUDED const LocalityDomain_t & domain() const
The team locality domain descriptor.
TeamLocality()=default
Default constructor.
This class is a simple memory pool which holds allocates elements of size ValueType.
const std::vector< LocalityDomain_t::iterator > & groups() const
Parts of the team locality that have been created in a previous split.
std::vector< LocalityDomain_t::iterator > & groups()
Parts of the team locality that resulted from a previous split.
self_t & split(Scope_t scope, int num_split_parts=0)
Split the team locality domain into the given number of parts on the specified locality scope...
struct dash::unit_id< dash::global_unit, dart_global_unit_t > global_unit_t
Unit ID to use for global IDs.
std::vector< LocalityDomain_t > & parts()
Parts of the team locality that resulted from a previous split.
self_t & operator=(const self_t &other)=default
Assignment operator.
self_t & group(const std::vector< std::string > &group_subdomain_tags)
Add a group subdomain consisting of domains with the specified tags.
A Team instance specifies a subset of all available units.
self_t & split_groups()
Split groups in locality domain into separate parts.
self_t & split_groups()
Split groups in locality domain into separate parts.
Hierarchical locality domains of a specified team.
struct dash::unit_id< dash::local_unit, dart_team_unit_t > team_unit_t
Unit ID to use for team-local IDs.
Wrapper of a single dart_domain_locality_t object.
const std::vector< LocalityDomain_t > & parts() const
Parts of the team locality that have been created in a previous split.
static Team & Null()
The invariant Team instance representing an undefined team.
dart_ret_t dart_team_unit_g2l(dart_team_t team, dart_global_unit_t globalid, dart_team_unit_t *localid)
Convert from a global to a local unit ID.
self_t & 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 mat...
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...
self_t & exclude(const std::vector< std::string > &subdomain_tags)
Remove subdomains that match the specified domain tags or are a subdomain of a matched domain...
LocalityDomain_t & domain()
The team locality domain descriptor.
dart_team_t dart_id() const
Index of this team relative to global team dash::Team::All().
Wrapper of a single dart_unit_locality_t object.