DASH
0.3.0
|
Forward-declaration. More...
#include <LocalMatrixRef.h>
Public Types | |
typedef GlobStaticMem< LocalMemSpaceT > | GlobMem_t |
typedef ElementT | value_type |
typedef PatternT::size_type | size_type |
typedef PatternT::index_type | difference_type |
typedef PatternT::index_type | index_type |
typedef GlobIter< value_type, Pattern_t, GlobMem_t > | iterator |
typedef GlobIter< const value_type, Pattern_t, GlobMem_t > | const_iterator |
typedef std::reverse_iterator< iterator > | reverse_iterator |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
typedef GlobRef< value_type > | reference |
typedef GlobRef< value_type >::const_type | const_reference |
typedef iterator::pointer | pointer |
typedef pointer::const_type | const_pointer |
typedef ElementT * | local_pointer |
typedef const ElementT * | const_local_pointer |
typedef DistributionSpec< NumDimensions > | distribution_spec |
typedef SizeSpec< NumDimensions, typename PatternT::size_type > | size_spec |
typedef TeamSpec< NumDimensions, typename PatternT::index_type > | team_spec |
typedef std::array< typename PatternT::size_type, NumDimensions > | extents_type |
typedef std::array< typename PatternT::index_type, NumDimensions > | offsets_type |
typedef LocalMatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemSpaceT > | local_type |
Type specifying the view on local matrix elements. More... | |
typedef LocalMatrixRef< const ElementT, NumDimensions, NumDimensions, PatternT, LocalMemSpaceT > | const_local_type |
Type specifying the view on const local matrix elements. More... | |
typedef PatternT | pattern_type |
The type of the pattern specifying linear iteration order and how elements are distribute to units. More... | |
template<dim_t NumViewDim> | |
using | view_type = MatrixRef< ElementT, NumDimensions, NumViewDim, PatternT, LocalMemSpaceT > |
Type of views on matrix elements such as sub-matrices, row- and column vectors. More... | |
template<dim_t NumViewDim> | |
using | const_view_type = MatrixRef< const ElementT, NumDimensions, NumViewDim, PatternT, LocalMemSpaceT > |
Type of views on matrix elements such as sub-matrices, row- and column vectors. More... | |
typedef std::integral_constant< dim_t, NumDimensions > | rank |
Public Member Functions | |
Matrix (Team &team=dash::Team::Null()) | |
Default constructor, for delayed allocation. More... | |
Matrix (const size_spec &ss, const distribution_spec &ds=distribution_spec(), Team &t=dash::Team::All(), const team_spec &ts=team_spec()) | |
Constructor, creates a new instance of Matrix. More... | |
Matrix (const PatternT &pat) | |
Constructor, creates a new instance of Matrix from a pattern instance. More... | |
template<typename... Args> | |
Matrix (SizeType arg, Args &&... args) | |
Constructor, creates a new instance of Matrix of given extents. More... | |
Matrix (const self_t &)=delete | |
Copy-constructor, deleted. More... | |
Matrix (self_t &&other) | |
Move-constructor, supported. More... | |
~Matrix () | |
Destructor, frees underlying memory. More... | |
self_t & | operator= (const self_t &other)=delete |
Copy-assignment operator, deleted. More... | |
self_t & | operator= (self_t &&other) |
Move-assignment operator, supported. More... | |
view_type< NumDimensions > | block (const std::array< index_type, NumDimensions > &block_gcoords) |
View at block at given global block coordinates. More... | |
view_type< NumDimensions > | block (index_type block_gindex) |
View at block at given global block offset. More... | |
bool | allocate (const size_spec &sizespec, const distribution_spec &distribution, const team_spec &teamspec, dash::Team &team=dash::Team::All()) |
Explicit allocation of matrix elements, used for delayed allocation of default-constructed Matrix instance. More... | |
bool | allocate (const PatternT &pattern) |
Allocation and distribution of matrix elements as specified by a given Pattern instance. More... | |
template<typename... Args> | |
bool | allocate (SizeType arg, Args... args) |
Allocation and distribution of matrix elements as specified by given extents. More... | |
void | deallocate () |
Explicit deallocation of matrix elements, called implicitly in destructor and team deallocation. More... | |
constexpr Team & | team () const noexcept |
constexpr size_type | size () const noexcept |
constexpr size_type | local_size () const noexcept |
constexpr size_type | local_capacity () const noexcept |
constexpr size_type | extent (dim_t dim) const noexcept |
constexpr extents_type | extents () const noexcept |
constexpr index_type | offset (dim_t dim) const noexcept |
constexpr offsets_type | offsets () const noexcept |
constexpr bool | empty () const noexcept |
void | barrier () const |
Synchronize units associated with the matrix. More... | |
void | flush () |
Complete all outstanding non-blocking operations to all units on the container's underlying global memory. More... | |
void | flush (dash::team_unit_t target) |
Complete all outstanding non-blocking operations to the specified unit on the container's underlying global memory. More... | |
void | flush_local () |
Locally complete all outstanding non-blocking operations to all units on the container's underlying global memory. More... | |
void | flush_local (dash::team_unit_t target) |
Locally complete all outstanding non-blocking operations to the specified unit on the container's underlying global memory. More... | |
constexpr const Pattern_t & | pattern () const |
The pattern used to distribute matrix elements to units in its associated team. More... | |
iterator | begin () noexcept |
Iterator referencing first matrix element in global index space. More... | |
constexpr const_iterator | begin () const noexcept |
Iterator referencing first matrix element in global index space. More... | |
iterator | end () noexcept |
Iterator referencing past the last matrix element in global index space. More... | |
constexpr const_iterator | end () const noexcept |
Iterator referencing past the last matrix element in global index space. More... | |
ElementT * | lbegin () noexcept |
Pointer to first element in local range. More... | |
constexpr const ElementT * | lbegin () const noexcept |
Pointer to first element in local range. More... | |
ElementT * | lend () noexcept |
Pointer past final element in local range. More... | |
constexpr const ElementT * | lend () const noexcept |
Pointer past final element in local range. More... | |
template<dim_t __NumViewDim = NumDimensions-1> | |
std::enable_if<(__NumViewDim !=0), const_view_type< __NumViewDim > >::type constexpr | operator[] (size_type n) const |
Subscript operator, returns a submatrix reference at given offset in global element range. More... | |
template<dim_t __NumViewDim = NumDimensions-1> | |
std::enable_if<(__NumViewDim==0), const_reference >::type constexpr | operator[] (size_type n) const |
Subscript operator, returns a GlobRef if matrix has only one dimension. More... | |
template<dim_t __NumViewDim = NumDimensions-1> | |
std::enable_if<(__NumViewDim !=0), view_type< __NumViewDim > >::type | operator[] (size_type n) |
Subscript operator, returns a submatrix reference at given offset in global element range. More... | |
template<dim_t __NumViewDim = NumDimensions-1> | |
std::enable_if<(__NumViewDim==0), reference >::type | operator[] (size_type n) |
Subscript operator, returns a GlobRef if matrix has only one dimension. More... | |
template<dim_t SubDimension> | |
const_view_type< NumDimensions > | sub (size_type n, size_type range) const |
template<dim_t SubDimension> | |
view_type< NumDimensions > | sub (size_type n, size_type range) |
template<dim_t SubDimension> | |
const_view_type< NumDimensions-1 > | sub (size_type n) const |
Projection to given offset in a sub-dimension. More... | |
template<dim_t SubDimension> | |
view_type< NumDimensions-1 > | sub (size_type n) |
Projection to given offset in a sub-dimension. More... | |
local_type | sub_local () noexcept |
Local proxy object representing a view consisting of matrix elements that are located in the active unit's local memory. More... | |
const_view_type< NumDimensions-1 > | col (size_type n) const |
Projection to given offset in first sub-dimension (column), same as sub<0>(n) . More... | |
view_type< NumDimensions-1 > | col (size_type n) |
Projection to given offset in first sub-dimension (column), same as sub<0>(n) . More... | |
const_view_type< NumDimensions-1 > | row (size_type n) const |
Projection to given offset in second sub-dimension (rows), same as sub<1>(n) . More... | |
view_type< NumDimensions-1 > | row (size_type n) |
Projection to given offset in second sub-dimension (rows), same as sub<1>(n) . More... | |
view_type< NumDimensions > | cols (size_type offset, size_type range) |
Create a view representing the matrix slice within a column range. More... | |
view_type< NumDimensions > | rows (size_type n, size_type range) |
Create a view representing the matrix slice within a row range. More... | |
template<typename ... Args> | |
const_reference | at (Args... args) const |
Fortran-style subscript operator. More... | |
template<typename ... Args> | |
reference | at (Args... args) |
Fortran-style subscript operator. More... | |
template<typename... Args> | |
const_reference | operator() (Args... args) const |
Fortran-style subscript operator, alias for at(). More... | |
template<typename... Args> | |
reference | operator() (Args... args) |
Fortran-style subscript operator, alias for at() . More... | |
constexpr bool | is_local (size_type g_pos) const |
Whether the element at a global, canonical offset in the matrix is local to the active unit. More... | |
template<dim_t Dimension> | |
constexpr bool | is_local (size_type g_pos) const |
Whether the element at a global, canonical offset in a specific dimension of the matrix is local to the active unit. More... | |
template<int level> | |
dash::HView< self_t, level > | hview () |
operator MatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemSpaceT > () | |
Conversion operator to type MatrixRef. More... | |
Static Public Member Functions | |
static constexpr dim_t | ndim () |
Public Attributes | |
local_type | local |
Local view proxy object. More... | |
Forward-declaration.
An n-dimensional array supporting subranges and sub-dimensional projection.
Definition at line 26 of file LocalMatrixRef.h.
typedef LocalMatrixRef< const ElementT, NumDimensions, NumDimensions, PatternT, LocalMemSpaceT> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::const_local_type |
using dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::const_view_type = MatrixRef<const ElementT, NumDimensions, NumViewDim, PatternT, LocalMemSpaceT> |
typedef LocalMatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemSpaceT> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::local_type |
typedef PatternT dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::pattern_type |
using dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::view_type = MatrixRef<ElementT, NumDimensions, NumViewDim, PatternT, LocalMemSpaceT> |
|
explicit |
Default constructor, for delayed allocation.
Sets the associated team to DART_TEAM_NULL for global matrix instances that are declared before dash::Init().
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::Matrix().
|
explicit |
Constructor, creates a new instance of Matrix.
|
explicit |
Constructor, creates a new instance of Matrix from a pattern instance.
|
inline |
|
delete |
Copy-constructor, deleted.
dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::Matrix | ( | self_t && | other | ) |
Move-constructor, supported.
dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::~Matrix | ( | ) |
Destructor, frees underlying memory.
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::Matrix().
bool dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::allocate | ( | const size_spec & | sizespec, |
const distribution_spec & | distribution, | ||
const team_spec & | teamspec, | ||
dash::Team & | team = dash::Team::All() |
||
) |
Explicit allocation of matrix elements, used for delayed allocation of default-constructed Matrix instance.
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate(), and dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::Matrix().
bool dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::allocate | ( | const PatternT & | pattern | ) |
Allocation and distribution of matrix elements as specified by a given Pattern instance.
|
inline |
Allocation and distribution of matrix elements as specified by given extents.
See variadic constructor.
Definition at line 395 of file Matrix.h.
const_reference dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::at | ( | Args... | args | ) | const |
Fortran-style subscript operator.
As an example, the operation matrix(i,j)
is equivalent to matrix
[i][j].
args | Global coordinates |
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().
reference dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::at | ( | Args... | args | ) |
Fortran-style subscript operator.
As an example, the operation matrix(i,j)
is equivalent to matrix
[i][j].
args | Global coordinates |
|
inline |
Synchronize units associated with the matrix.
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().
|
noexcept |
Iterator referencing first matrix element in global index space.
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().
|
noexcept |
Iterator referencing first matrix element in global index space.
view_type<NumDimensions> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::block | ( | const std::array< index_type, NumDimensions > & | block_gcoords | ) |
View at block at given global block coordinates.
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::Matrix().
view_type<NumDimensions> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::block | ( | index_type | block_gindex | ) |
View at block at given global block offset.
const_view_type<NumDimensions-1> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::col | ( | size_type | n | ) | const |
Projection to given offset in first sub-dimension (column), same as sub<0>(n)
.
n | Column offset. |
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().
view_type<NumDimensions-1> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::col | ( | size_type | n | ) |
view_type<NumDimensions> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::cols | ( | size_type | offset, |
size_type | range | ||
) |
Create a view representing the matrix slice within a column range.
Same as sub<1>(offset, extent)
.
offset | Offset of first column in range. |
range | Number of columns in the range. |
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().
void dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::deallocate | ( | ) |
Explicit deallocation of matrix elements, called implicitly in destructor and team deallocation.
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().
|
noexcept |
Iterator referencing past the last matrix element in global index space.
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().
|
noexcept |
Iterator referencing past the last matrix element in global index space.
|
inline |
Complete all outstanding non-blocking operations to all units on the container's underlying global memory.
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().
|
inline |
Complete all outstanding non-blocking operations to the specified unit on the container's underlying global memory.
|
inline |
Locally complete all outstanding non-blocking operations to all units on the container's underlying global memory.
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().
|
inline |
Locally complete all outstanding non-blocking operations to the specified unit on the container's underlying global memory.
constexpr bool dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::is_local | ( | size_type | g_pos | ) | const |
Whether the element at a global, canonical offset in the matrix is local to the active unit.
g_pos | Canonical offset in global index space. |
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().
constexpr bool dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::is_local | ( | size_type | g_pos | ) | const |
Whether the element at a global, canonical offset in a specific dimension of the matrix is local to the active unit.
g_pos | Linear offset in the selected dimension. |
|
noexcept |
Pointer to first element in local range.
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate(), and dash::halo::HaloMatrixWrapper< MatrixT, SigReady >::stencil_operator().
|
noexcept |
Pointer to first element in local range.
|
noexcept |
Pointer past final element in local range.
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().
|
noexcept |
Pointer past final element in local range.
dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::operator MatrixRef< ElementT, NumDimensions, NumDimensions, PatternT, LocalMemSpaceT > | ( | ) |
Conversion operator to type MatrixRef.
const_reference dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::operator() | ( | Args... | args | ) | const |
Fortran-style subscript operator, alias for at().
As an example, the operation matrix(i,j)
is equivalent to matrix
[i][j].
args | Global coordinates |
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().
reference dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::operator() | ( | Args... | args | ) |
|
delete |
Copy-assignment operator, deleted.
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::Matrix().
self_t& dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::operator= | ( | self_t && | other | ) |
Move-assignment operator, supported.
std::enable_if< (__NumViewDim != 0), const_view_type<__NumViewDim> >::type constexpr dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::operator[] | ( | size_type | n | ) | const |
Subscript operator, returns a submatrix reference at given offset in global element range.
n | Offset in highest matrix dimension. |
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().
std::enable_if< (__NumViewDim == 0), const_reference >::type constexpr dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::operator[] | ( | size_type | n | ) | const |
Subscript operator, returns a GlobRef if matrix has only one dimension.
n | Offset in highest matrix dimension. |
std::enable_if<(__NumViewDim != 0), view_type<__NumViewDim> >::type dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::operator[] | ( | size_type | n | ) |
Subscript operator, returns a submatrix reference at given offset in global element range.
n | Offset in highest matrix dimension. |
std::enable_if<(__NumViewDim == 0), reference>::type dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::operator[] | ( | size_type | n | ) |
Subscript operator, returns a GlobRef if matrix has only one dimension.
n | Offset in highest matrix dimension. |
constexpr const Pattern_t& dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::pattern | ( | ) | const |
The pattern used to distribute matrix elements to units in its associated team.
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate(), dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::Matrix(), and dash::halo::HaloMatrixWrapper< MatrixT, SigReady >::set_custom_halos().
const_view_type<NumDimensions-1> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::row | ( | size_type | n | ) | const |
Projection to given offset in second sub-dimension (rows), same as sub<1>(n)
.
n | Row offset. |
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().
view_type<NumDimensions-1> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::row | ( | size_type | n | ) |
view_type<NumDimensions> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::rows | ( | size_type | n, |
size_type | range | ||
) |
Create a view representing the matrix slice within a row range.
Same as sub<0>(offset, extent)
.
n | Offset of first row in range. |
range | Number of rows in the range. |
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().
const_view_type<NumDimensions> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::sub | ( | size_type | n, |
size_type | range | ||
) | const |
n | Offset of the sub-range. |
range | Width of the sub-range. |
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().
view_type<NumDimensions> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::sub | ( | size_type | n, |
size_type | range | ||
) |
n | Offset of the sub-range. |
range | Width of the sub-range. |
const_view_type<NumDimensions-1> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::sub | ( | size_type | n | ) | const |
view_type<NumDimensions-1> dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::sub | ( | size_type | n | ) |
|
noexcept |
Local proxy object representing a view consisting of matrix elements that are located in the active unit's local memory.
Referenced by dash::Matrix< _element_type, _rank::value, IndexType, _pattern_type >::allocate().
local_type dash::Matrix< ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT >::local |