DASH
0.3.0
|
Specifies the arrangement of team units in a specified number of dimensions. More...
#include <TeamSpec.h>
Public Types | |
typedef IndexType | index_type |
typedef SizeType | size_type |
typedef std::array< SizeType, NumDimensions > | extents_type |
typedef std::integral_constant< dim_t, NumDimensions > | ndim |
The number of dimension in the cartesian space. More... | |
Public Member Functions | |
TeamSpec (Team &team=dash::Team::All()) | |
Constructor, creates an instance of TeamSpec from a team (set of units) with all team units organized linearly in the first dimension. More... | |
TeamSpec (const self_t &other, const DistributionSpec< MaxDimensions > &distribution, Team &team=dash::Team::All()) | |
Constructor, creates an instance of TeamSpec with given extents from a team (set of units) and a distribution spec. More... | |
TeamSpec (const DistributionSpec< MaxDimensions > &distribution, Team &team=dash::Team::All()) | |
Constructor, creates an instance of TeamSpec from a team (set of units) and a distribution spec. More... | |
template<typename ... Types> | |
TeamSpec (SizeType value, Types ... values) | |
Constructor, initializes new instance of TeamSpec with extents specified in argument list. More... | |
TeamSpec (const std::array< SizeType, MaxDimensions > &extents) | |
Constructor, initializes new instance of TeamSpec with extents specified in array by dimension. More... | |
void | balance_extents () |
Tries to equally distribute the units across the dimensions. More... | |
team_unit_t | neighbor (std::initializer_list< int > offsets) const |
Resolve unit id at given offset in Cartesian team grid relative to the active unit's position in the team. More... | |
team_unit_t | neighbor (const std::array< int, MaxDimensions > &offsets) const |
team_unit_t | periodic_neighbor (std::initializer_list< int > offsets) const |
Resolve unit id at given offset in Cartesian team grid relative to the active unit's position in the team. More... | |
team_unit_t | periodic_neighbor (const std::array< int, MaxDimensions > &offsets) const |
bool | includes_index (IndexType index, dim_t dimension, IndexType dim_offset) const |
Whether the given index lies in the cartesian sub-space specified by a dimension and offset in the dimension. More... | |
SizeType | num_units (dim_t dimension) const |
The number of units (extent) available in the given dimension. More... | |
template<typename... Args> | |
void | resize (SizeType arg, Args... args) |
Change the extent of the cartesian space in every dimension. More... | |
template<typename SizeType_ > | |
void | resize (const std::array< SizeType_, MaxDimensions > &extents) |
Change the extent of the cartesian space in every dimension. More... | |
void | resize_dim (dim_t dim, SizeType extent) |
Change the extent of the cartesian space in the given dimension. More... | |
dim_t | rank () const |
The actual number of dimensions with extent greater than 1 in this team arragement, that is the dimension of the vector space spanned by the team arrangement's extents. More... | |
bool | operator== (const self_t &other) const |
Equality comparison operator. More... | |
constexpr bool | operator!= (const self_t &other) const |
Inequality comparison operator. More... | |
void | resize (const std::array< SizeType_, NumDimensions > &extents) |
Change the extent of the cartesian space in every dimension. More... | |
void | resize (dim_t dim, SizeType extent) |
Change the extent of the cartesian space in the given dimension. More... | |
constexpr SizeType | size () const noexcept |
The number of discrete elements within the space spanned by the coordinate. More... | |
constexpr const extents_type & | extents () const noexcept |
Extents of the cartesian space, by dimension. More... | |
SizeType | extent (dim_t dim) const |
The extent of the cartesian space in the given dimension. More... | |
constexpr IndexType | at (IndexType arg, Args... args) const |
Convert the given coordinates to their respective linear index. More... | |
IndexType | at (const std::array< OffsetType, NumDimensions > &point) const |
Convert the given cartesian point to its respective linear index. More... | |
IndexType | at (const std::array< OffsetType, NumDimensions > &point, const ViewSpec_t &viewspec) const |
Convert the given cartesian point to a linear index, respective to the offsets specified in the given ViewSpec. More... | |
std::array< IndexType, NumDimensions > | coords (IndexType index) const |
Convert given linear offset (index) to cartesian coordinates. More... | |
std::array< IndexType, NumDimensions > | coords (IndexType index, const ViewSpec_t &viewspec) const |
Convert given linear offset (index) to cartesian coordinates with respect to a given viewspec. More... | |
constexpr std::enable_if<(U > 0), SizeType >::type | x (SizeType offs) const |
Accessor for dimension 1 (x), enabled for dimensionality > 0. More... | |
constexpr std::enable_if<(U > 1), SizeType >::type | y (SizeType offs) const |
Accessor for dimension 2 (y), enabled for dimensionality > 1. More... | |
constexpr std::enable_if<(U > 2), SizeType >::type | z (SizeType offs) const |
Accessor for dimension 3 (z), enabled for dimensionality > 2. More... | |
Specifies the arrangement of team units in a specified number of dimensions.
Size of TeamSpec implies the number of units in the team.
Reoccurring units are currently not supported.
NumDimensions | Number of dimensions |
Definition at line 33 of file TeamSpec.h.
|
inherited |
The number of dimension in the cartesian space.
Definition at line 279 of file Cartesian.h.
|
inline |
Constructor, creates an instance of TeamSpec from a team (set of units) with all team units organized linearly in the first dimension.
Definition at line 50 of file TeamSpec.h.
|
inline |
Constructor, creates an instance of TeamSpec with given extents from a team (set of units) and a distribution spec.
The number of elements in the distribution different from NONE must be equal to the rank of the extents.
This constructor adjusts extents according to given distribution spec if the passed team spec has been default constructed.
Example:
Definition at line 88 of file TeamSpec.h.
|
inline |
Constructor, creates an instance of TeamSpec from a team (set of units) and a distribution spec.
All but one element in the distribution spec must be NONE
.
Definition at line 143 of file TeamSpec.h.
|
inline |
Constructor, initializes new instance of TeamSpec with extents specified in argument list.
Example:
Definition at line 193 of file TeamSpec.h.
|
inline |
Constructor, initializes new instance of TeamSpec with extents specified in array by dimension.
Example:
Definition at line 213 of file TeamSpec.h.
|
inlineinherited |
Convert the given coordinates to their respective linear index.
args | An argument list consisting of the coordinates, ordered by, dimension (x, y, z, ...) |
Definition at line 429 of file Cartesian.h.
Referenced by dash::TeamSpec< NumDimensions, IndexType >::neighbor(), and dash::TeamSpec< NumDimensions, IndexType >::periodic_neighbor().
|
inlineinherited |
Convert the given cartesian point to its respective linear index.
point | An array containing the coordinates, ordered by dimension (x, y, z, ...) |
Definition at line 449 of file Cartesian.h.
|
inlineinherited |
Convert the given cartesian point to a linear index, respective to the offsets specified in the given ViewSpec.
point | An array containing the coordinates, ordered by dimension (x, y, z, ...) |
viewspec | An instance of ViewSpec to apply to the given point before resolving the linear index. |
Definition at line 482 of file Cartesian.h.
|
inline |
Tries to equally distribute the units across the dimensions.
The number of units is determined by the current state of the extents.
Example:
Definition at line 234 of file TeamSpec.h.
|
inlineinherited |
Convert given linear offset (index) to cartesian coordinates.
Inverse of at
(...).
Definition at line 497 of file Cartesian.h.
Referenced by dash::TeamSpec< NumDimensions, IndexType >::neighbor(), and dash::TeamSpec< NumDimensions, IndexType >::periodic_neighbor().
|
inlineinherited |
Convert given linear offset (index) to cartesian coordinates with respect to a given viewspec.
Inverse of at
(...).
Definition at line 526 of file Cartesian.h.
|
inlineinherited |
The extent of the cartesian space in the given dimension.
dim | The dimension in the coordinate |
Definition at line 412 of file Cartesian.h.
Referenced by dash::TeamSpec< NumDimensions, IndexType >::num_units(), and dash::TeamSpec< NumDimensions, IndexType >::resize_dim().
|
inlinenoexceptinherited |
Extents of the cartesian space, by dimension.
Definition at line 402 of file Cartesian.h.
Referenced by dash::TeamSpec< NumDimensions, IndexType >::resize().
|
inline |
Whether the given index lies in the cartesian sub-space specified by a dimension and offset in the dimension.
Definition at line 385 of file TeamSpec.h.
|
inline |
Resolve unit id at given offset in Cartesian team grid relative to the active unit's position in the team.
Example:
Definition at line 298 of file TeamSpec.h.
Referenced by dash::TeamSpec< NumDimensions, IndexType >::neighbor().
|
inline |
The number of units (extent) available in the given dimension.
dimension | The dimension |
Definition at line 403 of file TeamSpec.h.
Referenced by dash::TeamSpec< NumDimensions, IndexType >::balance_extents().
|
inlineinherited |
Inequality comparison operator.
Definition at line 342 of file Cartesian.h.
|
inlineinherited |
|
inline |
Resolve unit id at given offset in Cartesian team grid relative to the active unit's position in the team.
Offsets wrap around in every dimension as in a torus topology.
Example:
Definition at line 350 of file TeamSpec.h.
Referenced by dash::TeamSpec< NumDimensions, IndexType >::periodic_neighbor().
|
inline |
The actual number of dimensions with extent greater than 1 in this team arragement, that is the dimension of the vector space spanned by the team arrangement's extents.
Example:
Definition at line 454 of file TeamSpec.h.
|
inlineinherited |
Change the extent of the cartesian space in every dimension.
Definition at line 363 of file Cartesian.h.
|
inlineinherited |
Change the extent of the cartesian space in the given dimension.
Definition at line 384 of file Cartesian.h.
|
inline |
Change the extent of the cartesian space in every dimension.
Definition at line 412 of file TeamSpec.h.
Referenced by dash::TeamSpec< NumDimensions, IndexType >::balance_extents(), dash::make_team_spec(), dash::TeamSpec< NumDimensions, IndexType >::resize(), dash::TeamSpec< NumDimensions, IndexType >::resize_dim(), and dash::TeamSpec< NumDimensions, IndexType >::TeamSpec().
|
inline |
Change the extent of the cartesian space in every dimension.
Definition at line 426 of file TeamSpec.h.
|
inline |
Change the extent of the cartesian space in the given dimension.
Definition at line 436 of file TeamSpec.h.
|
inlinenoexceptinherited |
The number of discrete elements within the space spanned by the coordinate.
Definition at line 395 of file Cartesian.h.
Referenced by dash::TeamSpec< NumDimensions, IndexType >::balance_extents(), dash::TeamSpec< NumDimensions, IndexType >::includes_index(), dash::make_team_spec(), and dash::TeamSpec< NumDimensions, IndexType >::TeamSpec().
|
inlineinherited |
Accessor for dimension 1 (x), enabled for dimensionality > 0.
Definition at line 591 of file Cartesian.h.
|
inlineinherited |
Accessor for dimension 2 (y), enabled for dimensionality > 1.
Definition at line 600 of file Cartesian.h.
|
inlineinherited |
Accessor for dimension 3 (z), enabled for dimensionality > 2.
Definition at line 609 of file Cartesian.h.