Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Make more Teams const #696

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dash/include/dash/TeamSpec.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class TeamSpec :
* dimension.
*/
TeamSpec(
Team & team = dash::Team::All())
const Team & team = dash::Team::All())
: _is_linear(true),
_myid(team.myid())
{
Expand Down Expand Up @@ -88,7 +88,7 @@ class TeamSpec :
TeamSpec(
const self_t & other,
const DistributionSpec<MaxDimensions> & distribution,
Team & team = dash::Team::All())
const Team & team = dash::Team::All())
: CartesianIndexSpace<MaxDimensions, ROW_MAJOR, IndexType>(
other.extents()),
_myid(team.myid())
Expand Down Expand Up @@ -142,7 +142,7 @@ class TeamSpec :
*/
TeamSpec(
const DistributionSpec<MaxDimensions> & distribution,
Team & team = dash::Team::All())
const Team & team = dash::Team::All())
: _myid(team.myid())
{
DASH_LOG_TRACE_VAR("TeamSpec(dist, t)", team.is_null());
Expand Down
2 changes: 1 addition & 1 deletion dash/include/dash/algorithm/Transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ GlobOutputIt transform(
}
#endif
// Resolve teams from global iterators:
dash::Team & team_in_a = pattern_in_a.team();
const dash::Team & team_in_a = pattern_in_a.team();
DASH_ASSERT_MSG(
team_in_a == pattern_in_b.team(),
"dash::transform: Different teams in input ranges");
Expand Down
6 changes: 3 additions & 3 deletions dash/include/dash/pattern/LoadBalancePattern.h
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ class LoadBalancePattern<
* The Team containing the units to which this pattern's elements are
* mapped.
*/
inline dash::Team & team() const
inline const dash::Team & team() const
{
return *_team;
}
Expand Down Expand Up @@ -1292,11 +1292,11 @@ class LoadBalancePattern<
/// Distribution types of all dimensions.
DistributionSpec_t _distspec;
/// Team containing the units to which the patterns element are mapped
dash::Team * _team = nullptr;
const dash::Team * _team = nullptr;
/// The active unit's id.
team_unit_t _myid;
/// Cartesian arrangement of units within the team
TeamSpec_t _teamspec;
const TeamSpec_t _teamspec;
/// Total amount of units to which this pattern's elements are mapped
SizeType _nunits = 0;
/// Actual number of local elements of the active unit.
Expand Down
8 changes: 4 additions & 4 deletions dash/include/dash/util/TeamLocality.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class TeamLocality
* locality domain of a specified team.
*/
TeamLocality(
dash::Team & team,
const dash::Team & team,
Scope_t scope = Scope_t::Global,
std::string domain_tag = ".");

Expand All @@ -81,7 +81,7 @@ class TeamLocality
* a specified team and locality domain.
*/
TeamLocality(
dash::Team & team,
const dash::Team & team,
LocalityDomain_t & domain);

/**
Expand Down Expand Up @@ -190,7 +190,7 @@ class TeamLocality
return _domain.num_cores();
}

inline dash::Team & team() const
inline const dash::Team & team() const
{
return (nullptr == _team) ? dash::Team::Null() : *_team;
}
Expand Down Expand Up @@ -235,7 +235,7 @@ class TeamLocality
}

private:
dash::Team * _team = nullptr;
const dash::Team * _team = nullptr;
/// Parent scope of the team locality domain hierarchy.
Scope_t _scope = Scope_t::Undefined;
/// Locality domain of the team.
Expand Down
4 changes: 2 additions & 2 deletions dash/src/util/TeamLocality.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


dash::util::TeamLocality::TeamLocality(
dash::Team & team,
const dash::Team & team,
dash::util::Locality::Scope scope,
std::string domain_tag)
: _team(&team),
Expand Down Expand Up @@ -44,7 +44,7 @@ dash::util::TeamLocality::TeamLocality(
}

dash::util::TeamLocality::TeamLocality(
dash::Team & team,
const dash::Team & team,
dash::util::LocalityDomain & domain)
: _team(&team),
_scope(domain.scope()),
Expand Down