DASH
0.3.0
|
Defines how a list of global indices is mapped to single units within a Team. More...
#include <BlockPattern.h>
Classes | |
struct | local_coords_t |
struct | local_index_t |
Public Types | |
typedef pattern_partitioning_properties< pattern_partitioning_tag::rectangular, pattern_partitioning_tag::balanced, pattern_partitioning_tag::unbalanced > | 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::canonical, 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> | |
BlockPattern (SizeType arg, Args &&... args) | |
Constructor, initializes a pattern from an argument list consisting of the pattern size (extent, number of elements) in every dimension followed by optional distribution types. More... | |
BlockPattern (const SizeSpec_t &sizespec, DistributionSpec_t dist, 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... | |
BlockPattern (const SizeSpec_t &sizespec, DistributionSpec_t dist=DistributionSpec_t(), Team &team=dash::Team::All()) | |
Constructor, initializes a pattern from explicit instances of SizeSpec , DistributionSpec and a Team . More... | |
BlockPattern (const self_t &other) | |
Copy constructor. More... | |
BlockPattern (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... | |
BlockPattern & | operator= (const BlockPattern &other) |
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... | |
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 > &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 global_pos) 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... | |
constexpr std::array< SizeType, NumDimensions > | local_extents () const noexcept |
The actual number of elements in this pattern that are local to the active unit, by dimension. More... | |
constexpr std::array< SizeType, NumDimensions > | local_extents (team_unit_t unit) const noexcept |
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... | |
constexpr 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 > &global_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 > &global_coords) const |
Converts global coordinates to their associated unit's respective local coordinates. More... | |
local_index_t | local_index (const std::array< IndexType, NumDimensions > &global_coords) const |
Resolves the unit and the local index from global coordinates. 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 > &local_coords) const |
Converts local coordinates of active unit to global coordinates. More... | |
IndexType | global (IndexType local_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 > &local_coords) const |
Resolve an element's linear global index from a given unit's local coordinates of that element. More... | |
IndexType | global_at (const std::array< IndexType, NumDimensions > &view_coords, const ViewSpec_t &viewspec) const |
Global coordinates and viewspec to global position in the pattern's iteration order. More... | |
IndexType | global_at (const std::array< IndexType, NumDimensions > &global_coords) const |
Global coordinates to global position in the pattern's iteration order. More... | |
IndexType | at (const std::array< IndexType, NumDimensions > &global_coords) const |
at More... | |
IndexType | at (const std::array< IndexType, NumDimensions > &global_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... | |
constexpr bool | is_local (IndexType index) const noexcept |
Whether the given global index is local to the unit that created this pattern instance. More... | |
constexpr const BlockSpec_t & | blockspec () const noexcept |
block More... | |
constexpr const BlockSpec_t & | local_blockspec () const noexcept |
Cartesian arrangement of local pattern blocks. More... | |
index_type | block_at (const std::array< index_type, NumDimensions > &g_coords) const |
Index of block at given global coordinates. More... | |
local_index_t | local_block_at (const std::array< index_type, NumDimensions > &g_coords) const |
Unit and local block index at given global coordinates. More... | |
ViewSpec_t | block (index_type global_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 local_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 local_block_index) const |
View spec (offset and extents) of block at local linear block index in local cartesian element space. More... | |
constexpr SizeType | blocksize (dim_t dimension) const noexcept |
Maximum number of elements in a single block in the given dimension. More... | |
constexpr SizeType | max_blocksize () const noexcept |
Maximum number of elements in a single block in all dimensions. More... | |
constexpr SizeType | local_capacity () const noexcept |
Maximum number of elements assigned to a single unit in total, equivalent to the local capacity of every unit in this pattern. More... | |
constexpr SizeType | local_size (team_unit_t unit=UNDEFINED_TEAM_UNIT_ID) const noexcept |
The actual number of elements in this pattern that are local to the calling unit in total. More... | |
constexpr IndexType | num_units () const noexcept |
The number of units to which this pattern's elements are mapped. More... | |
constexpr IndexType | capacity () const noexcept |
The maximum number of elements arranged in this pattern. More... | |
constexpr IndexType | size () const noexcept |
The number of elements arranged in this pattern. More... | |
constexpr dash::Team & | team () const noexcept |
The Team containing the units to which this pattern's elements are mapped. More... | |
constexpr const DistributionSpec_t & | distspec () const noexcept |
Distribution specification of this pattern. More... | |
constexpr SizeSpec_t | sizespec () const noexcept |
Size specification of the index space mapped by this pattern. More... | |
constexpr const std::array< SizeType, NumDimensions > & | extents () const noexcept |
Size specification of the index space mapped by this pattern. More... | |
constexpr const TeamSpec_t & | teamspec () const noexcept |
Cartesian arrangement of the Team containing the units to which this pattern's elements are mapped. More... | |
constexpr std::array< IndexType, NumDimensions > | coords (IndexType index) const noexcept |
Convert given global linear offset (index) to global cartesian coordinates. More... | |
constexpr std::array< IndexType, NumDimensions > | coords (IndexType index, const ViewSpec_t &viewspec) const noexcept |
Convert given global linear offset (index) and viewspec to global cartesian coordinates. More... | |
SizeType | underfilled_blocksize (dim_t dimension) const |
Number of elements missing in the overflow block of given dimension compared to the regular blocksize (. More... | |
Static Public Member Functions | |
static constexpr MemArrange | memory_order () noexcept |
Memory order followed by the pattern. More... | |
static constexpr dim_t | ndim () noexcept |
Number of dimensions of the cartesian space partitioned by the pattern. More... | |
Static Public Attributes | |
static constexpr const char * | PatternName = "BlockPattern" |
Defines how a list of global indices is mapped to single units within a Team.
NumDimensions | The number of dimensions of the pattern |
Arrangement | The memory order of the pattern (ROW_MAJOR or COL_MAJOR), defaults to ROW_MAJOR. Memory order defines how elements in the pattern will be iterated predominantly |
Definition at line 42 of file BlockPattern.h.
typedef pattern_layout_properties< pattern_layout_tag::canonical, pattern_layout_tag::linear > dash::BlockPattern< NumDimensions, Arrangement, IndexType >::layout_properties |
Satisfiable properties in pattern property category Layout:
Definition at line 69 of file BlockPattern.h.
typedef pattern_mapping_properties< pattern_mapping_tag::unbalanced > dash::BlockPattern< NumDimensions, Arrangement, IndexType >::mapping_properties |
Satisfiable properties in pattern property category Mapping:
Definition at line 61 of file BlockPattern.h.
typedef pattern_partitioning_properties< pattern_partitioning_tag::rectangular, pattern_partitioning_tag::balanced, pattern_partitioning_tag::unbalanced > dash::BlockPattern< NumDimensions, Arrangement, IndexType >::partitioning_properties |
Satisfiable properties in pattern property category Partitioning:
Definition at line 56 of file BlockPattern.h.
|
inline |
Constructor, initializes a pattern from an argument list consisting of the pattern size (extent, number of elements) in every dimension followed by optional distribution types.
Examples:
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 180 of file BlockPattern.h.
Referenced by dash::BlockPattern< 1, Arrangement, IndexType >::BlockPattern(), dash::BlockPattern< 1, Arrangement, IndexType >::underfilled_blocksize(), and dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::underfilled_blocksize().
|
inline |
Constructor, initializes a pattern from explicit instances of SizeSpec
, DistributionSpec
, TeamSpec
and a Team
.
Examples:
sizespec | Pattern size (extent, number of elements) in every dimension |
dist | Distribution type (BLOCKED, CYCLIC, BLOCKCYCLIC, TILE or NONE) of all dimensions. |
teamspec | Cartesian arrangement of units within the team |
team | Team containing units to which this pattern maps its elements |
Definition at line 224 of file BlockPattern.h.
|
inline |
Constructor, initializes a pattern from explicit instances of SizeSpec
, DistributionSpec
and a Team
.
Examples:
sizespec | Pattern size (extent, number of elements) in every dimension |
dist | Distribution type (BLOCKED, CYCLIC, BLOCKCYCLIC, TILE or NONE) of all dimensions. Defaults to BLOCKED in first, and NONE in higher dimensions |
team | Team containing units to which this pattern maps its elements |
Definition at line 286 of file BlockPattern.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 341 of file BlockPattern.h.
|
inline |
at
Global coordinates to local index.
Convert given global coordinates in pattern to their respective linear local index.
Definition at line 855 of file BlockPattern.h.
Referenced by dash::BlockPattern< 1, Arrangement, IndexType >::at(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::at(), and dash::BlockPattern< 1, Arrangement, IndexType >::local_index().
|
inline |
Global coordinates and viewspec to local index.
Convert given global coordinate in pattern to its linear local index.
Definition at line 884 of file BlockPattern.h.
|
inline |
Global coordinates to local index.
Convert given coordinate in pattern to its linear local index.
Definition at line 905 of file BlockPattern.h.
|
inline |
View spec (offset and extents) of block at global linear block index in cartesian element space.
Definition at line 1058 of file BlockPattern.h.
|
inline |
Index of block at given global coordinates.
g_coords | Global coordinates of element |
Definition at line 1007 of file BlockPattern.h.
|
inlinenoexcept |
Maximum number of elements in a single block in the given dimension.
dimension | The dimension in the pattern |
Definition at line 1163 of file BlockPattern.h.
Referenced by dash::BlockPattern< 1, Arrangement, IndexType >::underfilled_blocksize(), and dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::underfilled_blocksize().
|
inlinenoexcept |
|
inlinenoexcept |
The maximum number of elements arranged in this pattern.
Definition at line 1227 of file BlockPattern.h.
|
inlinenoexcept |
Convert given global linear offset (index) to global cartesian coordinates.
Definition at line 1297 of file BlockPattern.h.
Referenced by dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::at(), dash::BlockPattern< 1, Arrangement, IndexType >::local(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::local(), and dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::local_at().
|
inlinenoexcept |
Convert given global linear offset (index) and viewspec to global cartesian coordinates.
index | Global index (offset) to convert |
viewspec | View specification (offsets) to apply on coords |
Definition at line 1309 of file BlockPattern.h.
|
inlinenoexcept |
Distribution specification of this pattern.
Definition at line 1254 of file BlockPattern.h.
Referenced by dash::BlockPattern< 1, Arrangement, IndexType >::underfilled_blocksize(), and dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::underfilled_blocksize().
|
inline |
extent
The number of elements in this pattern in the given dimension.
Definition at line 511 of file BlockPattern.h.
|
inlinenoexcept |
Size specification of the index space mapped by this pattern.
Definition at line 1275 of file BlockPattern.h.
Referenced by dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::block(), dash::BlockPattern< 1, Arrangement, IndexType >::local_block_local(), and dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::local_block_local().
|
inline |
global
Converts local coordinates of a given unit to global coordinates.
Definition at line 710 of file BlockPattern.h.
Referenced by dash::BlockPattern< 1, Arrangement, IndexType >::global(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::global(), dash::BlockPattern< 1, Arrangement, IndexType >::local_block(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::local_block(), dash::BlockPattern< 1, Arrangement, IndexType >::underfilled_blocksize(), and dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::underfilled_blocksize().
|
inline |
Converts local coordinates of active unit to global coordinates.
Definition at line 747 of file BlockPattern.h.
|
inline |
Resolve an element's linear global index from the calling unit's local index of that element.
Definition at line 761 of file BlockPattern.h.
|
inline |
Global coordinates and viewspec to global position in the pattern's iteration order.
Definition at line 800 of file BlockPattern.h.
|
inline |
Global coordinates to global position in the pattern's iteration order.
NOTE: Expects extent[d] to be a multiple of blocksize[d] * nunits[d] to ensure the balanced property.
Definition at line 832 of file BlockPattern.h.
|
inline |
Resolve an element's linear global index from a given unit's local coordinates of that element.
Definition at line 781 of file BlockPattern.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 | local id of the unit |
viewspec | Viewspec to apply |
Definition at line 926 of file BlockPattern.h.
|
inline |
Whether the given global index is local to the specified unit.
Definition at line 960 of file BlockPattern.h.
Referenced by dash::BlockPattern< 1, Arrangement, IndexType >::is_local(), and dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::is_local().
|
inlinenoexcept |
Whether the given global index is local to the unit that created this pattern instance.
Definition at line 976 of file BlockPattern.h.
|
inline |
Resolves the global index of the first local element in the pattern.
Definition at line 406 of file BlockPattern.h.
|
inline |
Resolves the global index past the last local element in the pattern.
Definition at line 416 of file BlockPattern.h.
|
inline |
Converts global coordinates to their associated unit and its respective local coordinates.
TODO: Unoptimized
Definition at line 625 of file BlockPattern.h.
|
inline |
Converts global index to its associated unit and respective local index.
TODO: Unoptimized
Definition at line 641 of file BlockPattern.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 592 of file BlockPattern.h.
|
inline |
Convert given local coordinates to linear local offset (index).
local_coords | Point in local memory |
Definition at line 610 of file BlockPattern.h.
|
inline |
View spec (offset and extents) of block at local linear block index in global cartesian element space.
Definition at line 1081 of file BlockPattern.h.
|
inline |
Unit and local block index at given global coordinates.
g_coords | Global coordinates of element |
Definition at line 1029 of file BlockPattern.h.
|
inline |
View spec (offset and extents) of block at local linear block index in local cartesian element space.
Definition at line 1135 of file BlockPattern.h.
|
inlinenoexcept |
Cartesian arrangement of local pattern blocks.
Definition at line 997 of file BlockPattern.h.
|
inlinenoexcept |
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 1189 of file BlockPattern.h.
|
inline |
Converts global coordinates to their associated unit's respective local coordinates.
Definition at line 657 of file BlockPattern.h.
Referenced by dash::BlockPattern< 1, Arrangement, IndexType >::at(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::global(), dash::BlockPattern< 1, Arrangement, IndexType >::local(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::local(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::local_at(), and dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::local_coords().
|
inline |
The actual number of elements in this pattern that are local to the calling unit in the given dimension.
Definition at line 534 of file BlockPattern.h.
Referenced by dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::local_block(), and dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::local_block_local().
|
inlinenoexcept |
The actual number of elements in this pattern that are local to the active unit, by dimension.
Definition at line 557 of file BlockPattern.h.
|
inlinenoexcept |
The actual number of elements in this pattern that are local to the given unit, by dimension.
Definition at line 573 of file BlockPattern.h.
|
inline |
Resolves the unit and the local index from global coordinates.
Definition at line 677 of file BlockPattern.h.
Referenced by dash::BlockPattern< 1, Arrangement, IndexType >::local(), and dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::local().
|
inlinenoexcept |
The actual number of elements in this pattern that are local to the calling unit in total.
Definition at line 1204 of file BlockPattern.h.
Referenced by dash::BlockPattern< 1, Arrangement, IndexType >::underfilled_blocksize().
|
inlinenoexcept |
Maximum number of elements in a single block in all dimensions.
Definition at line 1178 of file BlockPattern.h.
|
inlinestaticnoexcept |
Memory order followed by the pattern.
Definition at line 1321 of file BlockPattern.h.
Referenced by dash::halo::StencilOperatorBoundary< Self_t >::update().
|
inlinestaticnoexcept |
Number of dimensions of the cartesian space partitioned by the pattern.
Definition at line 1329 of file BlockPattern.h.
Referenced by dash::halo::StencilOperatorBoundary< Self_t >::update().
|
inlinenoexcept |
The number of units to which this pattern's elements are mapped.
Definition at line 1217 of file BlockPattern.h.
|
inline |
Inquality comparison operator.
other | Pattern instance to compare for inequality |
Definition at line 370 of file BlockPattern.h.
|
inline |
Assignment operator.
Definition at line 380 of file BlockPattern.h.
Referenced by dash::BlockPattern< 1, Arrangement, IndexType >::BlockPattern().
|
inline |
Equality comparison operator.
other | Pattern instance to compare for equality |
Definition at line 348 of file BlockPattern.h.
|
inlinenoexcept |
The number of elements arranged in this pattern.
Definition at line 1237 of file BlockPattern.h.
Referenced by dash::BlockPattern< 1, Arrangement, IndexType >::underfilled_blocksize().
|
inlinenoexcept |
Size specification of the index space mapped by this pattern.
Definition at line 1264 of file BlockPattern.h.
|
inlinenoexcept |
The Team containing the units to which this pattern's elements are mapped.
Definition at line 1246 of file BlockPattern.h.
Referenced by dash::BlockPattern< 1, Arrangement, IndexType >::BlockPattern(), dash::BlockPattern< 1, Arrangement, IndexType >::is_local(), and dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::is_local().
|
inlinenoexcept |
Cartesian arrangement of the Team containing the units to which this pattern's elements are mapped.
Definition at line 1286 of file BlockPattern.h.
|
inline |
Number of elements missing in the overflow block of given dimension compared to the regular blocksize (.
underfilled_blocksize(d)
< blocksize(d). Definition at line 1339 of file BlockPattern.h.
Referenced by dash::BlockPattern< 1, Arrangement, IndexType >::block(), and dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::block().
|
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 430 of file BlockPattern.h.
Referenced by dash::BlockPattern< 1, Arrangement, IndexType >::local(), dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::local(), dash::BlockPattern< 1, Arrangement, IndexType >::local_index(), and dash::BlockPattern< 1, ROW_MAJOR, dash::default_index_t >::unit_at().
|
inline |
Convert given coordinate in pattern to its assigned unit id.
Definition at line 449 of file BlockPattern.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 471 of file BlockPattern.h.
|
inline |
Convert given global linear index to its assigned unit id.
global_pos | Global linear element offset |
Definition at line 490 of file BlockPattern.h.