DASH  0.3.0
dash::CSRPattern< 1, Arrangement, IndexType > Class Template Reference

Irregular Pattern for Compressed Sparse Row Storage. More...

#include <CSRPattern.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::unbalancedpartitioning_properties
 Satisfiable properties in pattern property category Partitioning: More...
 
typedef pattern_mapping_properties< pattern_mapping_tag::unbalancedmapping_properties
 Satisfiable properties in pattern property category Mapping: More...
 
typedef pattern_layout_properties< pattern_layout_tag::blocked, pattern_layout_tag::linearlayout_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>
 CSRPattern (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...
 
 CSRPattern (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...
 
 CSRPattern (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>
 CSRPattern (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...
 
 CSRPattern (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...
 
 CSRPattern (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...
 
 CSRPattern (const self_t &other)=default
 Copy constructor. More...
 
 CSRPattern (self_t &&other)=default
 Move constructor. More...
 
 CSRPattern (self_t &other)
 Copy constructor using non-const lvalue reference parameter. More...
 
self_t & operator= (const self_t &other)=default
 Assignment operator. More...
 
self_t & operator= (self_t &&other)=default
 Move-assignment operator. More...
 
constexpr bool operator== (const self_t &other) const noexcept
 Equality comparison operator. More...
 
constexpr bool operator!= (const self_t &other) const noexcept
 Inquality comparison operator. More...
 
constexpr IndexType lbegin () const noexcept
 Resolves the global index of the first local element in the pattern. More...
 
constexpr IndexType lend () const noexcept
 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 > &g_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...
 
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...
 
constexpr std::array< SizeType, NumDimensions > local_extents () const noexcept
 The actual number of elements in this pattern that are local to the calling 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...
 
constexpr IndexType local_at (const std::array< IndexType, NumDimensions > &local_coords, const ViewSpec_t &viewspec) const noexcept
 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 > &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...
 
constexpr 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...
 
constexpr 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...
 
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 (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...
 
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 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>
constexpr IndexType at (IndexType value, Values ... values) const
 Global coordinates to local index. More...
 
constexpr bool is_local (IndexType index, team_unit_t unit) const noexcept
 is_local More...
 
bool is_local (IndexType index) const
 Whether the given global index is local to the unit that created this pattern instance. More...
 
constexpr const BlockSpec_tblockspec () const noexcept
 block More...
 
constexpr 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...
 
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 () const noexcept
 The actual number of elements in this pattern that are local to the calling unit in total. More...
 
constexpr SizeType local_size (team_unit_t unit) const noexcept
 
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::Teamteam () const noexcept
 The Team containing the units to which this pattern's elements are mapped. More...
 
constexpr const DistributionSpec_tdistspec () 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_tteamspec () 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...
 
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 = "CSRPattern1D"
 

Detailed Description

template<MemArrange Arrangement, typename IndexType>
class dash::CSRPattern< 1, Arrangement, IndexType >

Irregular Pattern for Compressed Sparse Row Storage.

Specialization for 1-dimensional data.

Implemented concept:
Pattern Concept

Definition at line 52 of file CSRPattern.h.

Member Typedef Documentation

◆ layout_properties

template<MemArrange Arrangement, typename IndexType >
typedef pattern_layout_properties< pattern_layout_tag::blocked, pattern_layout_tag::linear > dash::CSRPattern< 1, Arrangement, IndexType >::layout_properties

Satisfiable properties in pattern property category Layout:

Definition at line 85 of file CSRPattern.h.

◆ mapping_properties

template<MemArrange Arrangement, typename IndexType >
typedef pattern_mapping_properties< pattern_mapping_tag::unbalanced > dash::CSRPattern< 1, Arrangement, IndexType >::mapping_properties

Satisfiable properties in pattern property category Mapping:

Definition at line 77 of file CSRPattern.h.

◆ partitioning_properties

Satisfiable properties in pattern property category Partitioning:

Definition at line 72 of file CSRPattern.h.

Constructor & Destructor Documentation

◆ CSRPattern() [1/9]

template<MemArrange Arrangement, typename IndexType >
template<typename ... Args>
dash::CSRPattern< 1, Arrangement, IndexType >::CSRPattern ( SizeType  arg,
Args &&...  args 
)
inline

Constructor, initializes a pattern from an argument list consisting of the pattern size (extent, number of elements) followed by an optional distribution type.

Parameters
argArgument list consisting of the pattern size (extent, number of elements) in every dimension followed by optional distribution types.
argsArgument list consisting of the pattern size (extent, number of elements) in every dimension followed by optional distribution types.

Definition at line 163 of file CSRPattern.h.

172  : CSRPattern(PatternArguments_t(arg, args...))
173  {
174  DASH_LOG_TRACE("CSRPattern()", "Constructor with argument list");
175  DASH_ASSERT_EQ(
176  _local_sizes.size(), _nunits,
177  "Number of given local sizes " << _local_sizes.size() << " " <<
178  "does not match number of units" << _nunits);
179  initialize_local_range();
180  DASH_LOG_TRACE("CSRPattern()", "CSRPattern initialized");
181  }
CSRPattern(SizeType arg, Args &&... args)
Constructor, initializes a pattern from an argument list consisting of the pattern size (extent...
Definition: CSRPattern.h:163

◆ CSRPattern() [2/9]

template<MemArrange Arrangement, typename IndexType >
dash::CSRPattern< 1, Arrangement, IndexType >::CSRPattern ( const SizeSpec_t sizespec,
const DistributionSpec_t distspec,
const TeamSpec_t teamspec,
Team team = dash::Team::All() 
)
inline

Constructor, initializes a pattern from explicit instances of SizeSpec, DistributionSpec, TeamSpec and Team.

Parameters
sizespecSize spec of the pattern.
distspecDistribution spec.
teamspecCartesian arrangement of units within the team
teamTeam containing units to which this pattern maps its elements.

Definition at line 188 of file CSRPattern.h.

References dash::Team::size().

197  : _size(sizespec.size()),
198  _local_sizes(initialize_local_sizes(
199  _size,
200  distspec,
201  team)),
202  _block_offsets(initialize_block_offsets(
203  _local_sizes)),
204  _memory_layout(std::array<SizeType, 1> {{ _size }}),
205  _blockspec(initialize_blockspec(
206  _local_sizes)),
207  _distspec(DistributionSpec_t()),
208  _team(&team),
209  _teamspec(
210  teamspec,
211  _distspec,
212  *_team),
213  _nunits(_team->size()),
214  _local_size(
215  initialize_local_extent(
216  _team->myid(),
217  _local_sizes)),
218  _local_memory_layout(std::array<SizeType, 1> {{ _local_size }}),
219  _local_capacity(initialize_local_capacity(_local_sizes))
220  {
221  DASH_LOG_TRACE("CSRPattern()", "(sizespec, dist, team)");
222  DASH_ASSERT_EQ(
223  _local_sizes.size(), _nunits,
224  "Number of given local sizes " << _local_sizes.size() << " " <<
225  "does not match number of units" << _nunits);
226  initialize_local_range();
227  DASH_LOG_TRACE("CSRPattern()", "CSRPattern initialized");
228  }
constexpr const TeamSpec_t & teamspec() const noexcept
Cartesian arrangement of the Team containing the units to which this pattern&#39;s elements are mapped...
Definition: CSRPattern.h:1087
constexpr SizeSpec_t sizespec() const noexcept
Size specification of the index space mapped by this pattern.
Definition: CSRPattern.h:1065
size_t size() const
The number of units in this team.
Definition: Team.h:498
constexpr dash::Team & team() const noexcept
The Team containing the units to which this pattern&#39;s elements are mapped.
Definition: CSRPattern.h:1047
constexpr const DistributionSpec_t & distspec() const noexcept
Distribution specification of this pattern.
Definition: CSRPattern.h:1055
constexpr SizeType size() const noexcept
The number of discrete elements within the space spanned by the coordinate.
Definition: Cartesian.h:164

◆ CSRPattern() [3/9]

template<MemArrange Arrangement, typename IndexType >
dash::CSRPattern< 1, Arrangement, IndexType >::CSRPattern ( const SizeSpec_t sizespec,
const DistributionSpec_t distspec,
Team team = dash::Team::All() 
)
inline

Constructor, initializes a pattern from explicit instances of SizeSpec, DistributionSpec and Team.

Parameters
sizespecSize spec of the pattern.
distspecDistribution spec.
teamTeam containing units to which this pattern maps its elements.

Definition at line 235 of file CSRPattern.h.

References dash::Team::size().

242  : _size(sizespec.size()),
243  _local_sizes(initialize_local_sizes(
244  _size,
245  distspec,
246  team)),
247  _block_offsets(initialize_block_offsets(
248  _local_sizes)),
249  _memory_layout(std::array<SizeType, 1> {{ _size }}),
250  _blockspec(initialize_blockspec(
251  _local_sizes)),
252  _distspec(DistributionSpec_t()),
253  _team(&team),
254  _teamspec(_distspec, *_team),
255  _nunits(_team->size()),
256  _local_size(
257  initialize_local_extent(
258  _team->myid(),
259  _local_sizes)),
260  _local_memory_layout(std::array<SizeType, 1> {{ _local_size }}),
261  _local_capacity(initialize_local_capacity(_local_sizes))
262  {
263  DASH_LOG_TRACE("CSRPattern()", "(sizespec, dist, team)");
264  DASH_ASSERT_EQ(
265  _local_sizes.size(), _nunits,
266  "Number of given local sizes " << _local_sizes.size() << " " <<
267  "does not match number of units" << _nunits);
268  initialize_local_range();
269  DASH_LOG_TRACE("CSRPattern()", "CSRPattern initialized");
270  }
constexpr SizeSpec_t sizespec() const noexcept
Size specification of the index space mapped by this pattern.
Definition: CSRPattern.h:1065
size_t size() const
The number of units in this team.
Definition: Team.h:498
constexpr dash::Team & team() const noexcept
The Team containing the units to which this pattern&#39;s elements are mapped.
Definition: CSRPattern.h:1047
constexpr const DistributionSpec_t & distspec() const noexcept
Distribution specification of this pattern.
Definition: CSRPattern.h:1055
constexpr SizeType size() const noexcept
The number of discrete elements within the space spanned by the coordinate.
Definition: Cartesian.h:164

◆ CSRPattern() [4/9]

template<MemArrange Arrangement, typename IndexType >
template<typename ... Args>
dash::CSRPattern< 1, Arrangement, IndexType >::CSRPattern ( const std::vector< size_type > &  local_sizes,
SizeType  arg,
Args &&...  args 
)
inline

Constructor, initializes a pattern from an argument list consisting of the pattern size (extent, number of elements) followed by an optional distribution type.

Parameters
local_sizesNumber of local elements for every unit in the active team.
argArgument list consisting of the pattern size (extent, number of elements) in every dimension followed by optional distribution types.
argsArgument list consisting of the pattern size (extent, number of elements) in every dimension followed by optional distribution types.

Definition at line 279 of file CSRPattern.h.

290  : CSRPattern(local_sizes, PatternArguments_t(arg, args...))
291  {
292  DASH_LOG_TRACE("CSRPattern()", "Constructor with argument list");
293  DASH_ASSERT_EQ(
294  _local_sizes.size(), _nunits,
295  "Number of given local sizes " << _local_sizes.size() << " " <<
296  "does not match number of units" << _nunits);
297  initialize_local_range();
298  DASH_LOG_TRACE("CSRPattern()", "CSRPattern initialized");
299  }
CSRPattern(SizeType arg, Args &&... args)
Constructor, initializes a pattern from an argument list consisting of the pattern size (extent...
Definition: CSRPattern.h:163

◆ CSRPattern() [5/9]

template<MemArrange Arrangement, typename IndexType >
dash::CSRPattern< 1, Arrangement, IndexType >::CSRPattern ( const std::vector< size_type > &  local_sizes,
const TeamSpec_t teamspec,
dash::Team team = dash::Team::All() 
)
inline

Constructor, initializes a pattern from explicit instances of SizeSpec, DistributionSpec, TeamSpec and a Team.

Parameters
local_sizesNumber of local elements for every unit in the active team.
teamspecCartesian arrangement of units within the team
teamTeam containing units to which this pattern maps its elements

Definition at line 306 of file CSRPattern.h.

References dash::Team::size().

313  : _size(initialize_size(
314  local_sizes)),
315  _local_sizes(local_sizes),
316  _block_offsets(initialize_block_offsets(
317  _local_sizes)),
318  _memory_layout(std::array<SizeType, 1> {{ _size }}),
319  _blockspec(initialize_blockspec(
320  _local_sizes)),
321  _distspec(DistributionSpec_t()),
322  _team(&team),
323  _teamspec(
324  teamspec,
325  _distspec,
326  *_team),
327  _nunits(_team->size()),
328  _local_size(
329  initialize_local_extent(
330  _team->myid(),
331  _local_sizes)),
332  _local_memory_layout(std::array<SizeType, 1> {{ _local_size }}),
333  _local_capacity(initialize_local_capacity(_local_sizes))
334  {
335  DASH_LOG_TRACE("CSRPattern()", "(sizespec, dist, teamspec, team)");
336  DASH_ASSERT_EQ(
337  _local_sizes.size(), _nunits,
338  "Number of given local sizes " << _local_sizes.size() << " " <<
339  "does not match number of units" << _nunits);
340  initialize_local_range();
341  DASH_LOG_TRACE("CSRPattern()", "CSRPattern initialized");
342  }
constexpr const TeamSpec_t & teamspec() const noexcept
Cartesian arrangement of the Team containing the units to which this pattern&#39;s elements are mapped...
Definition: CSRPattern.h:1087
size_t size() const
The number of units in this team.
Definition: Team.h:498

◆ CSRPattern() [6/9]

template<MemArrange Arrangement, typename IndexType >
dash::CSRPattern< 1, Arrangement, IndexType >::CSRPattern ( const std::vector< size_type > &  local_sizes,
Team team = dash::Team::All() 
)
inline

Constructor, initializes a pattern from explicit instances of SizeSpec, DistributionSpec, TeamSpec and a Team.

Parameters
local_sizesNumber of local elements for every unit in the active team.
teamTeam containing units to which this pattern maps its elements

Definition at line 349 of file CSRPattern.h.

References dash::Team::size().

354  : _size(
355  initialize_size(
356  local_sizes)),
357  _local_sizes(local_sizes),
358  _block_offsets(
359  initialize_block_offsets(
360  _local_sizes)),
361  _memory_layout(std::array<SizeType, 1> {{ _size }}),
362  _blockspec(
363  initialize_blockspec(
364  _local_sizes)),
365  _distspec(DistributionSpec_t()),
366  _team(&team),
367  _teamspec(_distspec, *_team),
368  _nunits(_team->size()),
369  _local_size(
370  initialize_local_extent(
371  _team->myid(),
372  _local_sizes)),
373  _local_memory_layout(
374  std::array<SizeType, 1> {{ _local_size }}),
375  _local_capacity(
376  initialize_local_capacity(_local_sizes))
377  {
378  DASH_LOG_TRACE("CSRPattern()", "(sizespec, dist, team)");
379  DASH_ASSERT_EQ(
380  _local_sizes.size(), _nunits,
381  "Number of given local sizes " << _local_sizes.size() << " " <<
382  "does not match number of units" << _nunits);
383  initialize_local_range();
384  DASH_LOG_TRACE("CSRPattern()", "CSRPattern initialized");
385  }
size_t size() const
The number of units in this team.
Definition: Team.h:498
constexpr dash::Team & team() const noexcept
The Team containing the units to which this pattern&#39;s elements are mapped.
Definition: CSRPattern.h:1047

◆ CSRPattern() [7/9]

template<MemArrange Arrangement, typename IndexType >
dash::CSRPattern< 1, Arrangement, IndexType >::CSRPattern ( const self_t &  other)
default

Copy constructor.

◆ CSRPattern() [8/9]

template<MemArrange Arrangement, typename IndexType >
dash::CSRPattern< 1, Arrangement, IndexType >::CSRPattern ( self_t &&  other)
default

Move constructor.

◆ CSRPattern() [9/9]

template<MemArrange Arrangement, typename IndexType >
dash::CSRPattern< 1, Arrangement, IndexType >::CSRPattern ( self_t &  other)
inline

Copy constructor using non-const lvalue reference parameter.

Introduced so variadic constructor is not a better match for copy-construction.

Definition at line 403 of file CSRPattern.h.

404  : CSRPattern(static_cast<const self_t &>(other))
405  { }
CSRPattern(SizeType arg, Args &&... args)
Constructor, initializes a pattern from an argument list consisting of the pattern size (extent...
Definition: CSRPattern.h:163

Member Function Documentation

◆ at() [1/3]

template<MemArrange Arrangement, typename IndexType >
constexpr IndexType dash::CSRPattern< 1, Arrangement, IndexType >::at ( const std::array< IndexType, NumDimensions > &  g_coords) const
inline

at

Global coordinates to local index.

Convert given global coordinates in pattern to their respective linear local index.

See also
Pattern Concept

Definition at line 802 of file CSRPattern.h.

804  {
805  return local_coords(g_coords)[0];
806  }
constexpr std::array< IndexType, NumDimensions > local_coords(const std::array< IndexType, NumDimensions > &g_coords) const
Converts global coordinates to their associated unit&#39;s respective local coordinates.
Definition: CSRPattern.h:692

◆ at() [2/3]

template<MemArrange Arrangement, typename IndexType >
IndexType dash::CSRPattern< 1, Arrangement, IndexType >::at ( const std::array< IndexType, NumDimensions > &  g_coords,
const ViewSpec_t viewspec 
) const
inline

Global coordinates and viewspec to local index.

Convert given global coordinate in pattern to its linear local index.

See also
Pattern Concept

Definition at line 815 of file CSRPattern.h.

818  {
819  auto vs_coords = g_coords;
820  vs_coords[0] += viewspec.offset(0);
821  return local_coords(vs_coords)[0];
822  }
constexpr std::array< IndexType, NumDimensions > local_coords(const std::array< IndexType, NumDimensions > &g_coords) const
Converts global coordinates to their associated unit&#39;s respective local coordinates.
Definition: CSRPattern.h:692

◆ at() [3/3]

template<MemArrange Arrangement, typename IndexType >
template<typename ... Values>
constexpr IndexType dash::CSRPattern< 1, Arrangement, IndexType >::at ( IndexType  value,
Values ...  values 
) const
inline

Global coordinates to local index.

Convert given coordinate in pattern to its linear local index.

See also
Pattern Concept

Definition at line 832 of file CSRPattern.h.

833  {
834  static_assert(
835  sizeof...(values) == NumDimensions-1,
836  "Wrong parameter number");
837  return at(std::array<IndexType, NumDimensions> {{
838  value, (IndexType)values...
839  }});
840  }
constexpr IndexType at(const std::array< IndexType, NumDimensions > &g_coords) const
at
Definition: CSRPattern.h:802

◆ block()

template<MemArrange Arrangement, typename IndexType >
ViewSpec_t dash::CSRPattern< 1, Arrangement, IndexType >::block ( index_type  g_block_index) const
inline

View spec (offset and extents) of block at global linear block index in cartesian element space.

Definition at line 905 of file CSRPattern.h.

907  {
908  DASH_LOG_DEBUG_VAR("CSRPattern<1>.block >", g_block_index);
909  index_type offset = _block_offsets[g_block_index];
910  auto block_size = _local_sizes[g_block_index];
911  std::array<index_type, NumDimensions> offsets = {{ offset }};
912  std::array<size_type, NumDimensions> extents = {{ block_size }};
913  ViewSpec_t block_vs(offsets, extents);
914  DASH_LOG_DEBUG_VAR("CSRPattern<1>.block >", block_vs);
915  return block_vs;
916  }
constexpr const std::array< SizeType, NumDimensions > extents() const noexcept
Size specification of the index space mapped by this pattern.
Definition: CSRPattern.h:1076

◆ block_at()

template<MemArrange Arrangement, typename IndexType >
constexpr index_type dash::CSRPattern< 1, Arrangement, IndexType >::block_at ( const std::array< index_type, NumDimensions > &  g_coords) const
inline

Index of block at given global coordinates.

See also
Pattern Concept
Parameters
g_coordsGlobal coordinates of element

Definition at line 894 of file CSRPattern.h.

897  {
898  return static_cast<index_type>(unit_at(g_coords[0]));
899  }
constexpr team_unit_t unit_at(const std::array< IndexType, NumDimensions > &coords, const ViewSpec_t &viewspec) const
unit_at
Definition: CSRPattern.h:474

◆ blocksize()

template<MemArrange Arrangement, typename IndexType >
constexpr SizeType dash::CSRPattern< 1, Arrangement, IndexType >::blocksize ( dim_t  dimension) const
inlinenoexcept

Maximum number of elements in a single block in the given dimension.

Returns
The blocksize in the given dimension
See also
Pattern Concept
Parameters
dimensionThe dimension in the pattern

Definition at line 961 of file CSRPattern.h.

964  {
965  return _local_capacity;
966  }

◆ blockspec()

template<MemArrange Arrangement, typename IndexType >
constexpr const BlockSpec_t& dash::CSRPattern< 1, Arrangement, IndexType >::blockspec ( ) const
inlinenoexcept

block

Cartesian arrangement of pattern blocks.

Definition at line 884 of file CSRPattern.h.

885  {
886  return _blockspec;
887  }

◆ capacity()

template<MemArrange Arrangement, typename IndexType >
constexpr IndexType dash::CSRPattern< 1, Arrangement, IndexType >::capacity ( ) const
inlinenoexcept

The maximum number of elements arranged in this pattern.

See also
Pattern Concept

Definition at line 1028 of file CSRPattern.h.

1029  {
1030  return _size;
1031  }

◆ coords() [1/2]

template<MemArrange Arrangement, typename IndexType >
constexpr std::array<IndexType, NumDimensions> dash::CSRPattern< 1, Arrangement, IndexType >::coords ( IndexType  index) const
inlinenoexcept

Convert given global linear offset (index) to global cartesian coordinates.

See also
Pattern Concept

Definition at line 1098 of file CSRPattern.h.

References dash::index().

1100  {
1101  return std::array<IndexType, 1> {{ index }};
1102  }
constexpr std::enable_if< std::is_integral< IndexType >::value, IndexType >::type index(IndexType idx)
Definition: Iterator.h:60

◆ coords() [2/2]

template<MemArrange Arrangement, typename IndexType >
std::array<IndexType, NumDimensions> dash::CSRPattern< 1, Arrangement, IndexType >::coords ( IndexType  index,
const ViewSpec_t viewspec 
) const
inline

Convert given global linear offset (index) to global cartesian coordinates using viewspec.

See also
Pattern Concept

Definition at line 1110 of file CSRPattern.h.

1112  {
1113  return std::array<IndexType, 1> {{ index + viewspec.offset(0) }};
1114  }
constexpr std::enable_if< std::is_integral< IndexType >::value, IndexType >::type index(IndexType idx)
Definition: Iterator.h:60

◆ distspec()

template<MemArrange Arrangement, typename IndexType >
constexpr const DistributionSpec_t& dash::CSRPattern< 1, Arrangement, IndexType >::distspec ( ) const
inlinenoexcept

Distribution specification of this pattern.

Definition at line 1055 of file CSRPattern.h.

1056  {
1057  return _distspec;
1058  }

◆ extent()

template<MemArrange Arrangement, typename IndexType >
IndexType dash::CSRPattern< 1, Arrangement, IndexType >::extent ( dim_t  dim) const
inline

extent

The number of elements in this pattern in the given dimension.

See also
blocksize()
local_size()
local_extent()
Pattern Concept

Definition at line 545 of file CSRPattern.h.

546  {
547  DASH_ASSERT_EQ(
548  0, dim,
549  "Wrong dimension for Pattern::local_extent. " <<
550  "Expected dimension = 0, got " << dim);
551  return _size;
552  }

◆ extents()

template<MemArrange Arrangement, typename IndexType >
constexpr const std::array<SizeType, NumDimensions> dash::CSRPattern< 1, Arrangement, IndexType >::extents ( ) const
inlinenoexcept

Size specification of the index space mapped by this pattern.

See also
Pattern Concept

Definition at line 1076 of file CSRPattern.h.

1077  {
1078  return std::array<SizeType, 1> {{ _size }};
1079  }

◆ global() [1/4]

template<MemArrange Arrangement, typename IndexType >
std::array<IndexType, NumDimensions> dash::CSRPattern< 1, Arrangement, IndexType >::global ( team_unit_t  unit,
const std::array< IndexType, NumDimensions > &  local_coords 
) const
inline

global

Converts local coordinates of a given unit to global coordinates.

See also
Pattern Concept

Definition at line 719 of file CSRPattern.h.

722  {
723  DASH_LOG_DEBUG_VAR("CSRPattern.global()", unit);
724  DASH_LOG_DEBUG_VAR("CSRPattern.global()", local_coords);
725  DASH_LOG_TRACE_VAR("CSRPattern.global", _nunits);
726  if (_nunits < 2) {
727  return local_coords;
728  }
729  // Initialize global index with element phase (= local coords):
730  index_type glob_index = _block_offsets[unit] + local_coords[0];
731  DASH_LOG_TRACE_VAR("CSRPattern.global >", glob_index);
732  return std::array<IndexType, 1> {{ glob_index }};
733  }
constexpr std::array< IndexType, NumDimensions > local_coords(const std::array< IndexType, NumDimensions > &g_coords) const
Converts global coordinates to their associated unit&#39;s respective local coordinates.
Definition: CSRPattern.h:692

◆ global() [2/4]

template<MemArrange Arrangement, typename IndexType >
constexpr std::array<IndexType, NumDimensions> dash::CSRPattern< 1, Arrangement, IndexType >::global ( const std::array< IndexType, NumDimensions > &  l_coords) const
inline

Converts local coordinates of active unit to global coordinates.

See also
Pattern Concept

Definition at line 740 of file CSRPattern.h.

References dash::global().

742  {
743  return global(_team->myid(), l_coords);
744  }
std::array< IndexType, NumDimensions > global(team_unit_t unit, const std::array< IndexType, NumDimensions > &local_coords) const
global
Definition: CSRPattern.h:719

◆ global() [3/4]

template<MemArrange Arrangement, typename IndexType >
constexpr IndexType dash::CSRPattern< 1, Arrangement, IndexType >::global ( team_unit_t  unit,
IndexType  l_index 
) const
inline

Resolve an element's linear global index from the given unit's local index of that element.

See also
at Inverse of local()
Pattern Concept

Definition at line 754 of file CSRPattern.h.

757  {
758  return global(unit, std::array<IndexType, 1> {{ l_index }})[0];
759  }
std::array< IndexType, NumDimensions > global(team_unit_t unit, const std::array< IndexType, NumDimensions > &local_coords) const
global
Definition: CSRPattern.h:719

◆ global() [4/4]

template<MemArrange Arrangement, typename IndexType >
constexpr IndexType dash::CSRPattern< 1, Arrangement, IndexType >::global ( IndexType  l_index) const
inline

Resolve an element's linear global index from the calling unit's local index of that element.

See also
at Inverse of local()
Pattern Concept

Definition at line 769 of file CSRPattern.h.

References dash::global().

771  {
772  return global(_team->myid(), std::array<IndexType, 1> {{ l_index }})[0];
773  }
std::array< IndexType, NumDimensions > global(team_unit_t unit, const std::array< IndexType, NumDimensions > &local_coords) const
global
Definition: CSRPattern.h:719

◆ global_index()

template<MemArrange Arrangement, typename IndexType >
constexpr IndexType dash::CSRPattern< 1, Arrangement, IndexType >::global_index ( team_unit_t  unit,
const std::array< IndexType, NumDimensions > &  l_coords 
) const
inline

Resolve an element's linear global index from a given unit's local coordinates of that element.

See also
at
Pattern Concept

Definition at line 783 of file CSRPattern.h.

786  {
787  return global(unit, l_coords[0]);
788  }
std::array< IndexType, NumDimensions > global(team_unit_t unit, const std::array< IndexType, NumDimensions > &local_coords) const
global
Definition: CSRPattern.h:719

◆ is_local() [1/2]

template<MemArrange Arrangement, typename IndexType >
constexpr bool dash::CSRPattern< 1, Arrangement, IndexType >::is_local ( IndexType  index,
team_unit_t  unit 
) const
inlinenoexcept

is_local

Whether the given global index is local to the specified unit.

See also
Pattern Concept

Definition at line 851 of file CSRPattern.h.

854  {
855  return (index >= _block_offsets[unit])
856  && ( unit == _nunits-1
857  || index < _block_offsets[unit+1]
858  );
859  }
constexpr std::enable_if< std::is_integral< IndexType >::value, IndexType >::type index(IndexType idx)
Definition: Iterator.h:60

◆ is_local() [2/2]

template<MemArrange Arrangement, typename IndexType >
bool dash::CSRPattern< 1, Arrangement, IndexType >::is_local ( IndexType  index) const
inline

Whether the given global index is local to the unit that created this pattern instance.

See also
Pattern Concept

Definition at line 867 of file CSRPattern.h.

869  {
870  auto unit = team().myid();
871  bool is_loc = index >= _block_offsets[unit] &&
872  (unit == _nunits-1 ||
873  index < _block_offsets[unit+1]);
874  return is_loc;
875  }
constexpr std::enable_if< std::is_integral< IndexType >::value, IndexType >::type index(IndexType idx)
Definition: Iterator.h:60
constexpr dash::Team & team() const noexcept
The Team containing the units to which this pattern&#39;s elements are mapped.
Definition: CSRPattern.h:1047

◆ lbegin()

template<MemArrange Arrangement, typename IndexType >
constexpr IndexType dash::CSRPattern< 1, Arrangement, IndexType >::lbegin ( ) const
inlinenoexcept

Resolves the global index of the first local element in the pattern.

See also
Pattern Concept

Definition at line 450 of file CSRPattern.h.

451  {
452  return _lbegin;
453  }

◆ lend()

template<MemArrange Arrangement, typename IndexType >
constexpr IndexType dash::CSRPattern< 1, Arrangement, IndexType >::lend ( ) const
inlinenoexcept

Resolves the global index past the last local element in the pattern.

See also
Pattern Concept

Definition at line 460 of file CSRPattern.h.

461  {
462  return _lend;
463  }

◆ local() [1/2]

template<MemArrange Arrangement, typename IndexType >
local_coords_t dash::CSRPattern< 1, Arrangement, IndexType >::local ( const std::array< IndexType, NumDimensions > &  g_coords) const
inline

Converts global coordinates to their associated unit and its respective local coordinates.

NOTE: Same as local_index.

See also
Pattern Concept

Definition at line 646 of file CSRPattern.h.

References dash::local().

648  {
649  local_index_t l_index = local(g_coords[0]);
650  local_coords_t l_coords;
651  l_coords.unit = l_index.unit;
652  l_coords.coords[0] = l_index.index;
653  return l_coords;
654  }
local_coords_t local(const std::array< IndexType, NumDimensions > &g_coords) const
Converts global coordinates to their associated unit and its respective local coordinates.
Definition: CSRPattern.h:646

◆ local() [2/2]

template<MemArrange Arrangement, typename IndexType >
local_index_t dash::CSRPattern< 1, Arrangement, IndexType >::local ( IndexType  g_index) const
inline

Converts global index to its associated unit and respective local index.

NOTE: Same as local_index.

See also
Pattern Concept

Definition at line 663 of file CSRPattern.h.

665  {
666  DASH_LOG_TRACE_VAR("CSRPattern.local()", g_index);
667  local_index_t l_index;
668 
669  for (team_unit_t unit_idx{0}; unit_idx < _nunits; ++unit_idx) {
670  if (g_index < _local_sizes[unit_idx]) {
671  l_index.unit = unit_idx;
672  l_index.index = g_index;
673  DASH_LOG_TRACE("CSRPattern.local >",
674  "unit:", l_index.unit,
675  "index:", l_index.index);
676  return l_index;
677  }
678  g_index -= _local_sizes[unit_idx];
679  }
680  DASH_THROW(
682  "CSRPattern.local: " <<
683  "global index " << g_index << " is out of bounds");
684  }
struct dash::unit_id< dash::local_unit, dart_team_unit_t > team_unit_t
Unit ID to use for team-local IDs.
Definition: Types.h:319

◆ local_at() [1/2]

template<MemArrange Arrangement, typename IndexType >
constexpr IndexType dash::CSRPattern< 1, Arrangement, IndexType >::local_at ( const std::array< IndexType, NumDimensions > &  local_coords,
const ViewSpec_t viewspec 
) const
inlinenoexcept

local

Convert given local coordinates and viewspec to linear local offset (index).

See also
Pattern Concept
Parameters
local_coordsPoint in local memory
viewspecView specification (offsets) to apply on coords

Definition at line 617 of file CSRPattern.h.

622  {
623  return local_coords[0] + viewspec.offset(0);
624  }
constexpr std::array< IndexType, NumDimensions > local_coords(const std::array< IndexType, NumDimensions > &g_coords) const
Converts global coordinates to their associated unit&#39;s respective local coordinates.
Definition: CSRPattern.h:692

◆ local_at() [2/2]

template<MemArrange Arrangement, typename IndexType >
constexpr IndexType dash::CSRPattern< 1, Arrangement, IndexType >::local_at ( const std::array< IndexType, NumDimensions > &  local_coords) const
inline

Convert given local coordinates to linear local offset (index).

See also
Pattern Concept
Parameters
local_coordsPoint in local memory

Definition at line 631 of file CSRPattern.h.

634  {
635  return local_coords[0];
636  }
constexpr std::array< IndexType, NumDimensions > local_coords(const std::array< IndexType, NumDimensions > &g_coords) const
Converts global coordinates to their associated unit&#39;s respective local coordinates.
Definition: CSRPattern.h:692

◆ local_block()

template<MemArrange Arrangement, typename IndexType >
ViewSpec_t dash::CSRPattern< 1, Arrangement, IndexType >::local_block ( index_type  l_block_index) const
inline

View spec (offset and extents) of block at local linear block index in global cartesian element space.

Definition at line 922 of file CSRPattern.h.

924  {
925  DASH_LOG_DEBUG_VAR("CSRPattern<1>.local_block()", l_block_index);
926  DASH_ASSERT_EQ(
927  0, l_block_index,
928  "CSRPattern always assigns exactly 1 block to a single unit");
929  index_type block_offset = _block_offsets[_team->myid()];
930  size_type block_size = _local_sizes[_team->myid()];
931  std::array<index_type, NumDimensions> offsets = {{ block_offset }};
932  std::array<size_type, NumDimensions> extents = {{ block_size }};
933  ViewSpec_t block_vs(offsets, extents);
934  DASH_LOG_DEBUG_VAR("CSRPattern<1>.local_block >", block_vs);
935  return block_vs;
936  }
constexpr const std::array< SizeType, NumDimensions > extents() const noexcept
Size specification of the index space mapped by this pattern.
Definition: CSRPattern.h:1076

◆ local_block_local()

template<MemArrange Arrangement, typename IndexType >
ViewSpec_t dash::CSRPattern< 1, Arrangement, IndexType >::local_block_local ( index_type  l_block_index) const
inline

View spec (offset and extents) of block at local linear block index in local cartesian element space.

Definition at line 942 of file CSRPattern.h.

944  {
945  DASH_LOG_DEBUG_VAR("CSRPattern<1>.local_block_local >", l_block_index);
946  size_type block_size = _local_sizes[_team->myid()];
947  std::array<index_type, NumDimensions> offsets = {{ 0 }};
948  std::array<size_type, NumDimensions> extents = {{ block_size }};
949  ViewSpec_t block_vs(offsets, extents);
950  DASH_LOG_DEBUG_VAR("CSRPattern<1>.local_block_local >", block_vs);
951  return block_vs;
952  }
constexpr const std::array< SizeType, NumDimensions > extents() const noexcept
Size specification of the index space mapped by this pattern.
Definition: CSRPattern.h:1076

◆ local_capacity()

template<MemArrange Arrangement, typename IndexType >
constexpr SizeType dash::CSRPattern< 1, Arrangement, IndexType >::local_capacity ( ) const
inlinenoexcept

Maximum number of elements assigned to a single unit in total, equivalent to the local capacity of every unit in this pattern.

See also
Pattern Concept

Definition at line 987 of file CSRPattern.h.

988  {
989  return _local_capacity;
990  }

◆ local_coords()

template<MemArrange Arrangement, typename IndexType >
constexpr std::array<IndexType, NumDimensions> dash::CSRPattern< 1, Arrangement, IndexType >::local_coords ( const std::array< IndexType, NumDimensions > &  g_coords) const
inline

Converts global coordinates to their associated unit's respective local coordinates.

See also
Pattern Concept

Definition at line 692 of file CSRPattern.h.

References dash::local().

694  {
695  return std::array<IndexType, 1> {{ local(g_coords[0]).index }};
696  }
local_coords_t local(const std::array< IndexType, NumDimensions > &g_coords) const
Converts global coordinates to their associated unit and its respective local coordinates.
Definition: CSRPattern.h:646

◆ local_extent()

template<MemArrange Arrangement, typename IndexType >
IndexType dash::CSRPattern< 1, Arrangement, IndexType >::local_extent ( dim_t  dim) const
inline

The actual number of elements in this pattern that are local to the calling unit in the given dimension.

See also
local_extents()
blocksize()
local_size()
extent()
Pattern Concept

Definition at line 565 of file CSRPattern.h.

566  {
567  DASH_ASSERT_EQ(
568  0, dim,
569  "Wrong dimension for Pattern::local_extent. " <<
570  "Expected dimension = 0, got " << dim);
571  return _local_size;
572  }

◆ local_extents() [1/2]

template<MemArrange Arrangement, typename IndexType >
constexpr std::array<SizeType, NumDimensions> dash::CSRPattern< 1, Arrangement, IndexType >::local_extents ( ) const
inlinenoexcept

The actual number of elements in this pattern that are local to the calling unit, by dimension.

See also
local_extent()
blocksize()
local_size()
extent()
Pattern Concept

Definition at line 586 of file CSRPattern.h.

587  {
588  return std::array<SizeType, 1> {{ _local_sizes[_team->myid()] }};
589  }

◆ local_extents() [2/2]

template<MemArrange Arrangement, typename IndexType >
constexpr std::array<SizeType, NumDimensions> dash::CSRPattern< 1, Arrangement, IndexType >::local_extents ( team_unit_t  unit) const
inlinenoexcept

The actual number of elements in this pattern that are local to the given unit, by dimension.

See also
local_extent()
blocksize()
local_size()
extent()
Pattern Concept

Definition at line 601 of file CSRPattern.h.

603  {
604  return std::array<SizeType, 1> {{ _local_sizes[unit] }};
605  }

◆ local_index()

template<MemArrange Arrangement, typename IndexType >
constexpr local_index_t dash::CSRPattern< 1, Arrangement, IndexType >::local_index ( const std::array< IndexType, NumDimensions > &  g_coords) const
inline

Converts global coordinates to their associated unit and their respective local index.

See also
Pattern Concept

Definition at line 704 of file CSRPattern.h.

References dash::local().

706  {
707  return local(g_coords[0]);
708  }
local_coords_t local(const std::array< IndexType, NumDimensions > &g_coords) const
Converts global coordinates to their associated unit and its respective local coordinates.
Definition: CSRPattern.h:646

◆ local_size()

template<MemArrange Arrangement, typename IndexType >
constexpr SizeType dash::CSRPattern< 1, Arrangement, IndexType >::local_size ( ) const
inlinenoexcept

The actual number of elements in this pattern that are local to the calling unit in total.

See also
blocksize()
local_extent()
local_capacity()
Pattern Concept

Definition at line 1003 of file CSRPattern.h.

1004  {
1005  return _local_size;
1006  }

◆ max_blocksize()

template<MemArrange Arrangement, typename IndexType >
constexpr SizeType dash::CSRPattern< 1, Arrangement, IndexType >::max_blocksize ( ) const
inlinenoexcept

Maximum number of elements in a single block in all dimensions.

Returns
The maximum number of elements in a single block assigned to a unit.
See also
Pattern Concept

Definition at line 976 of file CSRPattern.h.

977  {
978  return _local_capacity;
979  }

◆ memory_order()

template<MemArrange Arrangement, typename IndexType >
static constexpr MemArrange dash::CSRPattern< 1, Arrangement, IndexType >::memory_order ( )
inlinestatic

Memory order followed by the pattern.

Definition at line 1120 of file CSRPattern.h.

1121  {
1122  return Arrangement;
1123  }

◆ ndim()

template<MemArrange Arrangement, typename IndexType >
static constexpr dim_t dash::CSRPattern< 1, Arrangement, IndexType >::ndim ( )
inlinestatic

Number of dimensions of the cartesian space partitioned by the pattern.

Definition at line 1129 of file CSRPattern.h.

References dash::global(), dash::max_element(), dash::size(), and dash::Team::size().

1130  {
1131  return 1;
1132  }

◆ num_units()

template<MemArrange Arrangement, typename IndexType >
constexpr IndexType dash::CSRPattern< 1, Arrangement, IndexType >::num_units ( ) const
inlinenoexcept

The number of units to which this pattern's elements are mapped.

See also
Pattern Concept

Definition at line 1018 of file CSRPattern.h.

1019  {
1020  return _nunits;
1021  }

◆ operator!=()

template<MemArrange Arrangement, typename IndexType >
constexpr bool dash::CSRPattern< 1, Arrangement, IndexType >::operator!= ( const self_t &  other) const
inlinenoexcept

Inquality comparison operator.

Parameters
otherPattern instance to compare for inequality

Definition at line 438 of file CSRPattern.h.

441  {
442  return !(*this == other);
443  }

◆ operator=() [1/2]

template<MemArrange Arrangement, typename IndexType >
self_t& dash::CSRPattern< 1, Arrangement, IndexType >::operator= ( const self_t &  other)
default

Assignment operator.

◆ operator=() [2/2]

template<MemArrange Arrangement, typename IndexType >
self_t& dash::CSRPattern< 1, Arrangement, IndexType >::operator= ( self_t &&  other)
default

Move-assignment operator.

◆ operator==()

template<MemArrange Arrangement, typename IndexType >
constexpr bool dash::CSRPattern< 1, Arrangement, IndexType >::operator== ( const self_t &  other) const
inlinenoexcept

Equality comparison operator.

Parameters
otherPattern instance to compare for equality

Definition at line 420 of file CSRPattern.h.

423  {
424  return (this == &other) ||
425  ( // no need to compare all members as most are derived from
426  // constructor arguments.
427  _size == other._size &&
428  _local_sizes == other._local_sizes &&
429  _distspec == other._distspec &&
430  _teamspec == other._teamspec &&
431  _nunits == other._nunits
432  );
433  }

◆ size()

template<MemArrange Arrangement, typename IndexType >
constexpr IndexType dash::CSRPattern< 1, Arrangement, IndexType >::size ( ) const
inlinenoexcept

The number of elements arranged in this pattern.

See also
Pattern Concept

Definition at line 1038 of file CSRPattern.h.

1039  {
1040  return _size;
1041  }

◆ sizespec()

template<MemArrange Arrangement, typename IndexType >
constexpr SizeSpec_t dash::CSRPattern< 1, Arrangement, IndexType >::sizespec ( ) const
inlinenoexcept

Size specification of the index space mapped by this pattern.

See also
Pattern Concept

Definition at line 1065 of file CSRPattern.h.

1066  {
1067  return SizeSpec_t(std::array<SizeType, 1> {{ _size }});
1068  }

◆ team()

template<MemArrange Arrangement, typename IndexType >
constexpr dash::Team& dash::CSRPattern< 1, Arrangement, IndexType >::team ( ) const
inlinenoexcept

The Team containing the units to which this pattern's elements are mapped.

Definition at line 1047 of file CSRPattern.h.

1048  {
1049  return *_team;
1050  }

◆ teamspec()

template<MemArrange Arrangement, typename IndexType >
constexpr const TeamSpec_t& dash::CSRPattern< 1, Arrangement, IndexType >::teamspec ( ) const
inlinenoexcept

Cartesian arrangement of the Team containing the units to which this pattern's elements are mapped.

See also
Pattern Concept

Definition at line 1087 of file CSRPattern.h.

1088  {
1089  return _teamspec;
1090  }

◆ unit_at() [1/4]

template<MemArrange Arrangement, typename IndexType >
constexpr team_unit_t dash::CSRPattern< 1, Arrangement, IndexType >::unit_at ( const std::array< IndexType, NumDimensions > &  coords,
const ViewSpec_t viewspec 
) const
inline

unit_at

Convert given point in pattern to its assigned unit id.

See also
Pattern Concept
Parameters
coordsAbsolute coordinates of the point
viewspecView specification (offsets) to apply on coords

Definition at line 474 of file CSRPattern.h.

479  {
480  return unit_at(coords[0] + viewspec.offset(0));
481  }
constexpr team_unit_t unit_at(const std::array< IndexType, NumDimensions > &coords, const ViewSpec_t &viewspec) const
unit_at
Definition: CSRPattern.h:474
constexpr std::array< IndexType, NumDimensions > coords(IndexType index) const noexcept
Convert given global linear offset (index) to global cartesian coordinates.
Definition: CSRPattern.h:1098

◆ unit_at() [2/4]

template<MemArrange Arrangement, typename IndexType >
constexpr team_unit_t dash::CSRPattern< 1, Arrangement, IndexType >::unit_at ( const std::array< IndexType, NumDimensions > &  g_coords) const
inline

Convert given coordinate in pattern to its assigned unit id.

See also
Pattern Concept

Definition at line 488 of file CSRPattern.h.

490  {
491  return unit_at(g_coords[0]);
492  }
constexpr team_unit_t unit_at(const std::array< IndexType, NumDimensions > &coords, const ViewSpec_t &viewspec) const
unit_at
Definition: CSRPattern.h:474

◆ unit_at() [3/4]

template<MemArrange Arrangement, typename IndexType >
constexpr team_unit_t dash::CSRPattern< 1, Arrangement, IndexType >::unit_at ( IndexType  global_pos,
const ViewSpec_t viewspec 
) const
inline

Convert given global linear index to its assigned unit id.

See also
Pattern Concept
Parameters
global_posGlobal linear element offset
viewspecView to apply global position

Definition at line 499 of file CSRPattern.h.

504  {
505  return unit_at(global_pos + viewspec.offset(0));
506  }
constexpr team_unit_t unit_at(const std::array< IndexType, NumDimensions > &coords, const ViewSpec_t &viewspec) const
unit_at
Definition: CSRPattern.h:474

◆ unit_at() [4/4]

template<MemArrange Arrangement, typename IndexType >
team_unit_t dash::CSRPattern< 1, Arrangement, IndexType >::unit_at ( IndexType  g_index) const
inline

Convert given global linear index to its assigned unit id.

See also
Pattern Concept
Parameters
g_indexGlobal linear element offset

Definition at line 513 of file CSRPattern.h.

516  {
517  DASH_LOG_TRACE_VAR("CSRPattern.unit_at()", g_index);
518 
519  for (team_unit_t unit_idx{0}; unit_idx < _nunits; ++unit_idx) {
520  if (g_index < _local_sizes[unit_idx]) {
521  DASH_LOG_TRACE_VAR("CSRPattern.unit_at >", unit_idx);
522  return unit_idx;
523  }
524  g_index -= _local_sizes[unit_idx];
525  }
526  DASH_THROW(
528  "CSRPattern.unit_at: " <<
529  "global index " << g_index << " is out of bounds");
530  }
struct dash::unit_id< dash::local_unit, dart_team_unit_t > team_unit_t
Unit ID to use for team-local IDs.
Definition: Types.h:319

The documentation for this class was generated from the following file: