DASH
0.3.0
|
Defines how a list of global indices is mapped to single units within a Team. More...
#include <BlockPattern1D.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) followed by an optional distribution type. More... | |
BlockPattern (const SizeSpec_t sizespec, const 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, const DistributionSpec_t dist=DistributionSpec_t(), Team &team=dash::Team::All()) | |
Constructor, initializes a pattern from explicit instances of SizeSpec , DistributionSpec and a Team . More... | |
constexpr | BlockPattern (self_t &&other)=default |
Move constructor. More... | |
constexpr | BlockPattern (const self_t &other)=default |
Copy constructor. More... | |
constexpr | BlockPattern (self_t &other) |
Copy constructor using non-const lvalue reference parameter. More... | |
self_t & | operator= (self_t &&other)=default |
Move-assignment operator. More... | |
self_t & | operator= (const self_t &other)=default |
Assignment operator. More... | |
constexpr bool | operator== (const self_t &other) const |
Equality comparison operator. More... | |
constexpr bool | operator!= (const self_t &other) const |
Inquality comparison operator. More... | |
constexpr IndexType | lbegin () const |
Resolves the global index of the first local element in the pattern. More... | |
constexpr IndexType | lend () const |
Resolves the global index past the last local element in the pattern. More... | |
constexpr team_unit_t | unit_at (const std::array< IndexType, NumDimensions > &coords, const ViewSpec_t &viewspec) const |
unit_at More... | |
constexpr team_unit_t | unit_at (const std::array< IndexType, NumDimensions > &coords) const |
Convert given coordinate in pattern to its assigned unit id. More... | |
constexpr team_unit_t | unit_at (IndexType global_pos, const ViewSpec_t &viewspec) const |
Convert given global linear index to its assigned unit id. More... | |
constexpr 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... | |
template<dim_t dim = 0> | |
constexpr IndexType | extent () const |
The number of elements in this pattern in the given dimension. 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... | |
template<dim_t dim = 0> | |
constexpr IndexType | local_extent () 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 (team_unit_t unit) const |
The actual number of elements in this pattern that are local to the given unit, by dimension. More... | |
constexpr std::array< SizeType, NumDimensions > | local_extents () const |
The actual number of elements in this pattern that are local to the active unit, by dimension. More... | |
constexpr 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... | |
constexpr 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... | |
constexpr local_index_t | local (IndexType g_index) const |
Converts global index to its associated unit and respective local index. More... | |
constexpr std::array< IndexType, NumDimensions > | local_coords (const std::array< IndexType, NumDimensions > &global_coords) const noexcept |
Converts global coordinates to their associated unit's respective local coordinates. More... | |
constexpr local_index_t | local_index (const std::array< IndexType, NumDimensions > &g_coords) const |
Resolves the unit and the local index from global coordinates. More... | |
constexpr std::array< IndexType, NumDimensions > | global (team_unit_t unit, const std::array< IndexType, NumDimensions > &local_coords) const |
global More... | |
constexpr std::array< IndexType, NumDimensions > | global (const std::array< IndexType, NumDimensions > &l_coords) const |
Converts local coordinates of active unit to global coordinates. More... | |
constexpr IndexType | global (IndexType l_index) const |
Resolve an element's linear global index from the calling unit's local index of that element. More... | |
constexpr 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... | |
constexpr IndexType | global_at (const std::array< IndexType, NumDimensions > &global_coords, const ViewSpec_t &viewspec) const |
Convert given global coordinates and viewspec to linear global offset (index). More... | |
constexpr IndexType | global_at (const std::array< IndexType, NumDimensions > &global_coords) const |
Convert given global coordinates to linear global offset (index). More... | |
constexpr IndexType | at (const std::array< IndexType, NumDimensions > &g_coords) const |
at More... | |
constexpr IndexType | at (const std::array< IndexType, 1 > &g_coords, const ViewSpec_t &viewspec) const |
Global coordinates and viewspec to local index. More... | |
template<typename ... Values> | |
constexpr IndexType | at (IndexType value, Values ... values) const |
Global coordinates to local index. More... | |
constexpr bool | has_local_elements (dim_t dim, IndexType dim_offset, team_unit_t unit) const |
is_local More... | |
constexpr 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 |
Whether the given global index is local to the unit that created this pattern instance. More... | |
constexpr BlockSpec_t | blockspec () const |
block More... | |
constexpr BlockSpec_t | local_blockspec () const |
Cartesian arrangement of local pattern blocks. More... | |
constexpr index_type | block_at (const std::array< index_type, NumDimensions > &g_coords) const |
Gobal index of block at given global coordinates. More... | |
constexpr local_index_t | local_block_at (const std::array< index_type, NumDimensions > &g_coords) const |
Local index of block at given global coordinates. More... | |
constexpr 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... | |
constexpr 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... | |
constexpr SizeType | blocksize (dim_t dimension) const |
Maximum number of elements in a single block in the given dimension. More... | |
constexpr SizeType | max_blocksize () const |
Maximum number of elements in a single block in all dimensions. More... | |
constexpr SizeType | local_capacity () const |
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) const |
The actual number of elements in this pattern that are local to the specified unit in total. More... | |
constexpr SizeType | local_size () 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 |
Size specification of the index space mapped by this pattern. More... | |
constexpr const std::array< SizeType, NumDimensions > | extents () const |
Size specification of the index space mapped by this pattern. More... | |
constexpr const TeamSpec_t & | teamspec () const |
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 |
Convert given global linear offset (index) to global cartesian coordinates. More... | |
constexpr 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... | |
constexpr 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 () |
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 const char * | PatternName = "BlockPattern1D" |
Defines how a list of global indices is mapped to single units within a Team.
Definition at line 35 of file BlockPattern1D.h.
typedef pattern_layout_properties< pattern_layout_tag::canonical, pattern_layout_tag::linear > dash::BlockPattern< 1, Arrangement, IndexType >::layout_properties |
Satisfiable properties in pattern property category Layout:
Definition at line 65 of file BlockPattern1D.h.
typedef pattern_mapping_properties< pattern_mapping_tag::unbalanced > dash::BlockPattern< 1, Arrangement, IndexType >::mapping_properties |
Satisfiable properties in pattern property category Mapping:
Definition at line 57 of file BlockPattern1D.h.
typedef pattern_partitioning_properties< pattern_partitioning_tag::rectangular, pattern_partitioning_tag::balanced, pattern_partitioning_tag::unbalanced > dash::BlockPattern< 1, Arrangement, IndexType >::partitioning_properties |
Satisfiable properties in pattern property category Partitioning:
Definition at line 52 of file BlockPattern1D.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.
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 158 of file BlockPattern1D.h.
|
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 or NONE). |
teamspec | Cartesian arrangement of units within the team |
team | Team containing units to which this pattern maps its elements |
Definition at line 195 of file BlockPattern1D.h.
References dash::Team::size(), and dash::BlockPattern< NumDimensions, Arrangement, IndexType >::team().
|
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). Defaults to BLOCKED. |
team | Team containing units to which this pattern maps its elements |
Definition at line 256 of file BlockPattern1D.h.
References dash::BlockPattern< NumDimensions, Arrangement, IndexType >::BlockPattern(), dash::Team::size(), and dash::BlockPattern< NumDimensions, Arrangement, IndexType >::team().
|
default |
Move constructor.
|
default |
Copy constructor.
|
inline |
Copy constructor using non-const lvalue reference parameter.
Introduced so variadic constructor is not a better match for copy-construction.
Definition at line 304 of file BlockPattern1D.h.
References dash::BlockPattern< NumDimensions, Arrangement, IndexType >::operator=().
|
inline |
at
Global coordinates to local index.
Convert given global coordinates in pattern to their respective linear local index.
Definition at line 729 of file BlockPattern1D.h.
References dash::BlockPattern< NumDimensions, Arrangement, IndexType >::local_coords().
|
inline |
Global coordinates and viewspec to local index.
Convert given global coordinate in pattern to its linear local index.
Definition at line 741 of file BlockPattern1D.h.
References dash::BlockPattern< NumDimensions, Arrangement, IndexType >::local_coords().
|
inline |
Global coordinates to local index.
Convert given coordinate in pattern to its linear local index.
Definition at line 759 of file BlockPattern1D.h.
References dash::BlockPattern< NumDimensions, Arrangement, IndexType >::at().
|
inline |
View spec (offset and extents) of block at global linear block index in cartesian element space.
g_block_index | Global block index |
Definition at line 866 of file BlockPattern1D.h.
References dash::BlockPattern< NumDimensions, Arrangement, IndexType >::underfilled_blocksize().
|
inline |
Gobal index of block at given global coordinates.
g_coords | Global coordinates of element |
Definition at line 838 of file BlockPattern1D.h.
|
inline |
Maximum number of elements in a single block in the given dimension.
dimension | The dimension in the pattern |
Definition at line 929 of file BlockPattern1D.h.
|
inline |
|
inlinenoexcept |
The maximum number of elements arranged in this pattern.
Definition at line 1004 of file BlockPattern1D.h.
|
inline |
Convert given global linear offset (index) to global cartesian coordinates.
Definition at line 1066 of file BlockPattern1D.h.
|
inline |
Convert given global linear offset (index) to global cartesian coordinates using viewspec.
Definition at line 1077 of file BlockPattern1D.h.
|
inlinenoexcept |
Distribution specification of this pattern.
Definition at line 1028 of file BlockPattern1D.h.
|
inline |
extent
The number of elements in this pattern in the given dimension.
Definition at line 438 of file BlockPattern1D.h.
|
inline |
The number of elements in this pattern in the given dimension.
Definition at line 456 of file BlockPattern1D.h.
|
inline |
Size specification of the index space mapped by this pattern.
Definition at line 1046 of file BlockPattern1D.h.
|
inline |
global
Converts local coordinates of a given unit to global coordinates.
Definition at line 634 of file BlockPattern1D.h.
|
inline |
Converts local coordinates of active unit to global coordinates.
Definition at line 656 of file BlockPattern1D.h.
References dash::BlockPattern< NumDimensions, Arrangement, IndexType >::global().
|
inline |
Resolve an element's linear global index from the calling unit's local index of that element.
Definition at line 670 of file BlockPattern1D.h.
References dash::BlockPattern< NumDimensions, Arrangement, IndexType >::global().
|
inline |
Convert given global coordinates and viewspec to linear global offset (index).
global_coords | Point in local memory |
viewspec | View specification (offsets) to apply on coords |
Definition at line 697 of file BlockPattern1D.h.
|
inline |
Convert given global coordinates to linear global offset (index).
global_coords | Point in local memory |
Definition at line 710 of file BlockPattern1D.h.
|
inline |
Resolve an element's linear global index from a given unit's local coordinates of that element.
Definition at line 684 of file BlockPattern1D.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 |
Definition at line 778 of file BlockPattern1D.h.
|
inline |
Whether the given global index is local to the specified unit.
Definition at line 797 of file BlockPattern1D.h.
|
inline |
Whether the given global index is local to the unit that created this pattern instance.
Definition at line 809 of file BlockPattern1D.h.
References dash::BlockPattern< NumDimensions, Arrangement, IndexType >::is_local(), dash::myid(), and dash::BlockPattern< NumDimensions, Arrangement, IndexType >::team().
|
inline |
Resolves the global index of the first local element in the pattern.
Definition at line 357 of file BlockPattern1D.h.
|
inline |
Resolves the global index past the last local element in the pattern.
Definition at line 366 of file BlockPattern1D.h.
|
inline |
Converts global coordinates to their associated unit and its respective local coordinates.
TODO: Unoptimized
Definition at line 575 of file BlockPattern1D.h.
References dash::BlockPattern< NumDimensions, Arrangement, IndexType >::local_coords(), and dash::BlockPattern< NumDimensions, Arrangement, IndexType >::unit_at().
|
inline |
Converts global index to its associated unit and respective local index.
TODO: Unoptimized
Definition at line 590 of file BlockPattern1D.h.
References dash::BlockPattern< NumDimensions, Arrangement, IndexType >::coords(), and dash::BlockPattern< NumDimensions, Arrangement, IndexType >::local_index().
|
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 548 of file BlockPattern1D.h.
|
inline |
Convert given local coordinates to linear local offset (index).
local_coords | Point in local memory |
Definition at line 561 of file BlockPattern1D.h.
|
inline |
View spec (offset and extents) of block at local linear block index in global cartesian element space.
l_block_index | Local block index |
Definition at line 884 of file BlockPattern1D.h.
References dash::BlockPattern< NumDimensions, Arrangement, IndexType >::global().
|
inline |
Local index of block at given global coordinates.
g_coords | Global coordinates of element |
Definition at line 849 of file BlockPattern1D.h.
References dash::CartesianIndexSpace< NumDimensions, Arrangement, IndexType >::size().
|
inline |
View spec (offset and extents) of block at local linear block index in local cartesian element space.
Definition at line 905 of file BlockPattern1D.h.
References dash::BlockPattern< NumDimensions, Arrangement, IndexType >::extents().
|
inline |
Cartesian arrangement of local pattern blocks.
Definition at line 828 of file BlockPattern1D.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 953 of file BlockPattern1D.h.
|
inlinenoexcept |
Converts global coordinates to their associated unit's respective local coordinates.
Definition at line 601 of file BlockPattern1D.h.
|
inline |
The actual number of elements in this pattern that are local to the calling unit in the given dimension.
Definition at line 475 of file BlockPattern1D.h.
|
inline |
The actual number of elements in this pattern that are local to the calling unit in the given dimension.
Definition at line 495 of file BlockPattern1D.h.
|
inline |
The actual number of elements in this pattern that are local to the given unit, by dimension.
Definition at line 514 of file BlockPattern1D.h.
|
inline |
The actual number of elements in this pattern that are local to the active unit, by dimension.
Definition at line 534 of file BlockPattern1D.h.
|
inline |
Resolves the unit and the local index from global coordinates.
Definition at line 617 of file BlockPattern1D.h.
References dash::BlockPattern< NumDimensions, Arrangement, IndexType >::at(), and dash::BlockPattern< NumDimensions, Arrangement, IndexType >::unit_at().
|
inline |
The actual number of elements in this pattern that are local to the specified unit in total.
Definition at line 968 of file BlockPattern1D.h.
|
inlinenoexcept |
The actual number of elements in this pattern that are local to the calling unit in total.
Definition at line 985 of file BlockPattern1D.h.
|
inline |
Maximum number of elements in a single block in all dimensions.
Definition at line 943 of file BlockPattern1D.h.
|
inlinestatic |
Memory order followed by the pattern.
Definition at line 1086 of file BlockPattern1D.h.
|
inlinestatic |
Number of dimensions of the cartesian space partitioned by the pattern.
Definition at line 1093 of file BlockPattern1D.h.
|
inlinenoexcept |
The number of units to which this pattern's elements are mapped.
Definition at line 995 of file BlockPattern1D.h.
|
inline |
Inquality comparison operator.
other | Pattern instance to compare for inequality |
Definition at line 345 of file BlockPattern1D.h.
|
default |
Move-assignment operator.
|
default |
Assignment operator.
|
inline |
Equality comparison operator.
other | Pattern instance to compare for equality |
Definition at line 321 of file BlockPattern1D.h.
|
inlinenoexcept |
The number of elements arranged in this pattern.
Definition at line 1013 of file BlockPattern1D.h.
|
inline |
Size specification of the index space mapped by this pattern.
Definition at line 1037 of file BlockPattern1D.h.
|
inlinenoexcept |
The Team containing the units to which this pattern's elements are mapped.
Definition at line 1021 of file BlockPattern1D.h.
|
inline |
Cartesian arrangement of the Team containing the units to which this pattern's elements are mapped.
Definition at line 1056 of file BlockPattern1D.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 1102 of file BlockPattern1D.h.
References dash::BlockPattern< NumDimensions, Arrangement, IndexType >::BlockPattern(), dash::BlockPattern< NumDimensions, Arrangement, IndexType >::blocksize(), dash::BlockPattern< NumDimensions, Arrangement, IndexType >::distspec(), dash::BlockPattern< NumDimensions, Arrangement, IndexType >::global(), dash::BlockPattern< NumDimensions, Arrangement, IndexType >::local_size(), dash::Distribution::max_blocksize_in_range(), dash::Team::size(), and dash::BlockPattern< NumDimensions, Arrangement, IndexType >::size().
|
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 379 of file BlockPattern1D.h.
|
inline |
Convert given coordinate in pattern to its assigned unit id.
Definition at line 393 of file BlockPattern1D.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 403 of file BlockPattern1D.h.
|
inline |
Convert given global linear index to its assigned unit id.
global_pos | Global linear element offset |
Definition at line 418 of file BlockPattern1D.h.