1 #ifndef DASH__PATTERN_H__INCLUDED 2 #define DASH__PATTERN_H__INCLUDED 85 MemArrange Arrangement = ROW_MAJOR,
90 typedef typename std::make_unsigned<IndexType>::type SizeType;
95 static constexpr
char const * PatternName =
"TheConcretePatternTypeName";
99 typedef IndexType index_type;
100 typedef SizeType size_type;
110 std::array<index_type, NumDimensions>
coords;
128 const self_t & other)
const;
135 const self_t & other)
const;
147 index_type
lbegin()
const;
154 index_type
lend()
const;
167 const std::array<index_type, NumDimensions> &
coords,
169 const ViewSpec_t & viewspec)
const;
177 const std::array<index_type, NumDimensions> & coords)
const;
186 index_type global_pos,
188 const ViewSpec_t & viewspec)
const;
201 index_type global_pos)
const;
270 const std::array<index_type, NumDimensions> &
local_coords,
272 const ViewSpec_t & viewspec)
const;
281 const std::array<index_type, NumDimensions> & local_coords)
const;
289 local_coords_t
local(
290 const std::array<index_type, NumDimensions> & global_coords)
const;
298 index_type g_index)
const;
307 const std::array<index_type, NumDimensions> & global_coords)
const;
315 const std::array<index_type, NumDimensions> & global_coords)
const;
326 std::array<index_type, NumDimensions>
global(
328 const std::array<index_type, NumDimensions> & local_coords)
const;
335 std::array<index_type, NumDimensions>
global(
336 const std::array<index_type, NumDimensions> & local_coords)
const;
347 index_type local_index)
const;
359 const std::array<index_type, NumDimensions> & local_coords)
const;
371 const std::array<index_type, NumDimensions> & view_coords,
372 const ViewSpec_t & viewspec)
const;
387 const std::array<index_type, NumDimensions> & global_coords)
const;
402 const std::array<index_type, NumDimensions> & global_coords)
const;
412 const std::array<index_type, NumDimensions> & global_coords,
413 const ViewSpec_t & viewspec)
const;
422 template<
typename ... Values>
423 index_type
at(index_type value, Values ... values)
const;
445 index_type index)
const;
463 const std::array<index_type, NumDimensions> & g_coords)
const;
470 index_type global_block_index)
const;
477 index_type local_block_index)
const;
484 index_type local_block_index)
const;
495 dim_t dimension)
const;
540 inline index_type
size()
const;
551 const DistributionSpec_t &
distspec()
const;
565 const std::array<size_type, NumDimensions> &
extents()
const;
573 const TeamSpec_t &
teamspec()
const;
581 std::array<index_type, NumDimensions>
coords(
582 index_type index)
const;
590 std::array<index_type, NumDimensions>
coords(
592 const ViewSpec_t & viewspec)
const;
610 dim_t dimension)
const;
619 #include <dash/pattern/BlockPattern.h> 620 #include <dash/pattern/TilePattern.h> 621 #include <dash/pattern/ShiftTilePattern.h> 622 #include <dash/pattern/SeqTilePattern.h> 625 #include <dash/pattern/CSRPattern.h> 626 #include <dash/pattern/LoadBalancePattern.h> 628 #include <dash/Types.h> 629 #include <dash/Distribution.h> 641 MemArrange Arrangement = ROW_MAJOR,
648 #include <dash/pattern/PatternIterator.h> 649 #include <dash/pattern/PatternProperties.h> 650 #include <dash/pattern/MakePattern.h> 652 #endif // DASH__PATTERN_H__INCLUDED constexpr team_unit_t UNDEFINED_TEAM_UNIT_ID
Invalid local unit ID.
size_type underfilled_blocksize(dim_t dimension) const
Number of elements missing in the overflow block of given dimension compared to the regular blocksize...
constexpr std::enable_if< std::is_integral< IndexType >::value, IndexType >::type index(IndexType idx)
Defines how a list of global indices is mapped to single units within a Team.
size_type local_capacity() const
Maximum number of elements assigned to a single unit in total, equivalent to the local capacity of ev...
bool operator!=(const self_t &other) const
Inquality comparison operator.
This class is a simple memory pool which holds allocates elements of size ValueType.
std::array< index_type, NumDimensions > local_coords(const std::array< index_type, NumDimensions > &global_coords) const
Converts global coordinates to their associated unit's respective local coordinates.
static constexpr MemArrange memory_order()
Memory order followed by the pattern.
Specifies view parameters for implementing submat, rows and cols.
PatternConcept & operator=(const PatternConcept &other)
Assignment operator.
index_type lend() const
Resolves the global index past the last local element in the pattern.
int dim_t
Scalar type for a dimension value, with 0 indicating the first dimension.
index_type global_at(const std::array< index_type, NumDimensions > &view_coords, const ViewSpec_t &viewspec) const
Global coordinates and viewspec to global position in the pattern's iteration order.
SizeSpec_t sizespec() const
Size specification of the index space mapped by this pattern.
static constexpr dim_t ndim()
Number of dimensions of the cartesian space partitioned by the pattern.
bool is_local(index_type index, team_unit_t unit) const
is_local
Defines how a list of global indices is mapped to single units within a Team.
size_type max_blocksize() const
Maximum number of elements in a single block in all dimensions.
size_type 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...
index_type lbegin() const
Resolves the global index of the first local element in the pattern.
index_type capacity() const
The maximum number of elements arranged in this pattern.
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...
index_type block_at(const std::array< index_type, NumDimensions > &g_coords) const
Index of block at given global coordinates.
const TeamSpec_t & teamspec() const
Cartesian arrangement of the Team containing the units to which this pattern's elements are mapped...
internal::default_signed_index default_index_t
Signed integer type used as default for index values.
team_unit_t unit_at(const std::array< index_type, NumDimensions > &coords, const ViewSpec_t &viewspec) const
unit_at
A Team instance specifies a subset of all available units.
index_type global_index(team_unit_t unit, const std::array< index_type, NumDimensions > &local_coords) const
Resolve an element's linear global index from a given unit's local coordinates of that element...
std::array< index_type, NumDimensions > coords(index_type index) const
Convert given global linear offset (index) to global cartesian coordinates.
std::array< size_type, NumDimensions > local_extents() const
The actual number of elements in this pattern that are local to the active unit, by dimension...
index_type local_at(const std::array< index_type, NumDimensions > &local_coords, const ViewSpec_t &viewspec) const
local
index_type local_extent(dim_t dim) const
The actual number of elements in this pattern that are local to the calling unit in the given dimensi...
const std::array< size_type, NumDimensions > & extents() const
Size specification of the index space mapped by this pattern.
PatternConcept(self_t &other)
Copy constructor using non-const lvalue reference parameter.
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...
index_type at(const std::array< index_type, NumDimensions > &global_coords) const
at
struct dash::unit_id< dash::local_unit, dart_team_unit_t > team_unit_t
Unit ID to use for team-local IDs.
index_type extent(dim_t dim) const
extent
dash::Team & team() const
The Team containing the units to which this pattern's elements are mapped.
local_coords_t local(const std::array< index_type, NumDimensions > &global_coords) const
Converts global coordinates to their associated unit and its respective local coordinates.
size_type blocksize(dim_t dimension) const
Maximum number of elements in a single block in the given dimension.
std::array< index_type, NumDimensions > global(team_unit_t unit, const std::array< index_type, NumDimensions > &local_coords) const
global
index_type size() const
The number of elements arranged in this pattern.
bool operator==(const self_t &other) const
Equality comparison operator.
local_index_t local_index(const std::array< index_type, NumDimensions > &global_coords) const
Resolves the unit and the local index from global coordinates.
const BlockSpec_t & blockspec() const
block
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...
const DistributionSpec_t & distspec() const
Distribution specification of this pattern.