Skip to content

Commit a92d9e2

Browse files
committed
WIP: Make more Teams const
1 parent 25eb93a commit a92d9e2

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

dash/include/dash/TeamSpec.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class TeamSpec :
4848
* dimension.
4949
*/
5050
TeamSpec(
51-
Team & team = dash::Team::All())
51+
const Team & team = dash::Team::All())
5252
: _is_linear(true),
5353
_myid(team.myid())
5454
{
@@ -88,7 +88,7 @@ class TeamSpec :
8888
TeamSpec(
8989
const self_t & other,
9090
const DistributionSpec<MaxDimensions> & distribution,
91-
Team & team = dash::Team::All())
91+
const Team & team = dash::Team::All())
9292
: CartesianIndexSpace<MaxDimensions, ROW_MAJOR, IndexType>(
9393
other.extents()),
9494
_myid(team.myid())
@@ -142,7 +142,7 @@ class TeamSpec :
142142
*/
143143
TeamSpec(
144144
const DistributionSpec<MaxDimensions> & distribution,
145-
Team & team = dash::Team::All())
145+
const Team & team = dash::Team::All())
146146
: _myid(team.myid())
147147
{
148148
DASH_LOG_TRACE_VAR("TeamSpec(dist, t)", team.is_null());

dash/include/dash/algorithm/Transform.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ GlobOutputIt transform(
325325
}
326326
#endif
327327
// Resolve teams from global iterators:
328-
dash::Team & team_in_a = pattern_in_a.team();
328+
const dash::Team & team_in_a = pattern_in_a.team();
329329
DASH_ASSERT_MSG(
330330
team_in_a == pattern_in_b.team(),
331331
"dash::transform: Different teams in input ranges");

dash/include/dash/pattern/LoadBalancePattern.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ class LoadBalancePattern<
997997
* The Team containing the units to which this pattern's elements are
998998
* mapped.
999999
*/
1000-
inline dash::Team & team() const
1000+
inline const dash::Team & team() const
10011001
{
10021002
return *_team;
10031003
}
@@ -1292,11 +1292,11 @@ class LoadBalancePattern<
12921292
/// Distribution types of all dimensions.
12931293
DistributionSpec_t _distspec;
12941294
/// Team containing the units to which the patterns element are mapped
1295-
dash::Team * _team = nullptr;
1295+
const dash::Team * _team = nullptr;
12961296
/// The active unit's id.
12971297
team_unit_t _myid;
12981298
/// Cartesian arrangement of units within the team
1299-
TeamSpec_t _teamspec;
1299+
const TeamSpec_t _teamspec;
13001300
/// Total amount of units to which this pattern's elements are mapped
13011301
SizeType _nunits = 0;
13021302
/// Actual number of local elements of the active unit.

dash/include/dash/util/TeamLocality.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class TeamLocality
7272
* locality domain of a specified team.
7373
*/
7474
TeamLocality(
75-
dash::Team & team,
75+
const dash::Team & team,
7676
Scope_t scope = Scope_t::Global,
7777
std::string domain_tag = ".");
7878

@@ -81,7 +81,7 @@ class TeamLocality
8181
* a specified team and locality domain.
8282
*/
8383
TeamLocality(
84-
dash::Team & team,
84+
const dash::Team & team,
8585
LocalityDomain_t & domain);
8686

8787
/**
@@ -190,7 +190,7 @@ class TeamLocality
190190
return _domain.num_cores();
191191
}
192192

193-
inline dash::Team & team() const
193+
inline const dash::Team & team() const
194194
{
195195
return (nullptr == _team) ? dash::Team::Null() : *_team;
196196
}
@@ -235,7 +235,7 @@ class TeamLocality
235235
}
236236

237237
private:
238-
dash::Team * _team = nullptr;
238+
const dash::Team * _team = nullptr;
239239
/// Parent scope of the team locality domain hierarchy.
240240
Scope_t _scope = Scope_t::Undefined;
241241
/// Locality domain of the team.

dash/src/util/TeamLocality.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
dash::util::TeamLocality::TeamLocality(
17-
dash::Team & team,
17+
const dash::Team & team,
1818
dash::util::Locality::Scope scope,
1919
std::string domain_tag)
2020
: _team(&team),
@@ -44,7 +44,7 @@ dash::util::TeamLocality::TeamLocality(
4444
}
4545

4646
dash::util::TeamLocality::TeamLocality(
47-
dash::Team & team,
47+
const dash::Team & team,
4848
dash::util::LocalityDomain & domain)
4949
: _team(&team),
5050
_scope(domain.scope()),

0 commit comments

Comments
 (0)