DASH
0.3.0
|
Irregular dynamic pattern. More...
#include <DynamicPattern.h>
Classes | |
struct | local_coords_t |
struct | local_index_t |
Public Types | |
typedef pattern_partitioning_properties< pattern_partitioning_tag::minimal, pattern_partitioning_tag::rectangular, pattern_partitioning_tag::balanced, pattern_partitioning_tag::unbalanced, pattern_partitioning_tag::dynamic > | partitioning_properties |
Satisfiable properties in pattern property category Partitioning: More... | |
typedef pattern_mapping_properties< pattern_mapping_tag::unbalanced > | mapping_properties |
Satisfiable properties in pattern property category Mapping: More... | |
typedef pattern_layout_properties< pattern_layout_tag::blocked, pattern_layout_tag::linear > | layout_properties |
Satisfiable properties in pattern property category Layout: More... | |
typedef IndexType | index_type |
typedef SizeType | size_type |
typedef ViewSpec_t | viewspec_type |
Public Member Functions | |
template<typename ... Args> | |
DynamicPattern (SizeType arg, Args &&... args) | |
Constructor, initializes a pattern from an argument list consisting of the pattern size (extent, number of elements) followed by an optional distribution type. More... | |
DynamicPattern (const SizeSpec_t &sizespec, const DistributionSpec_t &distspec, const TeamSpec_t &teamspec, Team &team=dash::Team::All()) | |
Constructor, initializes a pattern from explicit instances of SizeSpec , DistributionSpec , TeamSpec and Team . More... | |
DynamicPattern (const SizeSpec_t &sizespec, const DistributionSpec_t &distspec, Team &team=dash::Team::All()) | |
Constructor, initializes a pattern from explicit instances of SizeSpec , DistributionSpec and Team . More... | |
template<typename ... Args> | |
DynamicPattern (const std::vector< size_type > &local_sizes, SizeType arg, Args &&... args) | |
Constructor, initializes a pattern from an argument list consisting of the pattern size (extent, number of elements) followed by an optional distribution type. More... | |
DynamicPattern (const std::vector< size_type > &local_sizes, const TeamSpec_t &teamspec, dash::Team &team=dash::Team::All()) | |
Constructor, initializes a pattern from explicit instances of SizeSpec , DistributionSpec , TeamSpec and a Team . More... | |
DynamicPattern (const std::vector< size_type > &local_sizes, Team &team=dash::Team::All()) | |
Constructor, initializes a pattern from explicit instances of SizeSpec , DistributionSpec , TeamSpec and a Team . More... | |
DynamicPattern (const self_t &other) | |
Copy constructor. More... | |
DynamicPattern (self_t &other) | |
Copy constructor using non-const lvalue reference parameter. More... | |
bool | operator== (const self_t &other) const |
Equality comparison operator. More... | |
bool | operator!= (const self_t &other) const |
Inquality comparison operator. More... | |
self_t & | operator= (const self_t &other)=default |
Assignment operator. More... | |
IndexType | lbegin () const |
Resolves the global index of the first local element in the pattern. More... | |
IndexType | lend () const |
Resolves the global index past the last local element in the pattern. More... | |
void | local_resize (team_unit_t unit, size_type local_size) |
resize / balance More... | |
void | local_resize (size_type local_size) |
Update the number of local elements of the active unit. More... | |
void | balance () |
Balance the number of local elements across all units in the pattern's associated team. More... | |
team_unit_t | unit_at (const std::array< IndexType, NumDimensions > &coords, const ViewSpec_t &viewspec) const |
unit_at More... | |
team_unit_t | unit_at (const std::array< IndexType, NumDimensions > &g_coords) const |
Convert given coordinate in pattern to its assigned unit id. More... | |
team_unit_t | unit_at (IndexType global_pos, const ViewSpec_t &viewspec) const |
Convert given global linear index to its assigned unit id. More... | |
team_unit_t | unit_at (IndexType g_index) const |
Convert given global linear index to its assigned unit id. More... | |
IndexType | extent (dim_t dim) const |
extent More... | |
IndexType | local_extent (dim_t dim) const |
The actual number of elements in this pattern that are local to the calling unit in the given dimension. More... | |
std::array< SizeType, NumDimensions > | local_extents (team_unit_t unit) const |
The actual number of elements in this pattern that are local to the given unit, by dimension. More... | |
IndexType | local_at (const std::array< IndexType, NumDimensions > &local_coords, const ViewSpec_t &viewspec) const |
local More... | |
IndexType | local_at (const std::array< IndexType, NumDimensions > &local_coords) const |
Convert given local coordinates to linear local offset (index). More... | |
local_coords_t | local (const std::array< IndexType, NumDimensions > &g_coords) const |
Converts global coordinates to their associated unit and its respective local coordinates. More... | |
local_index_t | local (IndexType g_index) const |
Converts global index to its associated unit and respective local index. More... | |
std::array< IndexType, NumDimensions > | local_coords (const std::array< IndexType, NumDimensions > &g_coords) const |
Converts global coordinates to their associated unit's respective local coordinates. More... | |
local_index_t | local_index (const std::array< IndexType, NumDimensions > &g_coords) const |
Converts global coordinates to their associated unit and their respective local index. More... | |
std::array< IndexType, NumDimensions > | global (team_unit_t unit, const std::array< IndexType, NumDimensions > &local_coords) const |
global More... | |
std::array< IndexType, NumDimensions > | global (const std::array< IndexType, NumDimensions > &l_coords) const |
Converts local coordinates of active unit to global coordinates. More... | |
IndexType | global (team_unit_t unit, IndexType l_index) const |
Resolve an element's linear global index from the given unit's local index of that element. More... | |
IndexType | global (IndexType l_index) const |
Resolve an element's linear global index from the calling unit's local index of that element. More... | |
IndexType | global_index (team_unit_t unit, const std::array< IndexType, NumDimensions > &l_coords) const |
Resolve an element's linear global index from a given unit's local coordinates of that element. More... | |
IndexType | at (const std::array< IndexType, NumDimensions > &g_coords) const |
at More... | |
IndexType | at (const std::array< IndexType, NumDimensions > &g_coords, const ViewSpec_t &viewspec) const |
Global coordinates and viewspec to local index. More... | |
template<typename ... Values> | |
IndexType | at (IndexType value, Values ... values) const |
Global coordinates to local index. More... | |
bool | has_local_elements (dim_t dim, IndexType dim_offset, team_unit_t unit, const ViewSpec_t &viewspec) const |
is_local More... | |
bool | is_local (IndexType index, team_unit_t unit) const |
Whether the given global index is local to the specified unit. More... | |
bool | is_local (IndexType index) const |
Whether the given global index is local to the unit that created this pattern instance. More... | |
const BlockSpec_t & | blockspec () const |
block More... | |
index_type | block_at (const std::array< index_type, NumDimensions > &g_coords) const |
Index of block at given global coordinates. More... | |
ViewSpec_t | block (index_type g_block_index) const |
View spec (offset and extents) of block at global linear block index in cartesian element space. More... | |
ViewSpec_t | local_block (index_type l_block_index) const |
View spec (offset and extents) of block at local linear block index in global cartesian element space. More... | |
ViewSpec_t | local_block_local (index_type l_block_index) const |
View spec (offset and extents) of block at local linear block index in local cartesian element space. More... | |
SizeType | blocksize (dim_t dimension) const |
Maximum number of elements in a single block in the given dimension. More... | |
SizeType | max_blocksize () const |
Maximum number of elements in a single block in all dimensions. More... | |
SizeType | local_capacity (team_unit_t unit=UNDEFINED_TEAM_UNIT_ID) const |
Maximum number of elements assigned to a single unit in total, equivalent to the local capacity of every unit in this pattern. More... | |
SizeType | local_size (team_unit_t unit=UNDEFINED_TEAM_UNIT_ID) const |
The actual number of elements in this pattern that are local to the calling unit in total. More... | |
IndexType | num_units () const |
The number of units to which this pattern's elements are mapped. More... | |
IndexType | capacity () const |
The maximum number of elements arranged in this pattern. More... | |
IndexType | size () const |
The number of elements arranged in this pattern. More... | |
dash::Team & | team () const |
The Team containing the units to which this pattern's elements are mapped. More... | |
const DistributionSpec_t & | distspec () const |
Distribution specification of this pattern. More... | |
SizeSpec_t | sizespec () const |
Size specification of the index space mapped by this pattern. More... | |
const std::array< SizeType, NumDimensions > & | extents () const |
Size specification of the index space mapped by this pattern. More... | |
const TeamSpec_t & | teamspec () const |
Cartesian arrangement of the Team containing the units to which this pattern's elements are mapped. More... | |
std::array< IndexType, NumDimensions > | coords (IndexType index) const |
Convert given global linear offset (index) to global cartesian coordinates. More... | |
std::array< IndexType, NumDimensions > | coords (IndexType index, const ViewSpec_t &viewspec) const |
Convert given global linear offset (index) to global cartesian coordinates using viewspec. More... | |
Static Public Member Functions | |
static constexpr MemArrange | memory_order () |
Memory order followed by the pattern. More... | |
static constexpr dim_t | ndim () |
Number of dimensions of the cartesian space partitioned by the pattern. More... | |
Static Public Attributes | |
static constexpr char const * | PatternName = "DynamicPattern1D" |
Irregular dynamic pattern.
Specialization for 1-dimensional data.
Definition at line 46 of file DynamicPattern.h.
typedef pattern_layout_properties< pattern_layout_tag::blocked, pattern_layout_tag::linear > dash::DynamicPattern< 1, Arrangement, IndexType >::layout_properties |
Satisfiable properties in pattern property category Layout:
Definition at line 81 of file DynamicPattern.h.
typedef pattern_mapping_properties< pattern_mapping_tag::unbalanced > dash::DynamicPattern< 1, Arrangement, IndexType >::mapping_properties |
Satisfiable properties in pattern property category Mapping:
Definition at line 73 of file DynamicPattern.h.
typedef pattern_partitioning_properties< pattern_partitioning_tag::minimal, pattern_partitioning_tag::rectangular, pattern_partitioning_tag::balanced, pattern_partitioning_tag::unbalanced, pattern_partitioning_tag::dynamic > dash::DynamicPattern< 1, Arrangement, IndexType >::partitioning_properties |
Satisfiable properties in pattern property category Partitioning:
Definition at line 68 of file DynamicPattern.h.
|
inline |
Constructor, initializes a pattern from an argument list consisting of the pattern size (extent, number of elements) followed by an optional distribution type.
arg | Argument list consisting of the pattern size (extent, number of elements) in every dimension followed by optional distribution types. |
args | Argument list consisting of the pattern size (extent, number of elements) in every dimension followed by optional distribution types. |
Definition at line 128 of file DynamicPattern.h.
|
inline |
Constructor, initializes a pattern from explicit instances of SizeSpec
, DistributionSpec
, TeamSpec
and Team
.
sizespec | Size spec of the pattern. |
distspec | Distribution spec. |
teamspec | Cartesian arrangement of units within the team |
team | Team containing units to which this pattern maps its elements. |
Definition at line 154 of file DynamicPattern.h.
|
inline |
Constructor, initializes a pattern from explicit instances of SizeSpec
, DistributionSpec
and Team
.
sizespec | Size spec of the pattern. |
distspec | Distribution spec. |
team | Team containing units to which this pattern maps its elements. |
Definition at line 206 of file DynamicPattern.h.
|
inline |
Constructor, initializes a pattern from an argument list consisting of the pattern size (extent, number of elements) followed by an optional distribution type.
local_sizes | Number of local elements for every unit in the active team. |
arg | Argument list consisting of the pattern size (extent, number of elements) in every dimension followed by optional distribution types. |
args | Argument list consisting of the pattern size (extent, number of elements) in every dimension followed by optional distribution types. |
Definition at line 255 of file DynamicPattern.h.
|
inline |
Constructor, initializes a pattern from explicit instances of SizeSpec
, DistributionSpec
, TeamSpec
and a Team
.
local_sizes | Number of local elements for every unit in the active team. |
teamspec | Cartesian arrangement of units within the team |
team | Team containing units to which this pattern maps its elements |
Definition at line 282 of file DynamicPattern.h.
|
inline |
Constructor, initializes a pattern from explicit instances of SizeSpec
, DistributionSpec
, TeamSpec
and a Team
.
local_sizes | Number of local elements for every unit in the active team. |
team | Team containing units to which this pattern maps its elements |
Definition at line 330 of file DynamicPattern.h.
|
inline |
|
inline |
Copy constructor using non-const lvalue reference parameter.
Introduced so variadic constructor is not a better match for copy-construction.
Definition at line 401 of file DynamicPattern.h.
|
inline |
at
Global coordinates to local index.
Convert given global coordinates in pattern to their respective linear local index.
Definition at line 882 of file DynamicPattern.h.
|
inline |
Global coordinates and viewspec to local index.
Convert given global coordinate in pattern to its linear local index.
Definition at line 895 of file DynamicPattern.h.
|
inline |
Global coordinates to local index.
Convert given coordinate in pattern to its linear local index.
Definition at line 912 of file DynamicPattern.h.
|
inline |
Balance the number of local elements across all units in the pattern's associated team.
Definition at line 487 of file DynamicPattern.h.
|
inline |
View spec (offset and extents) of block at global linear block index in cartesian element space.
Definition at line 1029 of file DynamicPattern.h.
|
inline |
Index of block at given global coordinates.
g_coords | Global coordinates of element |
Definition at line 1009 of file DynamicPattern.h.
|
inline |
Maximum number of elements in a single block in the given dimension.
dimension | The dimension in the pattern |
Definition at line 1085 of file DynamicPattern.h.
|
inline |
|
inline |
The maximum number of elements arranged in this pattern.
Definition at line 1148 of file DynamicPattern.h.
|
inline |
Convert given global linear offset (index) to global cartesian coordinates.
Definition at line 1217 of file DynamicPattern.h.
|
inline |
Convert given global linear offset (index) to global cartesian coordinates using viewspec.
Definition at line 1229 of file DynamicPattern.h.
|
inline |
Distribution specification of this pattern.
Definition at line 1175 of file DynamicPattern.h.
|
inline |
extent
The number of elements in this pattern in the given dimension.
Definition at line 592 of file DynamicPattern.h.
|
inline |
Size specification of the index space mapped by this pattern.
Definition at line 1195 of file DynamicPattern.h.
|
inline |
global
Converts local coordinates of a given unit to global coordinates.
Definition at line 798 of file DynamicPattern.h.
|
inline |
Converts local coordinates of active unit to global coordinates.
Definition at line 819 of file DynamicPattern.h.
References dash::global().
|
inline |
Resolve an element's linear global index from the given unit's local index of that element.
Definition at line 833 of file DynamicPattern.h.
|
inline |
Resolve an element's linear global index from the calling unit's local index of that element.
Definition at line 848 of file DynamicPattern.h.
References dash::global().
|
inline |
Resolve an element's linear global index from a given unit's local coordinates of that element.
Definition at line 862 of file DynamicPattern.h.
|
inline |
is_local
Whether there are local elements in a dimension at a given offset, e.g. in a specific row or column.
dim | Dimension to check |
dim_offset | Offset in dimension |
unit | DART id of the unit |
viewspec | Viewspec to apply |
Definition at line 933 of file DynamicPattern.h.
|
inline |
Whether the given global index is local to the specified unit.
Definition at line 960 of file DynamicPattern.h.
|
inline |
Whether the given global index is local to the unit that created this pattern instance.
Definition at line 979 of file DynamicPattern.h.
|
inline |
Resolves the global index of the first local element in the pattern.
Definition at line 448 of file DynamicPattern.h.
|
inline |
Resolves the global index past the last local element in the pattern.
Definition at line 458 of file DynamicPattern.h.
|
inline |
Converts global coordinates to their associated unit and its respective local coordinates.
NOTE: Same as local_index
.
Definition at line 679 of file DynamicPattern.h.
|
inline |
Converts global index to its associated unit and respective local index.
NOTE: Same as local_index
.
Definition at line 707 of file DynamicPattern.h.
|
inline |
local
Convert given local coordinates and viewspec to linear local offset (index).
local_coords | Point in local memory |
viewspec | View specification (offsets) to apply on coords |
Definition at line 650 of file DynamicPattern.h.
|
inline |
Convert given local coordinates to linear local offset (index).
local_coords | Point in local memory |
Definition at line 664 of file DynamicPattern.h.
|
inline |
View spec (offset and extents) of block at local linear block index in global cartesian element space.
Definition at line 1046 of file DynamicPattern.h.
|
inline |
View spec (offset and extents) of block at local linear block index in local cartesian element space.
Definition at line 1066 of file DynamicPattern.h.
|
inline |
Maximum number of elements assigned to a single unit in total, equivalent to the local capacity of every unit in this pattern.
Definition at line 1111 of file DynamicPattern.h.
|
inline |
Converts global coordinates to their associated unit's respective local coordinates.
Definition at line 741 of file DynamicPattern.h.
|
inline |
The actual number of elements in this pattern that are local to the calling unit in the given dimension.
Definition at line 612 of file DynamicPattern.h.
|
inline |
The actual number of elements in this pattern that are local to the given unit, by dimension.
Definition at line 632 of file DynamicPattern.h.
|
inline |
Converts global coordinates to their associated unit and their respective local index.
Definition at line 767 of file DynamicPattern.h.
|
inline |
resize / balance
Update the number of local elements of the specified unit.
Definition at line 470 of file DynamicPattern.h.
|
inline |
Update the number of local elements of the active unit.
Definition at line 478 of file DynamicPattern.h.
|
inline |
The actual number of elements in this pattern that are local to the calling unit in total.
Definition at line 1127 of file DynamicPattern.h.
|
inline |
Maximum number of elements in a single block in all dimensions.
Definition at line 1100 of file DynamicPattern.h.
|
inlinestatic |
Memory order followed by the pattern.
Definition at line 1240 of file DynamicPattern.h.
|
inlinestatic |
Number of dimensions of the cartesian space partitioned by the pattern.
Definition at line 1248 of file DynamicPattern.h.
References dash::global(), dash::max_element(), dash::size(), and dash::Team::size().
|
inline |
The number of units to which this pattern's elements are mapped.
Definition at line 1138 of file DynamicPattern.h.
|
inline |
Inquality comparison operator.
other | Pattern instance to compare for inequality |
Definition at line 431 of file DynamicPattern.h.
|
default |
Assignment operator.
|
inline |
Equality comparison operator.
other | Pattern instance to compare for equality |
Definition at line 408 of file DynamicPattern.h.
|
inline |
The number of elements arranged in this pattern.
Definition at line 1158 of file DynamicPattern.h.
|
inline |
Size specification of the index space mapped by this pattern.
Definition at line 1185 of file DynamicPattern.h.
|
inline |
The Team containing the units to which this pattern's elements are mapped.
Definition at line 1167 of file DynamicPattern.h.
|
inline |
Cartesian arrangement of the Team containing the units to which this pattern's elements are mapped.
Definition at line 1206 of file DynamicPattern.h.
|
inline |
unit_at
Convert given point in pattern to its assigned unit id.
coords | Absolute coordinates of the point |
viewspec | View specification (offsets) to apply on coords |
Definition at line 500 of file DynamicPattern.h.
|
inline |
Convert given coordinate in pattern to its assigned unit id.
Definition at line 519 of file DynamicPattern.h.
|
inline |
Convert given global linear index to its assigned unit id.
global_pos | Global linear element offset |
viewspec | View to apply global position |
Definition at line 539 of file DynamicPattern.h.
|
inline |
Convert given global linear index to its assigned unit id.
g_index | Global linear element offset |
Definition at line 564 of file DynamicPattern.h.