DASH  0.3.0
dash Namespace Reference

This class is a simple memory pool which holds allocates elements of size ValueType. More...

Namespaces

 atomic
 Routines to perform atomic operations on atomics residing in the global address space.
 
 io
 Specification of the DASH Container IO interfaces.
 

Classes

struct  allocation_dynamic
 
struct  allocation_static
 Allocation Policy. More...
 
struct  allocator_traits
 
class  Array
 A distributed array. More...
 
class  ArrayRef
 Proxy type representing an access modifier on elements in a dash::Array. More...
 
class  ArrayRefView
 Proxy type representing a view specifier on elements in a dash::Array. More...
 
class  Atomic
 Type wrapper to mark any trivial type atomic. More...
 
struct  bit_and
 Reduce operands with binary AND. More...
 
struct  bit_or
 Reduce operands with binary OR. More...
 
struct  bit_xor
 Reduce operands with binary XOR. More...
 
class  BlockPattern
 Defines how a list of global indices is mapped to single units within a Team. More...
 
class  BlockPattern< 1, Arrangement, IndexType >
 Defines how a list of global indices is mapped to single units within a Team. More...
 
class  BytesPerCycleMeasure
 
class  CartesianIndexSpace
 Defines a cartesian, totally-ordered index space by mapping linear indices to cartesian coordinates depending on memory order. More...
 
class  CartesianSpace
 Cartesian space defined by extents in n dimensions. More...
 
struct  CartView
 Cartesian view class. More...
 
class  CartViewBase
 Base class for a cartesian view, i.e. More...
 
class  Coarray
 A fortran style coarray. More...
 
class  Coevent
 A fortran style coevent. More...
 
class  CompositeView
 
class  Comutex
 A fortran style comutex. More...
 
struct  conjunction
 
struct  conjunction< Cond0 >
 
struct  conjunction< Cond0, CondN... >
 
class  CSRPattern< 1, Arrangement, IndexType >
 Irregular Pattern for Compressed Sparse Row Storage. More...
 
struct  dart_datatype
 Type trait for mapping to DART data types. More...
 
struct  dart_operation
 Query the underlying dart_operation_t for arbitrary binary operations. More...
 
struct  dart_punned_datatype
 Type trait for mapping to punned DART data type for reduce operations. More...
 
struct  dart_storage
 Convencience wrapper to determine the DART type and number of elements required for the given template parameter type T and the desired number of values nvalues. More...
 
class  DefaultDeleter
 
class  Deferred
 
class  Dimensional
 Base class for dimensional attributes, stores an n-dimensional value with identical type all dimensions. More...
 
class  Distribution
 Specifies how a Pattern distributes elements to units in a specific dimension. More...
 
class  DistributionSpec
 DistributionSpec describes distribution patterns of all dimensions,. More...
 
class  Domain
 
class  DynamicPattern< 1, Arrangement, IndexType >
 Irregular dynamic pattern. More...
 
class  EpochSynchronizedAllocator
 Encapsulates a memory allocation and deallocation strategy of global memory regions distributed across local memory of units in a specified team. More...
 
struct  Extent
 
struct  first
 Returns second operand. More...
 
class  Future
 Implementation of a future used to wait for an operation to complete and access the value returned by that operation. More...
 
class  Future< void >
 Overload of dash::Future for operations returning void. More...
 
class  GlobalAllocator
 
class  GlobalMemorySpaceBase
 
class  GlobAsyncIter
 
class  GlobAsyncRef
 Global value reference for asynchronous / non-blocking operations. More...
 
class  GlobAsyncRef< dash::Atomic< T > >
 Specialization for atomic values. More...
 
class  GlobHeapLocalPtr
 Iterator on local buckets. More...
 
class  GlobHeapMem
 Global memory region with dynamic size. More...
 
class  GlobHeapPtr
 Iterator on global buckets. More...
 
class  GlobIter
 Iterator on Partitioned Global Address Space. More...
 
class  GlobListIter
 Bi-directional global iterator on elements of a dash::List instance. More...
 
class  GlobLocalMemoryPool
 
class  GlobPtr
 Pointer in global memory space with random access arithmetics. More...
 
class  GlobRef
 
class  GlobRef< dash::Atomic< T > >
 Specialization for atomic values. More...
 
class  GlobSharedRef
 
class  GlobStaticMem
 Global memory with address space of static size. More...
 
class  GlobViewIter
 Global iterator on an index set specified by a view modifier. More...
 
struct  has_operator_equal
 
struct  has_operator_equal_impl
 Type trait indicating whether a type has a comparision operator== defined. More...
 
class  HashLocal
 
class  HBWSpace
 
class  HIter
 
class  HostSpace
 
class  HView
 
class  HView< ContainerType, -1 >
 
class  IndexRange
 
class  IndexRange< 1, IndexType >
 
struct  is_arithmetic
 Type trait indicating whether a type can be used for arithmetic operations in global memory space. More...
 
struct  is_atomic
 type traits for dash::Atomic More...
 
struct  is_atomic< dash::Atomic< T > >
 
struct  is_atomic_compatible
 Type trait indicating whether a type can be used for global atomic operations. More...
 
struct  is_container_compatible
 Type trait indicating whether the specified type is eligible for elements of DASH containers. More...
 
struct  is_range
 Definition of type trait dash::is_range<T> with static member value indicating whether type T is a model of the Range concept. More...
 
struct  iterator_traits
 
class  IteratorRange
 Adapter template for range concept, wraps begin and end iterators in range type. More...
 
class  IteratorRange< LocalIterator *, LocalSentinel * >
 Specialization of adapter template for range concept, wraps begin and end pointers in range type. More...
 
class  IteratorViewOrigin
 
class  List
 Usage examples: More...
 
class  ListRef
 Proxy type referencing a dash::List. More...
 
class  LoadBalancePattern
 Irregular dynamic pattern. More...
 
class  LoadBalancePattern< 1, CompBasedMeasure, MemBasedMeasure, Arrangement, IndexType >
 Irregular dynamic pattern. More...
 
class  LocalArrayRef
 Proxy type representing local access to elements in a dash::Array. More...
 
struct  LocalIndexRange
 
class  LocalListRef
 Proxy type representing a local view on a referenced dash::List. More...
 
class  LocalMatrixRef
 Forward-declaration. More...
 
class  LocalMemoryLayout
 Specifies how local element indices are arranged in a specific number of dimensions. More...
 
class  LocalMemorySpaceBase
 
struct  LocalRange
 
class  Matrix
 Forward-declaration. More...
 
class  MatrixRef
 Forward-declaration. More...
 
class  MatrixRefView
 Stores information needed by subscripting and subdim selection. More...
 
struct  max
 Reduce operands to their maximum value. More...
 
struct  memory_domain_global
 The MemorySpace concept follows the STL std::pmr::memory_resource. More...
 
struct  memory_domain_local
 
struct  memory_space_contiguous
 
struct  memory_space_cuda_tag
 
struct  memory_space_hbw_tag
 
struct  memory_space_host_tag
 
struct  memory_space_noncontiguous
 
struct  memory_space_pmem_tag
 
struct  memory_space_traits
 
class  MemorySpace
 
class  MemorySpace< memory_domain_global, Args... >
 
class  MemorySpace< memory_domain_local, Args... >
 
struct  multiply
 Reduce operands to their product. More...
 
class  MultiView
 Multidimensional view. More...
 
class  Mutex
 Behaves similar to std::mutex and is used to ensure mutual exclusion within a dash team. More...
 
struct  Pair
 A trivially-copyable implementation of std::pair to be used as element type of DASH containers. More...
 
struct  pattern_constraints
 Traits for compile-time pattern constraints checking, suitable as a helper for template definitions employing SFINAE where no verbose error reporting is required. More...
 
struct  pattern_layout_properties
 {} More...
 
struct  pattern_layout_tag
 {} More...
 
struct  pattern_layout_traits
 
struct  pattern_mapping_properties
 Generic type of mapping properties of a model satisfying the Pattern concept. More...
 
struct  pattern_mapping_tag
 Container type for mapping properties of models satisfying the Pattern concept. More...
 
struct  pattern_mapping_traits
 
struct  pattern_partitioning_properties
 {} More...
 
struct  pattern_partitioning_tag
 {} More...
 
struct  pattern_partitioning_traits
 
struct  pattern_traits
 
class  PatternConcept
 Defines how a list of global indices is mapped to single units within a Team. More...
 
class  PatternIterator
 {}Usage: More...
 
struct  plus
 Reduce operands to their sum. More...
 
struct  Point
 
class  RangeBase
 
struct  remove_atomic
 type traits for dash::Atomic More...
 
struct  remove_atomic< dash::Atomic< T > >
 
struct  second
 Returns second operand. More...
 
class  SeqTilePattern
 Defines how a list of global indices is mapped to single units within a Team. More...
 
class  Shared
 Shared access to a value in global memory across a team. More...
 
class  SharedCounter
 A simple shared counter that allows atomic increment- and decrement operations. More...
 
class  ShiftTilePattern
 Defines how a list of global indices is mapped to single units within a Team. More...
 
class  SimpleMemoryPoolResource
 
class  SizeSpec
 Specifies cartesian extents in a specific number of dimensions. More...
 
class  StridedView
 
struct  synchronization_collective
 Synchronization Policy. More...
 
struct  synchronization_independent
 
struct  synchronization_single
 
class  Team
 A Team instance specifies a subset of all available units. More...
 
class  TeamPtr
 
class  TeamSpec
 Specifies the arrangement of team units in a specified number of dimensions. More...
 
class  TilePattern
 Defines how a list of global indices is mapped to single units within a Team. More...
 
class  UnitClockFreqMeasure
 
class  UniversalMember
 Utility class template to capture values from both moved temporaries (rvalues) and named references to avoid temporary copies. More...
 
class  UnorderedMap
 Usage examples: More...
 
class  UnorderedMapGlobIter
 
class  UnorderedMapLocalIter
 
class  UnorderedMapLocalRef
 Local view specifier of a dynamic map container with support for workload balancing. More...
 
struct  view_traits
 View type traits. More...
 
struct  view_traits< dash::IteratorRange< IteratorT, SentinelT > >
 Specialization of dash::view_traits for IteratorRange. More...
 
struct  view_traits< IteratorViewOrigin< Iterator, Sentinel > >
 
struct  view_traits< ViewLocalMod< DomainType, NDim > >
 
struct  view_traits< ViewOrigin< NDim > >
 
struct  view_traits< ViewSubMod< DomainType, SubDim, NDim > >
 
class  ViewBlockMod
 
class  ViewIterator
 
class  ViewIterator< DomainIterator *, IndexSetType >
 
class  ViewLocalMod
 
class  ViewModBase
 
class  ViewOrigin
 Monotype for the logical symbol that represents a view origin. More...
 
struct  ViewPair
 Offset and extent in a single dimension. More...
 
struct  ViewRange
 
struct  ViewRegion
 Representation of a ViewPair as region specified by origin and end coordinates. More...
 
class  ViewSpec
 Specifies view parameters for implementing submat, rows and cols. More...
 
class  ViewSubMod
 

Typedefs

typedef dash::pattern_partitioning_properties< dash::pattern_partitioning_tag::rectangular, dash::pattern_partitioning_tag::balanced, dash::pattern_partitioning_tag::ndimensionalsumma_pattern_partitioning_constraints
 Constraints on pattern partitioning properties of matrix operands passed to dash::summa. More...
 
typedef dash::pattern_mapping_properties< dash::pattern_mapping_tag::multiple, dash::pattern_mapping_tag::unbalancedsumma_pattern_mapping_constraints
 Constraints on pattern mapping properties of matrix operands passed to dash::summa. More...
 
typedef dash::pattern_layout_properties< dash::pattern_layout_tag::blocked, dash::pattern_layout_tag::linearsumma_pattern_layout_constraints
 Constraints on pattern layout properties of matrix operands passed to dash::summa. More...
 
template<typename MatrixType >
using summa_pattern_constraints = typename dash::pattern_constraints< dash::summa_pattern_partitioning_constraints, dash::summa_pattern_mapping_constraints, dash::summa_pattern_layout_constraints, typename MatrixType::pattern_type >
 
template<typename T , dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = Pattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
using NArray = dash::Matrix< T, NumDimensions, IndexT, PatternT, LocalMemSpaceT >
 Template alias for dash::Matrix with the same default template arguments. More...
 
template<class T >
using GlobMemAllocPtr = decltype(dash::memalloc< T >(size_t{}))
 Convenience Wrapper to retrieve easily the type allocated by dash::memalloc<T> More...
 
typedef dash::pattern_partitioning_properties< pattern_partitioning_tag::rectangular, pattern_partitioning_tag::unbalancedpattern_partitioning_default_properties
 
typedef dash::pattern_mapping_properties< pattern_mapping_tag::unbalancedpattern_mapping_default_properties
 
typedef dash::pattern_layout_properties< pattern_layout_tag::row_major, pattern_layout_tag::canonical, pattern_layout_tag::linearpattern_layout_default_properties
 
template<dim_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
using Pattern = dash::BlockPattern< NumDimensions, Arrangement, IndexType >
 Template alias for dash::Pattern with the same default template arguments. More...
 
typedef enum dash::MemArrange MemArrange
 
typedef int dim_t
 Scalar type for a dimension value, with 0 indicating the first dimension. More...
 
typedef internal::default_signed_index default_index_t
 Signed integer type used as default for index values. More...
 
typedef internal::default_unsigned_index default_extent_t
 Unsigned integer type used as default for extent values. More...
 
typedef internal::default_unsigned_index default_size_t
 Unsigned integer type used as default for size values. More...
 
typedef internal::default_signed_index gptrdiff_t
 Difference type for global pointers. More...
 
typedef struct dash::unit_id< dash::local_unit, dart_team_unit_tteam_unit_t
 Unit ID to use for team-local IDs. More...
 
typedef struct dash::unit_id< dash::global_unit, dart_global_unit_tglobal_unit_t
 Unit ID to use for global IDs. More...
 
typedef std::max_align_t max_align_t
 

Enumerations

enum  global_allocation_policy : uint8_t { global_allocation_policy::collective, global_allocation_policy::non_collective, global_allocation_policy::epoch_synchronized }
 
enum  launch : uint16_t { launch::sync = 0x1, launch::async = 0x2 }
 
enum  MemArrange { MEM_ARRANGE_UNDEFINED = 0, ROW_MAJOR, COL_MAJOR }
 

Functions

template<typename GlobIter , typename UnaryPredicate >
bool all_of (GlobIter first, GlobIter last, UnaryPredicate p)
 Check whether all element in the range satisfy predicate p. More...
 
template<typename GlobIter , typename UnaryPredicate >
bool any_of (GlobIter first, GlobIter last, UnaryPredicate p)
 Check whether any element in the range satisfies predicate p. More...
 
template<class LocalInputIter , typename = typename std::enable_if< !dash::detail::is_global_iterator<LocalInputIter>::value >::type>
void broadcast (LocalInputIter in_first, LocalInputIter in_last, dash::team_unit_t root, dash::Team &team=dash::Team::All())
 Broadcast the local range of elements [in_first, in_last) from unit root to all other units in team. More...
 
template<class ValueType >
ValueType broadcast (dash::Shared< ValueType > &shared)
 Broadcast the value stored in dash::Shared from the unit owning the value to all other units with access to the shared object. More...
 
template<typename T >
void broadcast (Coarray< T > &coarr, const team_unit_t &root)
 Broadcasts the value on root to all other members of this co_array. More...
 
template<typename ValueType , class InputIt , class OutputIt >
OutputIt copy (InputIt in_first, InputIt in_last, OutputIt out_first)
 Copies the elements in the range, defined by [in_first, in_last), to another range beginning at out_first. More...
 
template<typename ValueType , class GlobInputIt >
dash::Future< ValueType * > copy_async (InputIt in_first, InputIt in_last, OutputIt out_first)
 Asynchronous variant of dash::copy. More...
 
template<typename GlobIter >
bool equal (GlobIter first_1, GlobIter last_1, GlobIter first_2)
 Returns true if the range [first1, last1) is equal to the range [first2, first2 + (last1 - first1)), and false otherwise. More...
 
template<typename GlobIter , class BinaryPredicate >
bool equal (GlobIter first_1, GlobIter last_1, GlobIter first_2, BinaryPredicate)
 Returns true if the range [first1, last1) is equal to the range [first2, first2 + (last1 - first1)) with respect to a specified predicate, and false otherwise. More...
 
template<typename GlobIterType >
void fill (GlobIterType first, GlobIterType last, const typename GlobIterType::value_type &value)
 Assigns the given value to the elements in the range [first, last) More...
 
template<typename GlobIter , typename ElementType >
GlobIter find (GlobIter first, GlobIter last, const ElementType &value)
 Returns an iterator to the first element in the range [first,last) that compares equal to val. More...
 
template<typename GlobIter , typename UnaryPredicate >
GlobIter find_if (GlobIter first, GlobIter last, UnaryPredicate predicate)
 Returns an iterator to the first element in the range [first,last) that satisfies the predicate p. More...
 
template<typename GlobIter , class UnaryPredicate >
GlobIter find_if_not (GlobIter first, GlobIter last, UnaryPredicate predicate)
 Returns an iterator to the first element in the range [first,last) that does not satisfy the predicate p. More...
 
template<typename GlobInputIt , class UnaryFunction >
void for_each (const GlobInputIt &first, const GlobInputIt &last, UnaryFunction func)
 Invoke a function on every element in a range distributed by a pattern. More...
 
template<typename GlobInputIt , class UnaryFunctionWithIndex >
void for_each_with_index (const GlobInputIt &first, const GlobInputIt &last, UnaryFunctionWithIndex func)
 Invoke a function on every element in a range distributed by a pattern. More...
 
template<typename GlobInputIt , class UnaryFunction >
void generate (GlobInputIt first, GlobInputIt last, UnaryFunction gen)
 Assigns each element in range [first, last) a value generated by the given function object g. More...
 
template<typename GlobInputIt , class UnaryFunction >
void generate_with_index (GlobInputIt first, GlobInputIt last, UnaryFunction gen)
 Assigns each element in range [first, last) a value generated by the given function object g. More...
 
template<dim_t SubDim, class DomainT , class OffsetT >
constexpr auto sub (OffsetT begin, OffsetT end, const DomainT &domain) -> typename std::enable_if< dash::view_traits< DomainT >::rank::value==1, ViewSubMod< DomainT, SubDim > >::type
 
template<class GlobInputIter >
std::enable_if< !GlobInputIter::has_view::value, LocalIndexRange< typename GlobInputIter::pattern_type::index_type >>::type local_index_range (const GlobInputIter &first, const GlobInputIter &last)
 Resolves the local index range between global iterators. More...
 
template<class GlobInputIter >
std::enable_if< GlobInputIter::has_view::value, LocalIndexRange< typename GlobInputIter::pattern_type::index_type >>::type local_index_range (const GlobInputIter &first, const GlobInputIter &last)
 Resolves the local index range between global view iterators. More...
 
template<class GlobIterType >
LocalRange< const typename GlobIterType::value_type > local_range (const GlobIterType &first, const GlobIterType &last)
 Resolves the local address range between global iterators. More...
 
template<class GlobIterType >
LocalRange< typename GlobIterType::value_type > local_range (GlobIterType &first, GlobIterType &last)
 
template<class ElementType , class Compare = std::less<const ElementType &>>
const ElementType * min_element (const ElementType *l_range_begin, const ElementType *l_range_end, Compare compare=std::less< const ElementType &>())
 Finds an iterator pointing to the element with the smallest value in the range [first,last). More...
 
template<typename GlobInputIt , class Compare = std::less< const typename dash::iterator_traits<GlobInputIt>::value_type &>>
GlobInputIt min_element (const typename std::enable_if< dash::iterator_traits< GlobInputIt >::is_global_iterator::value, GlobInputIt >::type &first, const GlobInputIt &last, Compare compare=Compare())
 Finds an iterator pointing to the element with the smallest value in the range [first,last). More...
 
template<class GlobIter , class Compare = std::greater<const typename GlobIter::value_type &>>
GlobIter max_element (const GlobIter &first, const GlobIter &last, Compare compare=Compare())
 Finds an iterator pointing to the element with the greatest value in the range [first,last). More...
 
template<class ElementType , class Compare = std::greater<ElementType &>>
const ElementType * max_element (const ElementType *first, const ElementType *last, Compare compare=Compare())
 Finds an iterator pointing to the element with the greatest value in the range [first,last). More...
 
template<typename BinaryOperation >
struct dash::dart_operation operator ()(const ValueType &lhs
 
template<class LocalInputIter , class InitType , class BinaryOperation = dash::plus<typename std::iterator_traits<LocalInputIter>::value_type>, typename = typename std::enable_if< !dash::detail::is_global_iterator<LocalInputIter>::value >::type>
std::iterator_traits< LocalInputIter >::value_type reduce (LocalInputIter in_first, LocalInputIter in_last, InitType init, BinaryOperation binary_op=BinaryOperation(), bool non_empty=true, dash::Team &team=dash::Team::All())
 Accumulate values in each process' range [in_first, in_last) using the provided binary reduce function binary_op, which must be commutative and associative. More...
 
template<class LocalInputIter , class InitType = typename std::iterator_traits<LocalInputIter>::value_type, typename = typename std::enable_if< !dash::detail::is_global_iterator<LocalInputIter>::value >::type>
std::iterator_traits< LocalInputIter >::value_type reduce (LocalInputIter in_first, LocalInputIter in_last, InitType init, bool non_empty, dash::Team &team=dash::Team::All())
 Accumulate values across the local ranges [in_first,in_last) of each process as the sum of all values in the range. More...
 
template<class GlobInputIt , class InitType = typename dash::iterator_traits<GlobInputIt>::value_type, class BinaryOperation = dash::plus<typename dash::iterator_traits<GlobInputIt>::value_type>, typename = typename std::enable_if< dash::detail::is_global_iterator<GlobInputIt>::value >::type>
dash::iterator_traits< GlobInputIt >::value_type reduce (GlobInputIt in_first, GlobInputIt in_last, InitType init, BinaryOperation binary_op=BinaryOperation())
 Accumulate values in the global range [in_first, in_last) using the provided binary reduce function binary_op, which must be commutative and linear. More...
 
template<class GlobRandomIt >
void sort (GlobRandomIt begin, GlobRandomIt end)
 Sorts the elements in the range, defined by [begin, end) in ascending order. More...
 
template<class GlobRandomIt , class SortableHash >
void sort (GlobRandomIt begin, GlobRandomIt end, SortableHash hash)
 Sorts the elements in the range, defined by [begin, end) in ascending order. More...
 
template<typename MatrixTypeA , typename MatrixTypeB , typename MatrixTypeC >
void summa (MatrixTypeA &A, MatrixTypeB &B, MatrixTypeC &C)
 Multiplies two matrices using the SUMMA algorithm. More...
 
template<typename MatrixTypeA , typename MatrixTypeB , typename MatrixTypeC >
void mmult (MatrixTypeA &A, MatrixTypeB &B, MatrixTypeC &C)
 Function adapter to an implementation of matrix-matrix multiplication (xDGEMM) depending on the matrix distribution patterns. More...
 
template<typename ValueType , class InputIt , class OutputIt , class UnaryOperation >
OutputIt transform (InputIt in_first, InputIt in_last, OutputIt out_first, UnaryOperation unary_op)
 Apply a given function to elements in a range and store the result in another range, beginning at out_first. More...
 
template<class InputIt1 , class GlobInputIt , class GlobOutputIt , class BinaryOperation >
GlobOutputIt transform (InputIt1 in_a_first, InputIt1 in_a_last, GlobInputIt in_b_first, GlobOutputIt out_first, BinaryOperation binary_op)
 Apply a given function to pairs of elements from two ranges and store the result in another range, beginning at out_first. More...
 
template<class T , class U , class LocalMemSpace , global_allocation_policy AllocationPolicy, template< class > class LocalAlloc>
bool operator== (const EpochSynchronizedAllocator< T, LocalMemSpace, AllocationPolicy, LocalAlloc > &lhs, const EpochSynchronizedAllocator< U, LocalMemSpace, AllocationPolicy, LocalAlloc > &rhs)
 
template<class T , class U , class LocalMemSpace , global_allocation_policy AllocationPolicy, template< class > class LocalAlloc>
bool operator!= (const EpochSynchronizedAllocator< T, LocalMemSpace, AllocationPolicy, LocalAlloc > &lhs, const EpochSynchronizedAllocator< U, LocalMemSpace, AllocationPolicy, LocalAlloc > &rhs)
 
template<class T , class GlobMemType >
constexpr bool operator== (GlobalAllocator< T, GlobMemType > lhs, GlobalAllocator< T, GlobMemType > rhs) noexcept
 
void * align (std::size_t alignment, std::size_t size, void *&ptr, std::size_t &space)
 Replacement for missing std::align in gcc < 5.0. More...
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const Atomic< T > &at)
 
template<dash::dim_t NumDimensions, typename SizeType >
std::ostream & operator<< (std::ostream &os, const dash::CartesianSpace< NumDimensions, SizeType > &cartesian_space)
 
template<dash::dim_t NumDimensions>
std::ostream & operator<< (std::ostream &os, const dash::CartesianIndexSpace< NumDimensions > &cartesian_space)
 
template<typename DimensionalType >
constexpr dim_t ndim (const DimensionalType &d)
 
template<typename DimensionalType >
constexpr dim_t rank (const DimensionalType &d)
 
template<dim_t Dim, typename DimensionalType >
constexpr DimensionalType::extent_type extent (const DimensionalType &d)
 
template<typename DimensionalType >
constexpr DimensionalType::extent_type extent (dim_t dim, const DimensionalType &d)
 
template<dim_t NumDimensions>
std::ostream & operator<< (std::ostream &os, const DistributionSpec< NumDimensions > &distspec)
 
template<typename IndexType >
std::ostream & operator<< (std::ostream &os, const ViewRange< IndexType > &viewrange)
 
template<typename IndexType >
static bool operator== (const ViewPair< IndexType > &lhs, const ViewPair< IndexType > &rhs)
 Equality comparison operator for ViewPair. More...
 
template<typename IndexType >
static bool operator!= (const ViewPair< IndexType > &lhs, const ViewPair< IndexType > &rhs)
 Inequality comparison operator for ViewPair. More...
 
template<typename IndexType >
std::ostream & operator<< (std::ostream &os, const ViewPair< IndexType > &viewpair)
 
template<typename ElementType , dim_t NumDimensions>
std::ostream & operator<< (std::ostream &os, const Dimensional< ElementType, NumDimensions > &dimensional)
 
template<dim_t NumDimensions, typename IndexType >
std::ostream & operator<< (std::ostream &os, const ViewSpec< NumDimensions, IndexType > &viewspec)
 
template<dim_t D, typename I >
std::ostream & operator<< (std::ostream &os, const dash::Domain< D, I > &dom)
 
template<typename ResultT >
std::ostream & operator<< (std::ostream &os, const Future< ResultT > &future)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const GlobAsyncRef< T > &gar)
 
template<class T , class MemSpaceT >
dash::gptrdiff_t distance ( GlobPtr< T, MemSpaceT > gbegin, GlobPtr< T, MemSpaceT > gend)
 Returns the number of hops from gbegin to gend. More...
 
template<typename T , class MemSpaceT >
std::ostream & operator<< (std::ostream &os, const GlobPtr< T, MemSpaceT > &gptr)
 
template<class T , class MemSpaceT >
DASH_CONSTEXPR std::enable_if< std::is_same< typename dash::memory_space_traits< MemSpaceT >::memory_space_layout_tag, memory_space_contiguous >::value, T >::type * local_begin (GlobPtr< T, MemSpaceT > global_begin, dash::team_unit_t unit)
 Returns the begin of the local memory portion within a global memory segment. More...
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const GlobRef< T > &gref)
 
template<typename T >
void swap (dash::GlobRef< T > &&a, dash::GlobRef< T > &&b)
 specialization for unqualified calls to swap More...
 
template<class MemSpaceT , class T >
auto addressof (dash::GlobRef< T > const &ref)
 specialization for unqualified calls to swap More...
 
template<typename T , typename P >
std::ostream & operator<< (std::ostream &os, const GlobSharedRef< T, P > &gref)
 
void init (int *argc, char ***argv)
 Initialize the DASH library and the underlying runtime system. More...
 
void finalize ()
 Finalize the DASH library and the underlying runtime system. More...
 
bool is_initialized ()
 Check whether DASH has been initialized already. More...
 
bool is_multithreaded ()
 Check whether DASH has been initialized with support for multi-threaded access. More...
 
global_unit_t myid ()
 Shortcut to query the global unit ID of the calling unit. More...
 
size_t size ()
 Return the number of units in the global team. More...
 
void barrier ()
 A global barrier involving all units. More...
 
void abort ()
 Immediately abort the application run. More...
 
void abort (int errorcode)
 Immediately abort the application run with the return value errorcode. More...
 
template<typename ElementType , class Pattern , class GlobStaticMem , class Pointer , class Reference >
std::ostream & operator<< (std::ostream &os, const dash::GlobIter< ElementType, Pattern, GlobStaticMem, Pointer, Reference > &it)
 
template<typename ElementType , class Pattern , class GlobStaticMem , class Pointer , class Reference >
auto distance (const GlobViewIter< ElementType, Pattern, GlobStaticMem, Pointer, Reference > &first, const GlobViewIter< ElementType, Pattern, GlobStaticMem, Pointer, Reference > &last) -> typename Pattern::index_type
 Resolve the number of elements between two global iterators. More...
 
template<typename ElementType , class Pattern , class GlobStaticMem , class Pointer , class Reference >
std::ostream & operator<< (std::ostream &os, const dash::GlobViewIter< ElementType, Pattern, GlobStaticMem, Pointer, Reference > &it)
 
template<class IndexType >
constexpr std::enable_if< std::is_integral< IndexType >::value, IndexType >::type index (IndexType idx)
 
template<class Iterator >
constexpr auto index (Iterator it) -> decltype((++it).gpos())
 
template<class RandomAccessIt >
RandomAccessIt::difference_type distance (const RandomAccessIt &first, const RandomAccessIt &last)
 Resolve the number of elements between two iterators. More...
 
template<typename ElementType , class Pattern , class GlobMemType , class Pointer , class Reference >
Pattern::index_type distance (const GlobIter< ElementType, Pattern, GlobMemType, Pointer, Reference > &first, const GlobIter< ElementType, Pattern, GlobMemType, Pointer, Reference > &last)
 Resolve the number of elements between two global iterators. More...
 
template<typename ElementType , class Pattern , class GlobMemType , class Pointer , class Reference >
DASH_CONSTEXPR auto operator- (const GlobIter< ElementType, Pattern, GlobMemType, Pointer, Reference > &lhs, const GlobIter< ElementType, Pattern, GlobMemType, Pointer, Reference > &rhs) DASH_NOEXCEPT
 
template<class T >
constexpr std::ptrdiff_t distance (T *const first, T *const last)
 
template<class OffsetType >
constexpr std::enable_if< std::is_integral< OffsetType >::value, OffsetType >::type distance (OffsetType begin, OffsetType end)
 
template<typename Key , typename Mapped , typename Hash , typename Pred , typename GlobMemType >
std::ostream & operator<< (std::ostream &os, const dash::UnorderedMapGlobIter< Key, Mapped, Hash, Pred, GlobMemType > &it)
 
template<typename Key , typename Mapped , typename Hash , typename Pred , typename LMemSpace >
std::ostream & operator<< (std::ostream &os, const dash::UnorderedMapLocalIter< Key, Mapped, Hash, Pred, LMemSpace > &it)
 
template<typename T_ , dim_t NumDimensions1, class PatternT_ , typename LocalMemT >
std::ostream & operator<< (std::ostream &os, const MatrixRefView< T_, NumDimensions1, PatternT_, LocalMemT > &mrefview)
 
template<typename ElementType , typename IndexType , class Pointer , class Reference >
auto distance (const dash::GlobHeapLocalPtr< ElementType, IndexType, Pointer, Reference > &first, const dash::GlobHeapLocalPtr< ElementType, IndexType, Pointer, Reference > &last) -> IndexType
 Resolve the number of elements between two local bucket iterators. More...
 
template<typename ElementType , typename IndexType , class Pointer , class Reference >
std::ostream & operator<< (std::ostream &os, const dash::GlobHeapLocalPtr< ElementType, IndexType, Pointer, Reference > &it)
 
template<typename ElementType , class MemSpaceT >
auto distance (const dash::GlobHeapPtr< ElementType, MemSpaceT > &first, const dash::GlobHeapPtr< ElementType, MemSpaceT > &last) -> typename MemSpaceT::index_type
 Resolve the number of elements between two global bucket pointers. More...
 
template<typename ElementType , class MemSpaceT >
std::ostream & operator<< (std::ostream &os, const dash::GlobHeapPtr< ElementType, MemSpaceT > &gptr)
 
template<class MSpaceDomainCategory , class MSpaceTypeCategory >
MemorySpace< MSpaceDomainCategory, MSpaceTypeCategory > * get_default_memory_space ()
 Forward declarations. More...
 
template<>
MemorySpace< memory_domain_local, memory_space_host_tag > * get_default_memory_space< memory_domain_local, memory_space_host_tag > ()
 
template<>
MemorySpace< memory_domain_local, memory_space_hbw_tag > * get_default_memory_space< memory_domain_local, memory_space_hbw_tag > ()
 
template<>
MemorySpace< memory_domain_global, memory_space_host_tag > * get_default_memory_space< memory_domain_global, memory_space_host_tag > ()
 
template<typename T >
GlobPtr< T, GlobLocalMemoryPool< dash::HostSpace > > memalloc (size_t nelem)
 
template<class T >
void memfree (GlobPtr< T, GlobLocalMemoryPool< dash::HostSpace >> gptr, size_t nels)
 
template<class Allocator >
constexpr bool operator== (DefaultDeleter< Allocator > const &, DefaultDeleter< Allocator > const &) noexcept
 
template<class T , class AllocatorT , template< class > class Deleter = dash::DefaultDeleter>
auto allocate_unique (const AllocatorT &alloc, std::size_t n)
 
template<class T >
std::string typestr (const T &obj)
 Returns string containing the type name of the given object. More...
 
template<class T >
std::string typestr ()
 Returns string containing the name of the specified type. More...
 
template<typename T , typename GlobPtrType >
void fence (const GlobPtrType &gptr)
 Block until local and global completion of operations on a global address. More...
 
template<typename T , typename GlobPtrType >
void fence_local (const GlobPtrType &gptr)
 Block until local completion of operations on a global address. More...
 
template<typename T , typename GlobPtrType >
void put_value_async (const T &newval, const GlobPtrType &gptr)
 Write a value to a global pointer, non-blocking. More...
 
template<typename T , typename GlobPtrType >
void get_value_async (T *ptr, const GlobPtrType &gptr)
 Read a value fom a global pointer, non-blocking. More...
 
template<typename T , typename GlobPtrType >
void put_value (const T &newval, const GlobPtrType &gptr)
 Write a value to a global pointer. More...
 
template<typename T , typename GlobPtrType >
void get_value (T *ptr, const GlobPtrType &gptr)
 Read a value fom a global pointer. More...
 
template<class T1 , class T2 >
constexpr bool operator== (const Pair< T1, T2 > &x, const Pair< T1, T2 > &y)
 Two pairs of the same type are equal iff their members are equal. More...
 
template<class T1 , class T2 >
constexpr bool operator< (const Pair< T1, T2 > &x, const Pair< T1, T2 > &y)
 A pair is smaller than another pair if the first member is smaller or the first is equal and the second is smaller. More...
 
template<class T1 , class T2 >
constexpr bool operator!= (const Pair< T1, T2 > &x, const Pair< T1, T2 > &y)
 Inequality comparison operator implemented in terms of equality operator. More...
 
template<class T1 , class T2 >
constexpr bool operator> (const Pair< T1, T2 > &x, const Pair< T1, T2 > &y)
 Greater-than operator implemented in terms of less-than operator. More...
 
template<class T1 , class T2 >
constexpr bool operator<= (const Pair< T1, T2 > &x, const Pair< T1, T2 > &y)
 Less-than-or-equal operator implemented in terms of less-than operator. More...
 
template<class T1 , class T2 >
constexpr bool operator>= (const Pair< T1, T2 > &x, const Pair< T1, T2 > &y)
 Greater-than-or-equal operator implemented in terms of less-than operator. More...
 
template<class T1 , class T2 >
void swap (Pair< T1, T2 > &x, Pair< T1, T2 > &y) noexcept(noexcept(x.swap(y)))
 Wrapper for Pair::swap. More...
 
template<class T1 , class T2 >
constexpr Pair< typename internal::decay_and_strip< T1 >::type, typename internal::decay_and_strip< T2 >::type > make_pair (T1 &&x, T2 &&y)
 Convennience wrapper to create a Pair object. More...
 
template<class T1 , class T2 >
std::ostream & operator<< (std::ostream &os, const Pair< T1, T2 > &pair)
 
template<typename PartitioningTags , typename MappingTags , typename LayoutTags , class SizeSpecType >
TeamSpec< SizeSpecType::ndim::value, typename SizeSpecType::index_type > make_team_spec (const SizeSpecType &sizespec, int n_units, typename SizeSpecType::size_type n_nodes=0, typename SizeSpecType::size_type n_numa_dom=0, typename SizeSpecType::size_type n_cores=0)
 
template<typename PartitioningTags , typename MappingTags , typename LayoutTags , class SizeSpecType >
TeamSpec< SizeSpecType::ndim::value, typename SizeSpecType::index_type > make_team_spec (const SizeSpecType &sizespec, dash::Team &team=dash::Team::All(), typename SizeSpecType::size_type n_nodes=0, typename SizeSpecType::size_type n_numa_dom=0, typename SizeSpecType::size_type n_cores=0)
 {} More...
 
template<typename PartitioningTags , typename MappingTags , typename LayoutTags , class SizeSpecType , class TeamSpecType >
DistributionSpec< SizeSpecType::ndim::value > make_distribution_spec (const SizeSpecType &sizespec, const TeamSpecType &teamspec)
 Generic Abstract Factory for instances of dash::DistributionSpec. More...
 
template<typename PartitioningTags = dash::pattern_partitioning_default_properties, typename MappingTags = dash::pattern_mapping_default_properties, typename LayoutTags = dash::pattern_layout_default_properties, class SizeSpecType , class TeamSpecType >
std::enable_if< !MappingTags::diagonal &&PartitioningTags::rectangular &&PartitioningTags::balanced &&!PartitioningTags::unbalanced &&LayoutTags::blocked, TilePattern< SizeSpecType::ndim::value, dash::ROW_MAJOR, typename SizeSpecType::index_type >>::type make_pattern (const SizeSpecType &sizespec, const TeamSpecType &teamspec)
 Generic Abstract Factory for models of the Pattern concept. More...
 
template<typename PartitioningTags = dash::pattern_partitioning_default_properties, typename MappingTags = dash::pattern_mapping_default_properties, typename LayoutTags = dash::pattern_layout_default_properties, class SizeSpecType , class TeamSpecType >
std::enable_if< MappingTags::diagonal &&(LayoutTags::blocked||(PartitioningTags::balanced &&SizeSpecType::ndim::value==1)), ShiftTilePattern< SizeSpecType::ndim::value, dash::ROW_MAJOR, typename SizeSpecType::index_type >>::type make_pattern (const SizeSpecType &sizespec, const TeamSpecType &teamspec)
 Generic Abstract Factory for models of the Pattern concept. More...
 
template<typename PartitioningTags = dash::pattern_partitioning_default_properties, typename MappingTags = dash::pattern_mapping_default_properties, typename LayoutTags = dash::pattern_layout_default_properties, class SizeSpecType , class TeamSpecType >
std::enable_if< LayoutTags::canonical, BlockPattern< SizeSpecType::ndim::value, dash::ROW_MAJOR, typename SizeSpecType::index_type >>::type make_pattern (const SizeSpecType &sizespec, const TeamSpecType &teamspec)
 Generic Abstract Factory for models of the Pattern concept. More...
 
template<typename PartitioningConstraints , typename MappingConstraints , typename LayoutConstraints , typename PatternType >
bool check_pattern_constraints (const PatternType &pattern)
 Traits for compile- and run-time pattern constraints checking, suitable for property checks where detailed error reporting is desired. More...
 
template<dim_t ND, MemArrange Ar, typename Index >
std::ostream & operator<< (std::ostream &os, const SeqTilePattern< ND, Ar, Index > &pattern)
 
template<dim_t ND, MemArrange Ar, typename Index >
std::ostream & operator<< (std::ostream &os, const TilePattern< ND, Ar, Index > &pattern)
 
template<typename RangeType >
constexpr auto begin (RangeType &&range) -> decltype(std::forward< RangeType >(range).begin())
 
template<class RangeType >
constexpr auto end (RangeType &&range) -> decltype(std::forward< RangeType >(range).end())
 
template<class RangeType >
constexpr auto size (RangeType &&r) -> decltype(std::forward< RangeType >(r).size())
 
template<class Iterator , class Sentinel >
constexpr dash::IteratorRange< const Iterator, const Sentinel > make_range (const Iterator &begin, const Sentinel &end)
 Adapter utility function. More...
 
template<class Iterator , class Sentinel >
constexpr dash::IteratorRange< Iterator *, Sentinel * > make_range (Iterator *begin, Sentinel *end)
 Adapter utility function. More...
 
template<class Iterator , class Sentinel >
dash::IteratorRange< Iterator, Sentinel > make_range (Iterator &begin, Sentinel &end)
 Adapter utility function. More...
 
template<typename T >
void swap (dash::Shared< T > &a, dash::Shared< T > &b)
 
std::ostream & operator<< (std::ostream &os, const Team &team)
 
bool operator== (const Team::Deallocator &lhs, const Team::Deallocator &rhs)
 
template<class ViewTypeA , class ViewTypeB >
constexpr auto apply (ViewTypeA &view_a, ViewTypeB &view_b) -> decltype(view_a.apply(view_b))
 Inverse operation to dash::domain. More...
 
template<class ViewType >
constexpr auto apply (const ViewType &view) -> decltype(view.apply())
 
template<class ViewType , class OffsetT >
constexpr auto block (OffsetT block_idx, const ViewType &view) -> typename std::enable_if<(!dash::view_traits< ViewType >::is_local::value), ViewBlockMod< ViewType > >::type
 Blocks view from global view. More...
 
template<class ViewT , typename ViewValueT = typename std::decay<ViewT>::type>
constexpr auto domain (ViewT &&view) -> typename std::enable_if< dash::detail::has_type_domain_type< ViewValueT >::value, decltype(std::forward< ViewT >(view).domain()) >::type
 
template<class ViewT >
constexpr auto domain (const ViewT &view) -> typename std::enable_if< dash::detail::has_type_domain_type< ViewT >::value, decltype(view.domain()) >::type
 
template<class ContainerT , typename ContainerValueT = typename std::decay<ContainerT>::type>
constexpr std::enable_if< !dash::detail::has_type_domain_type< ContainerValueT >::value, ContainerT & >::type domain (ContainerT &container)
 
template<class ContainerT , typename ContainerValueT = typename std::decay<ContainerT>::type>
constexpr std::enable_if< !dash::detail::has_type_domain_type< ContainerValueT >::value, const ContainerT & >::type domain (const ContainerT &container)
 
template<class ViewType >
constexpr std::enable_if< dash::view_traits< ViewType >::is_view::value &&dash::view_traits< ViewType >::is_local::value, const typename ViewType::global_type & >::type global (const ViewType &v)
 
template<class ContainerType >
constexpr std::enable_if< !dash::view_traits< ContainerType >::is_view::value||!dash::view_traits< ContainerType >::is_local::value, ContainerType & >::type global (ContainerType &c)
 
template<class ViewType , typename ViewValueT = typename std::decay<ViewType>::type>
constexpr auto local (ViewType &v) -> typename std::enable_if<(std::is_pointer< typename ViewType::iterator >::value||(dash::view_traits< ViewValueT >::is_local::value)), ViewType &>::type
 
template<class ContainerType , typename ContainerDecayType = typename std::decay<ContainerType>::type>
constexpr std::enable_if<(!dash::view_traits< ContainerDecayType >::is_view::value &&!dash::view_traits< ContainerDecayType >::is_local::value &&dash::view_traits< ContainerDecayType >::is_origin::value), const typename ContainerType::local_type & >::type local (const ContainerType &c)
 
template<class ViewType >
constexpr auto local (const ViewType &v) -> typename std::enable_if< dash::view_traits< ViewType >::is_view::value, decltype(v.local()) >::type
 
template<class ViewType , typename ViewValueT = typename std::decay<ViewType>::type>
constexpr auto local (ViewType &&v) -> typename std::enable_if<(dash::view_traits< ViewValueT >::is_view::value &&!dash::view_traits< ViewValueT >::is_local::value), decltype(std::forward< ViewType >(v).local()) >::type
 
template<class GlobalIterator >
constexpr auto local (const GlobalIterator &g_it) -> decltype((g_it - g_it.pos()).local())
 Convert global iterator referencing an element the active unit's memory to a corresponding native pointer referencing the element. More...
 
template<class ViewT >
dash::view_traits< ViewT >::origin_type origin (ViewT &view)
 
template<class ViewType >
constexpr auto remote (dash::team_unit_t unit, const ViewType &v) -> typename std::enable_if< dash::view_traits< ViewType >::is_view::value, decltype(v.local()) >::type
 
template<class ContainerType >
constexpr std::enable_if< !dash::view_traits< ContainerType >::is_view::value, const typename ContainerType::local_type & >::type remote (dash::team_unit_t unit, const ContainerType &c)
 
template<class ViewTypeA , class ViewTypeB >
constexpr auto intersect (const ViewTypeA &va, const ViewTypeB &vb) -> decltype(dash::sub(0, 0, va))
 
template<class ComponentViewType >
constexpr CompositeView< ComponentViewType > set_union (const std::vector< ComponentViewType > &views)
 
template<class ComponentViewType >
constexpr CompositeView< ComponentViewType > set_union (std::initializer_list< ComponentViewType > views)
 
template<dim_t SubDim = 0, dim_t NViewDim, class OffsetFirstT , class OffsetFinalT >
constexpr ViewSubMod< ViewOrigin< NViewDim >, SubDim > sub (OffsetFirstT begin, OffsetFinalT end)
 Sub-section, view dimensions maintain domain dimensions. More...
 
template<dim_t SubDim = 0, dim_t NViewDim, class IndexRangeT >
constexpr ViewSubMod< ViewOrigin< NViewDim >, SubDim > sub (const IndexRangeT &range)
 Sub-section, view dimensions maintain domain dimensions. More...
 
template<dim_t SubDim = 0, class DomainT , class OffsetFirstT , class OffsetFinalT , typename DomainValueT = typename std::decay<DomainT>::type>
constexpr ViewSubMod< DomainValueT, SubDim, dash::view_traits< DomainValueT >::rank::value > sub (OffsetFirstT begin, OffsetFinalT end, const DomainT &domain)
 
template<dim_t SubDim = 0, class DomainT , class OffsetFirstT , class OffsetFinalT , typename DomainValueT = typename std::decay<DomainT>::type>
constexpr ViewSubMod< DomainValueT, SubDim, dash::view_traits< DomainValueT >::rank::value > sub (OffsetFirstT begin, OffsetFinalT end, DomainT &&domain)
 
template<class DomainT , class IndexSetT >
std::ostream & operator<< (std::ostream &os, const ViewIterator< DomainT, IndexSetT > &view_it)
 
template<class Viewable >
constexpr Viewable::domain_type & domain (const Viewable &v)
 Returns a reference to the specified object's domain, or the object itself if it is not a View type. More...
 
template<class Iterator , class Sentinel >
constexpr dash::IteratorViewOrigin< Iterator, Sentinel > make_view (Iterator begin, Sentinel end)
 

Variables

struct dash::dart_operation ValueType
 Reduce operands to their minimum value. More...
 
struct dash::dart_operation DART_OP_MIN
 
struct dash::dart_operation ARITHMETIC
 
struct dash::dart_operation const ValueType &rhs const
 
dash::max operator
 
constexpr team_unit_t UNDEFINED_TEAM_UNIT_ID { ((dart_unit_t)(-1)) }
 Invalid local unit ID. More...
 
constexpr global_unit_t UNDEFINED_GLOBAL_UNIT_ID { ((dart_unit_t)(-1)) }
 Invalid global unit ID. More...
 

Detailed Description

This class is a simple memory pool which holds allocates elements of size ValueType.

The DASH C++ Library Interface.

Efficient allocation is achieved in terms of the memory regions. Each region represents a chunk of memory blocks and each block is a single element of size ValueType.

Methods
Return Type Method Parameters Description
ValueType * allocate nbsp; Allocates an aligned block to store a single element of size ValueType
void deallocate addr Deallocates the specified memory address and keeps memory internall in a freelist.
void reserve nblocks Reserve a chunk of memory blocks to hold at least n elements of size ValueType.
void release nbsp; Release all memory chunks and deallocate everything at one.

Typedef Documentation

◆ default_extent_t

typedef internal::default_unsigned_index dash::default_extent_t

Unsigned integer type used as default for extent values.

Definition at line 64 of file Types.h.

◆ default_index_t

typedef internal::default_signed_index dash::default_index_t

Signed integer type used as default for index values.

Definition at line 59 of file Types.h.

◆ default_size_t

typedef internal::default_unsigned_index dash::default_size_t

Unsigned integer type used as default for size values.

Definition at line 69 of file Types.h.

◆ dim_t

typedef int dash::dim_t

Scalar type for a dimension value, with 0 indicating the first dimension.

Definition at line 39 of file Types.h.

◆ global_unit_t

typedef struct dash::unit_id< dash::global_unit, dart_global_unit_t > dash::global_unit_t

Unit ID to use for global IDs.

Note that this typed is returned by dash::myid() and dash::Team::GlobalUnitID().

See also
unit_id
team_unit_t

Definition at line 332 of file Types.h.

◆ GlobMemAllocPtr

template<class T >
using dash::GlobMemAllocPtr = typedef decltype(dash::memalloc<T>(size_t{}))

Convenience Wrapper to retrieve easily the type allocated by dash::memalloc<T>

Definition at line 88 of file MemorySpace.h.

◆ gptrdiff_t

typedef internal::default_signed_index dash::gptrdiff_t

Difference type for global pointers.

Definition at line 74 of file Types.h.

◆ NArray

template<typename T , dim_t NumDimensions, typename IndexT = dash::default_index_t, class PatternT = Pattern<NumDimensions, ROW_MAJOR, IndexT>, typename LocalMemSpaceT = HostSpace>
using dash::NArray = typedef dash::Matrix<T, NumDimensions, IndexT, PatternT, LocalMemSpaceT>

Template alias for dash::Matrix with the same default template arguments.

See also
Matrix

Definition at line 782 of file Matrix.h.

◆ Pattern

template<dim_t NumDimensions, MemArrange Arrangement = ROW_MAJOR, typename IndexType = dash::default_index_t>
using dash::Pattern = typedef dash::BlockPattern<NumDimensions, Arrangement, IndexType>

Template alias for dash::Pattern with the same default template arguments.

See also
BlockPattern

Definition at line 644 of file Pattern.h.

◆ summa_pattern_layout_constraints

Constraints on pattern layout properties of matrix operands passed to dash::summa.

Definition at line 122 of file SUMMA.h.

◆ summa_pattern_mapping_constraints

◆ summa_pattern_partitioning_constraints

◆ team_unit_t

typedef struct dash::unit_id< dash::local_unit, dart_team_unit_t > dash::team_unit_t

Unit ID to use for team-local IDs.

Note that this is returned by calls to dash::Team::myid(), including dash::Team::All().myid() as it is handled as a team as well.

See also
unit_id
global_unit_t

Definition at line 319 of file Types.h.

Enumeration Type Documentation

◆ global_allocation_policy

enum dash::global_allocation_policy : uint8_t
strong
Enumerator
collective 

All units collectively allocate global memory.

non_collective 

only one unit allocates in global memory

epoch_synchronized 

all units allocate invdividually in local memory and synchronize in epochs

Definition at line 17 of file AllocationPolicy.h.

17  : uint8_t {
19  collective,
20 
23 
27 };
only one unit allocates in global memory
all units allocate invdividually in local memory and synchronize in epochs
All units collectively allocate global memory.

◆ launch

enum dash::launch : uint16_t
strong
Enumerator
sync 

synchronous launch policy

async 

async launch policy

Definition at line 8 of file LaunchPolicy.h.

8  : uint16_t {
10 sync = 0x1,
12 async = 0x2
13 };
async launch policy
synchronous launch policy

Function Documentation

◆ addressof()

template<class MemSpaceT , class T >
auto dash::addressof ( dash::GlobRef< T > const &  ref)
inline

specialization for unqualified calls to swap

Definition at line 432 of file GlobRef.h.

433 {
434  return dash::GlobPtr<T, MemSpaceT>(ref.dart_gptr());
435 }
Pointer in global memory space with random access arithmetics.
Definition: GlobPtr.h:33

◆ align()

void* dash::align ( std::size_t  alignment,
std::size_t  size,
void *&  ptr,
std::size_t &  space 
)
inline

Replacement for missing std::align in gcc < 5.0.

Implementation from original bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57350

Definition at line 21 of file Allocator.h.

26 {
27  auto pn = reinterpret_cast< std::uintptr_t >(ptr);
28  auto aligned = (pn + alignment - 1) & - alignment;
29  auto new_space = space - ( aligned - pn );
30  if (new_space < size) return nullptr;
31  space = new_space;
32  return ptr = reinterpret_cast<void *>(aligned);
33 }
size_t size()
Return the number of units in the global team.

◆ block()

template<class ViewType , class OffsetT >
constexpr auto dash::block ( OffsetT  block_idx,
const ViewType &  view 
) -> typename std::enable_if< ( !dash::view_traits<ViewType>::is_local::value ), ViewBlockMod<ViewType> >::type

Blocks view from global view.

Blocks view from local view.

Definition at line 49 of file Chunked.h.

References local(), and origin().

Referenced by dash::tools::PatternVisualizer< PatternT >::draw_blocks(), and dash::tools::PatternVisualizer< PatternT >::draw_local_blocks().

56  {
57  return ViewBlockMod<ViewType>(view, block_idx);
58 }

◆ distance() [1/4]

template<class T , class MemSpaceT >
dash::gptrdiff_t dash::distance ( GlobPtr< T, MemSpaceT >  gbegin,
GlobPtr< T, MemSpaceT >  gend 
)

Returns the number of hops from gbegin to gend.

Equivalent to (gend - gbegin).

Note
The distance is calculate by considering the memory traits of the underlying global memory distances.
Returns
The number of increments to go from gbegin to gend
Implemented concept:
DashMemorySpaceConcept

Definition at line 547 of file GlobPtr.h.

References begin(), and end().

Referenced by dash::GlobPtr< event_ctr_t, globmem_t >::operator-().

552 {
553  using memory_space_traits = dash::memory_space_traits<MemSpaceT>;
554 
555  auto const begin = static_cast<dart_gptr_t>(gbegin);
556  auto const end = static_cast<dart_gptr_t>(gbegin);
557 
558  DASH_ASSERT_EQ(begin.teamid, end.teamid, "teamid must be equal");
559  DASH_ASSERT_EQ(begin.segid, end.segid, "segid must be equal");
560 
561  auto & reg = dash::internal::MemorySpaceRegistry::GetInstance();
562  auto const *mem_space =
563  static_cast<const MemSpaceT *>(reg.lookup(begin));
564 
565  return dash::internal::distance<T>(
566  static_cast<dart_gptr_t>(gbegin),
567  static_cast<dart_gptr_t>(gend),
568  mem_space,
569  typename memory_space_traits::memory_space_layout_tag{});
570 }
constexpr auto end(RangeType &&range) -> decltype(std::forward< RangeType >(range).end())
Definition: Range.h:98
constexpr auto begin(RangeType &&range) -> decltype(std::forward< RangeType >(range).begin())
Definition: Range.h:89
DART Global pointer type.
Definition: dart_globmem.h:77

◆ distance() [2/4]

template<typename ElementType , typename IndexType , class Pointer , class Reference >
auto dash::distance ( const dash::GlobHeapLocalPtr< ElementType, IndexType, Pointer, Reference > &  first,
const dash::GlobHeapLocalPtr< ElementType, IndexType, Pointer, Reference > &  last 
) -> IndexType

Resolve the number of elements between two local bucket iterators.

Time complexity
O(1)
Parameters
firstGlobal iterator to the first position in the global sequence
lastGlobal iterator to the final position in the global sequence

Definition at line 469 of file GlobHeapLocalPtr.h.

477 {
478  return last - first;
479 }

◆ distance() [3/4]

template<typename ElementType , class MemSpaceT >
auto dash::distance ( const dash::GlobHeapPtr< ElementType, MemSpaceT > &  first,
const dash::GlobHeapPtr< ElementType, MemSpaceT > &  last 
) -> typename MemSpaceT::index_type

Resolve the number of elements between two global bucket pointers.

Time complexity
O(1)
Parameters
firstGlobal pointer to the first position in the global sequence
lastGlobal pointer to the final position in the global sequence

Definition at line 644 of file GlobHeapPtr.h.

649 {
650 
651  if (last._globmem == first._globmem) {
652  return last - first;
653  }
654  else {
655  return std::numeric_limits<typename MemSpaceT::index_type>::max();
656  }
657 }

◆ distance() [4/4]

template<typename ElementType , class Pattern , class GlobStaticMem , class Pointer , class Reference >
auto dash::distance ( const GlobViewIter< ElementType, Pattern, GlobStaticMem, Pointer, Reference > &  first,
const GlobViewIter< ElementType, Pattern, GlobStaticMem, Pointer, Reference > &  last 
) -> typename Pattern::index_type

Resolve the number of elements between two global iterators.

The difference of global pointers is not well-defined if their range spans over more than one block. The corresponding invariant is: g_last == g_first + (l_last - l_first) Example:

unit: 0 1 0
local offset: | 0 1 2 | 0 1 2 | 3 4 5 | ...
global offset: | 0 1 2 3 4 5 6 7 8 ...
range: [- - - - -]

When iterating in local memory range [0,5[ of unit 0, the position of the global iterator to return is 8 != 5

Template Parameters
ElementTypeType of the elements in the range
Time complexity
O(1)
Parameters
lastGlobal iterator to the final position in the global sequence

Definition at line 1062 of file GlobViewIter.h.

1069 {
1070  return last - first;
1071 }

◆ fence()

template<typename T , typename GlobPtrType >
void dash::fence ( const GlobPtrType &  gptr)

Block until local and global completion of operations on a global address.

Definition at line 152 of file Onesided.h.

References dart_flush(), and DART_OK.

154 {
155  DASH_ASSERT_RETURNS(
156  dart_flush(gptr.dart_gptr()),
157  DART_OK);
158 }
Signals success.
Definition: dart_types.h:33
dart_ret_t dart_flush(dart_gptr_t gptr)
Guarantee completion of all outstanding operations involving a segment on a certain unit...

◆ fence_local()

template<typename T , typename GlobPtrType >
void dash::fence_local ( const GlobPtrType &  gptr)

Block until local completion of operations on a global address.

Definition at line 164 of file Onesided.h.

References dart_flush_local(), and DART_OK.

166 {
167  DASH_ASSERT_RETURNS(
168  dart_flush_local(gptr.dart_gptr()),
169  DART_OK);
170 }
Signals success.
Definition: dart_types.h:33
dart_ret_t dart_flush_local(dart_gptr_t gptr)
Guarantee local completion of all outstanding operations involving a segment on a certain unit...

◆ get_default_memory_space()

template<class MSpaceDomainCategory , class MSpaceTypeCategory >
MemorySpace< MSpaceDomainCategory, MSpaceTypeCategory > * dash::get_default_memory_space ( )
inline

Forward declarations.

Definition at line 29 of file MemorySpace.h.

Referenced by dash::GlobLocalMemoryPool< dash::HostSpace >::flush_local().

30 {
31  static_assert(
32  detail::dependent_false<MSpaceDomainCategory, MSpaceTypeCategory>::
33  value,
34  "No default memory space for this configuration available");
35  // Current we have only a default host space
36  return nullptr;
37 }

◆ get_value()

template<typename T , typename GlobPtrType >
void dash::get_value ( T *  ptr,
const GlobPtrType &  gptr 
)
inline

Read a value fom a global pointer.

Calls to this routine are blocking

Parameters
[out]ptrLocal pointer that will contain the value of the global address
[in]gptrGlobal pointer to read

Definition at line 230 of file Onesided.h.

Referenced by dash::GlobHeapMem< ElementType, LocalMemorySpace, AllocationPolicy, LocalAlloc >::get_value().

236 {
237  dash::internal::get_blocking(gptr.dart_gptr(), ptr, 1);
238 }

◆ get_value_async()

template<typename T , typename GlobPtrType >
void dash::get_value_async ( T *  ptr,
const GlobPtrType &  gptr 
)
inline

Read a value fom a global pointer, non-blocking.

Requires a later fence operation to guarantee local and/or remote completion.

Parameters
[out]ptrLocal pointer that will contain the value of the global address
[in]gptrGlobal pointer to read

Definition at line 197 of file Onesided.h.

203 {
204  dash::internal::get(gptr.dart_gptr(), ptr, 1);
205 }

◆ local()

template<class GlobalIterator >
constexpr auto dash::local ( const GlobalIterator &  g_it) -> decltype((g_it - g_it.pos()).local())

Convert global iterator referencing an element the active unit's memory to a corresponding native pointer referencing the element.

Precondition: g_it is local

Parameters
g_itGlobal iterator referencing element in local memory

Definition at line 143 of file Local.h.

146  {
147  return g_it.local();
148 }

◆ local_begin()

template<class T , class MemSpaceT >
DASH_CONSTEXPR std::enable_if< std::is_same< typename dash::memory_space_traits< MemSpaceT>::memory_space_layout_tag, memory_space_contiguous>::value, T>::type* dash::local_begin ( GlobPtr< T, MemSpaceT >  global_begin,
dash::team_unit_t  unit 
)
inline

Returns the begin of the local memory portion within a global memory segment.

Parameters
global_beginThe pointer which identifies the global memory segment
unitThe unit_id whose local memory portion is required. This must be a unit which is running locally, i.e. the local memory portion must be reachable with a native pointer (void*)
Returns
returns the local memory portion identified by a global memory segment.
Implemented concept:
DashMemorySpaceConcept

Definition at line 593 of file GlobPtr.h.

Referenced by find(), dash::GlobIter< value_type, Pattern_t, GlobMem_t >::local(), dash::GlobViewIter< ElementT, PatternT, GlobMemT >::local(), local_range(), and min_element().

594 {
595  // reset offset to 0
596  auto dart_gptr = static_cast<dart_gptr_t>(global_begin);
597  dart_gptr.unitid = unit.id;
598  dart_gptr.addr_or_offs.offset = 0;
599  return GlobPtr<T, MemSpaceT>(dart_gptr).local();
600 }
constexpr auto local(ViewType &v) -> typename std::enable_if<(std::is_pointer< typename ViewType::iterator >::value||(dash::view_traits< ViewValueT >::is_local::value)), ViewType &>::type
Definition: Local.h:28
dart_unit_t unitid
The unit holding the memory element.
Definition: dart_globmem.h:83
DART Global pointer type.
Definition: dart_globmem.h:77

◆ local_index_range()

template<class GlobInputIter >
std::enable_if< GlobInputIter::has_view::value, LocalIndexRange<typename GlobInputIter::pattern_type::index_type>>::type dash::local_index_range ( const GlobInputIter &  first,
const GlobInputIter &  last 
)

Resolves the local index range between global view iterators.

Todo:
Only all-local or all-nonlocal ranges supported for now.
Example:
Total range 0 1 2 3 4 5 6 7 8 9
Global iterators first = 4; last = 7;

| 0 1 2 3 [4 5 6 7] 8 9] Local elements | (local index:value) 0:2 1:3 2:6 3:7 Result | (local indices) 2 3

Returns
A local index range consisting of offsets of the first and last element in local memory within the sequence limited by the given global iterators.
Time complexity
O(d), with d dimensions in the global iterators' pattern
Parameters
firstIterator to the initial position in the global sequence
lastIterator to the final position in the global sequence

Definition at line 188 of file LocalRange.h.

193 {
194  typedef typename GlobInputIter::pattern_type pattern_t;
195  typedef typename pattern_t::index_type idx_t;
196  // Get offsets of iterators within global memory, O(1):
197  auto begin_gindex = static_cast<idx_t>(first.pos());
198  auto end_gindex = static_cast<idx_t>(last.pos());
199  DASH_LOG_TRACE("local_index_range(ViewIt,ViewIt)",
200  begin_gindex, end_gindex);
201  DASH_ASSERT_GT(begin_gindex+1, 0,
202  "local_index_range: begin.gidx must not be negative");
203  DASH_ASSERT_GT(end_gindex+1, 0,
204  "local_index_range: end.gidx must not be negative");
205  // Check if input range is relative to a view spec (e.g. a block):
206  if (first.is_relative() && last.is_relative()) {
207  DASH_LOG_TRACE("local_index_range", "input iterators are relative");
208  if (first.viewspec() == last.viewspec()) {
209  DASH_LOG_TRACE("local_index_range", "input iterators in same view");
210  auto l_first = first.lpos();
211  bool first_is_local = l_first.unit == first.team().myid();
212  // No need to check if last is local as both are relative to the
213  // same view.
214  if (first_is_local) {
215  auto l_last_idx = last.lpos().index;
216  auto l_first_idx = l_first.index;
217  DASH_LOG_TRACE("local_index_range >", l_first_idx, l_last_idx);
218  return LocalIndexRange<idx_t> { l_first_idx, l_last_idx };
219  }
220  DASH_LOG_TRACE("local_index_range >", "not local -> (0,0)");
221  return LocalIndexRange<idx_t>{0, 0};
222  }
223  DASH_THROW(
225  "dash::local_index_range: views of first and last iterators "
226  "differ");
227  }
228  // Get pattern from global iterators, O(1):
229  const auto& pattern = first.pattern();
230  DASH_LOG_TRACE_VAR("local_index_range", pattern.local_size());
231  if (pattern.local_size() == 0) {
232  // Local index range is empty
233  DASH_LOG_TRACE("local_index_range (lsize:0) ->", 0, 0);
234  return LocalIndexRange<idx_t> { 0, 0 };
235  }
236  // Global index of first element in pattern, O(1):
237  idx_t lbegin_gindex = pattern.lbegin();
238  // Global index of last element in pattern, O(1):
239  idx_t lend_gindex = pattern.lend();
240  DASH_LOG_TRACE_VAR("local_index_range", lbegin_gindex);
241  DASH_LOG_TRACE_VAR("local_index_range", lend_gindex);
242  if (lend_gindex <= begin_gindex || // local end before global begin
243  lbegin_gindex >= end_gindex) { // local begin after global end
244  // No overlap, intersection is empty
245  DASH_LOG_TRACE("local_index_range (intersect:0)->", 0, 0);
246  return LocalIndexRange<idx_t> { 0, 0 };
247  }
248  // Intersect local range and global range, in global index domain:
249  auto goffset_lbegin = std::max<idx_t>(lbegin_gindex, begin_gindex);
250  auto goffset_lend = std::min<idx_t>(lend_gindex, end_gindex);
251  // Global positions of local range to global coordinates, O(d):
252  auto lbegin_gcoords = pattern.coords(goffset_lbegin);
253  // Subtract 1 from global end offset as it points one coordinate
254  // past the last index which is out of the valid coordinates range:
255  auto lend_gcoords = pattern.coords(goffset_lend-1);
256  // Global coordinates of local range to local indices, O(d):
257  auto lbegin_index = pattern.at(lbegin_gcoords);
258  // Add 1 to local end index to it points one coordinate past the
259  // last index:
260  auto lend_index = pattern.at(lend_gcoords);
261  if (lend_index
262  == std::numeric_limits<typename pattern_t::index_type>::max()) {
263  DASH_LOG_ERROR("local_index_range !",
264  "index type too small for for local index range");
265  }
266  lend_index += 1;
267  // Return local index range
268  DASH_LOG_TRACE("local_index_range ->", lbegin_index, lend_index);
269  return LocalIndexRange<idx_t> { lbegin_index, lend_index };
270 }

◆ local_range()

template<class GlobIterType >
LocalRange<typename GlobIterType::value_type> dash::local_range ( GlobIterType &  first,
GlobIterType &  last 
)

Global iterators to local index range, O(d):

Parameters
firstIterator to the initial position in the global sequence
lastIterator to the final position in the global sequence

Definition at line 338 of file LocalRange.h.

References local_begin(), and local_index_range().

343 {
344  typedef typename GlobIterType::pattern_type pattern_t;
345  typedef typename GlobIterType::value_type value_t;
346  typedef typename pattern_t::index_type idx_t;
347  DASH_LOG_TRACE("local_range()",
348  "gfirst.pos:", first.pos(),
349  "glast.pos:", last.pos());
351  auto index_range = dash::local_index_range(first, last);
352  idx_t lbegin_index = index_range.begin;
353  idx_t lend_index = index_range.end;
354  if (lbegin_index == lend_index) {
355  // Local range is empty
356  DASH_LOG_TRACE("local_range >", "empty local range",
357  lbegin_index, lend_index);
358  return LocalRange<value_t> { nullptr, nullptr };
359  }
360  // Local start address from global memory:
361 
362  auto* lbegin = dash::local_begin(
363  static_cast<typename GlobIterType::pointer>(first.globmem().begin()),
364  first.team().myid());
365 
366  // Add local offsets to local start address:
367  if (lbegin == nullptr) {
368  DASH_LOG_TRACE("local_range >", "lbegin null");
369  return LocalRange<value_t> { nullptr, nullptr };
370  }
371  DASH_LOG_TRACE("local_range >",
372  "lbegin:", lbegin,
373  "l_idx_range:", lbegin_index, "-", lend_index);
374  return LocalRange<value_t> {
375  lbegin + lbegin_index,
376  lbegin + lend_index };
377 }
DASH_CONSTEXPR std::enable_if< std::is_same< typename dash::memory_space_traits< MemSpaceT >::memory_space_layout_tag, memory_space_contiguous >::value, T >::type * local_begin(GlobPtr< T, MemSpaceT > global_begin, dash::team_unit_t unit)
Returns the begin of the local memory portion within a global memory segment.
Definition: GlobPtr.h:593
std::enable_if< !GlobInputIter::has_view::value, LocalIndexRange< typename GlobInputIter::pattern_type::index_type >>::type local_index_range(const GlobInputIter &first, const GlobInputIter &last)
Resolves the local index range between global iterators.
Definition: LocalRange.h:101

◆ make_pair()

template<class T1 , class T2 >
constexpr Pair<typename internal::decay_and_strip<T1>::type, typename internal::decay_and_strip<T2>::type> dash::make_pair ( T1 &&  x,
T2 &&  y 
)

Convennience wrapper to create a Pair object.

Definition at line 225 of file Pair.h.

References dash::Pair< T1, T2 >::first, dash::Pair< T1, T2 >::second, and typestr().

226  {
227  typedef typename internal::decay_and_strip<T1>::type ds_type1;
228  typedef typename internal::decay_and_strip<T2>::type ds_type2;
229  typedef Pair<ds_type1, ds_type2> pair_type;
230  return pair_type(std::forward<T1>(x), std::forward<T2>(y));
231  }

◆ make_pattern() [1/2]

template<typename PartitioningTags = dash::pattern_partitioning_default_properties, typename MappingTags = dash::pattern_mapping_default_properties, typename LayoutTags = dash::pattern_layout_default_properties, class SizeSpecType , class TeamSpecType >
std::enable_if< MappingTags::diagonal && (LayoutTags::blocked || (PartitioningTags::balanced && SizeSpecType::ndim::value == 1)), ShiftTilePattern<SizeSpecType::ndim::value, dash::ROW_MAJOR, typename SizeSpecType::index_type>>::type dash::make_pattern ( const SizeSpecType &  sizespec,
const TeamSpecType &  teamspec 
)

Generic Abstract Factory for models of the Pattern concept.

Creates an instance of a Pattern model that satisfies the contiguos linearization property from given pattern traits.

{}

Returns
An instance of dash::ShiftTilePattern if the following constraints are specified: (Mapping: diagonal) and (Layout: blocked or (Partitioning: balanced Dimensions: 1))
Parameters
sizespecSize spec of cartesian space to be distributed by the pattern.
teamspecTeam spec containing layout of units mapped by the pattern.

Definition at line 439 of file MakePattern.h.

References make_distribution_spec(), and ndim().

444 {
445  // Deduce number of dimensions from size spec:
446  const dim_t ndim = SizeSpecType::ndim::value;
447  // Deduce index type from size spec:
448  typedef typename SizeSpecType::index_type index_t;
450  DASH_LOG_TRACE("dash::make_pattern", PartitioningTags());
451  DASH_LOG_TRACE("dash::make_pattern", MappingTags());
452  DASH_LOG_TRACE("dash::make_pattern", LayoutTags());
453  DASH_LOG_TRACE_VAR("dash::make_pattern", sizespec.extents());
454  DASH_LOG_TRACE_VAR("dash::make_pattern", teamspec.extents());
455  // Make distribution spec from template- and run time parameters:
456  auto distspec =
458  PartitioningTags,
459  MappingTags,
460  LayoutTags,
461  SizeSpecType,
462  TeamSpecType
463  >(sizespec,
464  teamspec);
465  // Make pattern from template- and run time parameters:
466  pattern_t pattern(sizespec,
467  distspec,
468  teamspec);
469  return pattern;
470 }
int dim_t
Scalar type for a dimension value, with 0 indicating the first dimension.
Definition: Types.h:39
DistributionSpec< SizeSpecType::ndim::value > make_distribution_spec(const SizeSpecType &sizespec, const TeamSpecType &teamspec)
Generic Abstract Factory for instances of dash::DistributionSpec.
Definition: MakePattern.h:246
Defines how a list of global indices is mapped to single units within a Team.
constexpr dim_t ndim(const DimensionalType &d)
Definition: Dimensional.h:56

◆ make_pattern() [2/2]

template<typename PartitioningTags = dash::pattern_partitioning_default_properties, typename MappingTags = dash::pattern_mapping_default_properties, typename LayoutTags = dash::pattern_layout_default_properties, class SizeSpecType , class TeamSpecType >
std::enable_if< LayoutTags::canonical, BlockPattern<SizeSpecType::ndim::value, dash::ROW_MAJOR, typename SizeSpecType::index_type >>::type dash::make_pattern ( const SizeSpecType &  sizespec,
const TeamSpecType &  teamspec 
)

Generic Abstract Factory for models of the Pattern concept.

Creates an instance of a Pattern model that satisfies the canonical (strided) layout property from given pattern traits.

{}

Returns
An instance of dash::BlockPattern if the following constraints are specified:
  • Layout: canonical
Parameters
sizespecSize spec of cartesian space to be distributed by the pattern.
teamspecTeam spec containing layout of units mapped by the pattern.

Definition at line 497 of file MakePattern.h.

References make_distribution_spec(), and ndim().

502 {
503  // Deduce number of dimensions from size spec:
504  const dim_t ndim = SizeSpecType::ndim::value;
505  // Deduce index type from size spec:
506  typedef typename SizeSpecType::index_type index_t;
508  DASH_LOG_TRACE("dash::make_pattern", PartitioningTags());
509  DASH_LOG_TRACE("dash::make_pattern", MappingTags());
510  DASH_LOG_TRACE("dash::make_pattern", LayoutTags());
511  // Make distribution spec from template- and run time parameters:
512  auto distspec =
514  PartitioningTags,
515  MappingTags,
516  LayoutTags,
517  SizeSpecType,
518  TeamSpecType
519  >(sizespec,
520  teamspec);
521  // Make pattern from template- and run time parameters:
522  pattern_t pattern(sizespec,
523  distspec,
524  teamspec);
525  return pattern;
526 }
Defines how a list of global indices is mapped to single units within a Team.
Definition: BlockPattern.h:42
int dim_t
Scalar type for a dimension value, with 0 indicating the first dimension.
Definition: Types.h:39
DistributionSpec< SizeSpecType::ndim::value > make_distribution_spec(const SizeSpecType &sizespec, const TeamSpecType &teamspec)
Generic Abstract Factory for instances of dash::DistributionSpec.
Definition: MakePattern.h:246
constexpr dim_t ndim(const DimensionalType &d)
Definition: Dimensional.h:56

◆ make_range() [1/3]

template<class Iterator , class Sentinel >
constexpr dash::IteratorRange<const Iterator, const Sentinel> dash::make_range ( const Iterator &  begin,
const Sentinel &  end 
)

Adapter utility function.

Wraps begin and end const iterators in range type.

Definition at line 433 of file Range.h.

References begin(), and end().

435  {
437  begin,
438  end);
439 }
constexpr auto end(RangeType &&range) -> decltype(std::forward< RangeType >(range).end())
Definition: Range.h:98
constexpr auto begin(RangeType &&range) -> decltype(std::forward< RangeType >(range).begin())
Definition: Range.h:89
Adapter template for range concept, wraps begin and end iterators in range type.
Definition: Range.h:304

◆ make_range() [2/3]

template<class Iterator , class Sentinel >
constexpr dash::IteratorRange<Iterator *, Sentinel *> dash::make_range ( Iterator *  begin,
Sentinel *  end 
)

Adapter utility function.

Wraps begin and end pointers in range type.

Definition at line 447 of file Range.h.

References begin(), and end().

449  {
451  begin,
452  end);
453 }
constexpr auto end(RangeType &&range) -> decltype(std::forward< RangeType >(range).end())
Definition: Range.h:98
constexpr auto begin(RangeType &&range) -> decltype(std::forward< RangeType >(range).begin())
Definition: Range.h:89
Adapter template for range concept, wraps begin and end iterators in range type.
Definition: Range.h:304

◆ make_range() [3/3]

template<class Iterator , class Sentinel >
dash::IteratorRange<Iterator, Sentinel> dash::make_range ( Iterator &  begin,
Sentinel &  end 
)

Adapter utility function.

Wraps begin and end iterators in range type.

Definition at line 461 of file Range.h.

References begin(), and end().

463  {
465  begin,
466  end);
467 }
constexpr auto end(RangeType &&range) -> decltype(std::forward< RangeType >(range).end())
Definition: Range.h:98
constexpr auto begin(RangeType &&range) -> decltype(std::forward< RangeType >(range).begin())
Definition: Range.h:89
Adapter template for range concept, wraps begin and end iterators in range type.
Definition: Range.h:304

◆ make_team_spec()

template<typename PartitioningTags , typename MappingTags , typename LayoutTags , class SizeSpecType >
TeamSpec<SizeSpecType::ndim::value, typename SizeSpecType::index_type> dash::make_team_spec ( const SizeSpecType &  sizespec,
int  n_units,
typename SizeSpecType::size_type  n_nodes = 0,
typename SizeSpecType::size_type  n_numa_dom = 0,
typename SizeSpecType::size_type  n_cores = 0 
)
Parameters
sizespecSize spec of cartesian space to be distributed by the pattern.

Definition at line 31 of file MakePattern.h.

References ndim(), dash::TeamSpec< MaxDimensions, IndexType >::resize(), and dash::CartesianIndexSpace< MaxDimensions, ROW_MAJOR, IndexType >::size().

Referenced by make_team_spec().

38 {
39  typedef typename SizeSpecType::size_type extent_t;
40  typedef typename SizeSpecType::index_type index_t;
41 
42  // Deduce number of dimensions from size spec:
43  const dim_t ndim = SizeSpecType::ndim::value;
44 
45  // Default team spec:
46  std::array<extent_t, ndim> team_extents{};
47  team_extents.fill(1);
48  team_extents[1] = n_units;
49  dash::TeamSpec<ndim, index_t> teamspec(team_extents);
50 
51  DASH_LOG_TRACE("dash::make_team_spec",
52  "step 1 - initial team extents:", team_extents);
53 
54  // Check for trivial case first:
55  if (ndim == 1) {
56  return teamspec;
57  }
58 
59  auto n_elem_total = sizespec.size();
60  // Configure preferable blocking factors:
61  std::set<extent_t> blocking;
62  if (n_nodes == 1) {
63  // blocking by NUMA domains:
64  blocking.insert(n_numa_dom);
65  team_extents = dash::math::balance_extents(team_extents, blocking);
66  } else {
67  blocking.insert(n_cores);
68  }
69 
70  DASH_LOG_TRACE("dash::make_team_spec",
71  "step 2 - team extents after balancing on NUMA domains:",
72  team_extents);
73  DASH_LOG_TRACE_VAR("dash::make_team_spec", blocking);
74  // Next simple case: Minimal partitioning, i.e. optimizing for minimum
75  // number of blocks.
76  // In this case, blocking will be minimal with respect to prefered blocking
77  // factors:
78  if (n_nodes > 1 && (
79  PartitioningTags::rectangular ||
80  (!MappingTags::diagonal && !MappingTags::neighbor &&
81  !MappingTags::multiple))) {
82  // Optimize for surface-to-volume ratio:
83  DASH_LOG_TRACE("dash::make_team_spec",
84  "- optimizing for minimal number of blocks");
85  team_extents = dash::math::balance_extents(team_extents, blocking);
86  if (team_extents[0] == n_units) {
87  // Could not balance with preferred blocking factors.
88  DASH_LOG_TRACE("dash::make_team_spec",
89  "- minimize number of blocks for blocking", blocking);
90  }
91  }
92  DASH_LOG_TRACE("dash::make_team_spec",
93  "step 3 - team extents after minimal partitioning:",
94  team_extents);
95  // For minimal partitioning and multiple mapping, the first dimension is
96  // partitioned using the smallest possible blocking factor.
97 
98  // The smallest factor s.t. team- and data extents are divisible by it:
99  extent_t small_factor_found = 0;
100  auto team_factors_d0 = dash::math::factorize(team_extents[0]);
101  auto team_factors_d1 = dash::math::factorize(team_extents[1]);
102  DASH_LOG_TRACE("dash::make_team_spec",
103  "- team extent factors in dim 0:", team_factors_d0);
104  DASH_LOG_TRACE("dash::make_team_spec",
105  "- team extent factors in dim 1:", team_factors_d1);
106  if (// PartitioningTags::minimal &&
107  MappingTags::multiple) {
108  DASH_LOG_TRACE("dash::make_team_spec",
109  "optimizing for multiple blocks per unit");
110  for (auto small_factor_kv : team_factors_d0) {
111  auto small_factor = small_factor_kv.first;
112  // Find smallest factor s.t. team- and data extents are divisible by it:
113  if (team_extents[0] % small_factor &&
114  sizespec.extent(0) % small_factor == 0) {
115  team_extents[0] /= small_factor;
116  team_extents[1] *= small_factor;
117  small_factor_found = small_factor;
118  break;
119  }
120  }
121  // No matching factor found in first dimension, try in second dimension:
122  if (small_factor_found == 0) {
123  for (auto small_factor_kv : team_factors_d1) {
124  auto small_factor = small_factor_kv.first;
125  if (team_extents[1] % small_factor &&
126  sizespec.extent(1) % small_factor == 0) {
127  team_extents[1] /= small_factor;
128  team_extents[0] *= small_factor;
129  small_factor_found = small_factor;
130  break;
131  }
132  }
133  }
134  }
135  DASH_LOG_TRACE("dash::make_team_spec",
136  "- smallest blocking factor:", small_factor_found);
137  DASH_LOG_TRACE("dash::make_team_spec",
138  "step 4 - team extents after multiple mapping:",
139  team_extents);
140 
141  // Check if the resulting block sizes are within prefered bounds:
142  extent_t bulk_min = std::max<extent_t>(
143  dash::util::Config::get<extent_t>(
144  "DASH_BULK_MIN_SIZE_BYTES"),
145  4096);
146  if (bulk_min > 0) {
147  DASH_LOG_TRACE("dash::make_team_spec",
148  "- optimizing for bulk min size", bulk_min);
149  auto team_factors = dash::math::factorize(n_units);
150  extent_t block_size = 1;
151  for (auto d = 0; d < ndim; ++d) {
152  auto block_extent_d = sizespec.extent(d) / team_extents[d];
153  block_size *= block_extent_d;
154  }
155  // TODO: Need sizeof(T) instead of 8:
156  if (block_size * 8 < bulk_min && small_factor_found > 0) {
157  // Unbalance extents to increase block size:
158  auto unbalance_factor = team_factors_d1.begin()->first;
159  DASH_LOG_TRACE("dash::make_team_spec",
160  "- unbalancing with factor", unbalance_factor);
161  team_extents[0] *= unbalance_factor;
162  team_extents[1] /= unbalance_factor;
163  }
164  }
165 
166  DASH_LOG_TRACE("dash::make_team_spec >",
167  "step 5 - team extents after adjusting for bulk min size:",
168  team_extents);
169 
170  // Make distribution spec from template- and run time parameters:
171  teamspec.resize(team_extents);
172  return teamspec;
173 }
int dim_t
Scalar type for a dimension value, with 0 indicating the first dimension.
Definition: Types.h:39
constexpr dim_t ndim(const DimensionalType &d)
Definition: Dimensional.h:56
Specifies the arrangement of team units in a specified number of dimensions.
Definition: TeamSpec.h:33

◆ mmult()

template<typename MatrixTypeA , typename MatrixTypeB , typename MatrixTypeC >
void dash::mmult ( MatrixTypeA &  A,
MatrixTypeB &  B,
MatrixTypeC &  C 
)

Function adapter to an implementation of matrix-matrix multiplication (xDGEMM) depending on the matrix distribution patterns.

Delegates dash::mmult<MatrixType> to dash::summa<MatrixType> if MatrixType::pattern_type satisfies the pattern property constraints of the SUMMA implementation.

Parameters
AMatrix to multiply, extents n x m
BMatrix to multiply, extents m x p
CMatrix to contain the multiplication result, extents n x p, initialized with zeros

Referenced by summa().

◆ operator!=() [1/2]

template<class T1 , class T2 >
constexpr bool dash::operator!= ( const Pair< T1, T2 > &  x,
const Pair< T1, T2 > &  y 
)
inline

Inequality comparison operator implemented in terms of equality operator.

Definition at line 152 of file Pair.h.

153  {
154  return !(x == y);
155  }

◆ operator!=() [2/2]

template<typename IndexType >
static bool dash::operator!= ( const ViewPair< IndexType > &  lhs,
const ViewPair< IndexType > &  rhs 
)
static

Inequality comparison operator for ViewPair.

Definition at line 406 of file Dimensional.h.

References dash::ViewPair< IndexType >::extent, and dash::ViewPair< IndexType >::offset.

408  {
409  return !(lhs == rhs);
410 }

◆ operator-()

template<typename ElementType , class Pattern , class GlobMemType , class Pointer , class Reference >
DASH_CONSTEXPR auto dash::operator- ( const GlobIter< ElementType, Pattern, GlobMemType, Pointer, Reference > &  lhs,
const GlobIter< ElementType, Pattern, GlobMemType, Pointer, Reference > &  rhs 
)
Parameters
lhsGlobal pointer to the initial position in the global sequence
rhsGlobal iterator to the final position in the global sequence

Definition at line 147 of file Iterator.h.

Referenced by dash::halo::StencilIteratorTest< CoordsIdxManagerBoundary_t >::operator--(), dash::Coarray< T, IndexType, Arrangement, LocalMemSpaceT >::operator--(), and dash::halo::StencilIterator< Element_t, Pattern_t, typename HaloBlockT::GlobMem_t, StencilSpecT, StencilViewScope::ALL >::operator--().

154 {
155  return lhs.pos() - rhs.pos();
156 }

◆ operator<()

template<class T1 , class T2 >
constexpr bool dash::operator< ( const Pair< T1, T2 > &  x,
const Pair< T1, T2 > &  y 
)
inline

A pair is smaller than another pair if the first member is smaller or the first is equal and the second is smaller.

See http://gcc.gnu.org/onlinedocs/libstdc++/manual/utilities.html

Definition at line 140 of file Pair.h.

References dash::Pair< T1, T2 >::first.

Referenced by dash::UnorderedMapGlobIter< Key, Mapped, Hash, Pred, GlobMemType >::operator--(), dash::halo::StencilIteratorTest< CoordsIdxManagerBoundary_t >::operator--(), and dash::halo::StencilIterator< Element_t, Pattern_t, typename HaloBlockT::GlobMem_t, StencilSpecT, StencilViewScope::ALL >::operator--().

141  {
142  return x.first < y.first
143  || (!(y.first < x.first) && !(x.second >= y.second));
144  }

◆ operator<=()

template<class T1 , class T2 >
constexpr bool dash::operator<= ( const Pair< T1, T2 > &  x,
const Pair< T1, T2 > &  y 
)
inline

◆ operator==() [1/2]

template<class T1 , class T2 >
constexpr bool dash::operator== ( const Pair< T1, T2 > &  x,
const Pair< T1, T2 > &  y 
)
inline

Two pairs of the same type are equal iff their members are equal.

Definition at line 128 of file Pair.h.

References dash::Pair< T1, T2 >::first, and dash::Pair< T1, T2 >::second.

129  {
130  return x.first == y.first && x.second == y.second;
131  }

◆ operator==() [2/2]

template<typename IndexType >
static bool dash::operator== ( const ViewPair< IndexType > &  lhs,
const ViewPair< IndexType > &  rhs 
)
static

Equality comparison operator for ViewPair.

Definition at line 391 of file Dimensional.h.

References dash::ViewPair< IndexType >::extent, and dash::ViewPair< IndexType >::offset.

393  {
394  if (&lhs == &rhs) {
395  return true;
396  }
397  return (
398  lhs.offset == rhs.offset &&
399  lhs.extent == rhs.extent);
400 }

◆ operator>()

template<class T1 , class T2 >
constexpr bool dash::operator> ( const Pair< T1, T2 > &  x,
const Pair< T1, T2 > &  y 
)
inline

◆ operator>=()

template<class T1 , class T2 >
constexpr bool dash::operator>= ( const Pair< T1, T2 > &  x,
const Pair< T1, T2 > &  y 
)
inline

◆ put_value()

template<typename T , typename GlobPtrType >
void dash::put_value ( const T &  newval,
const GlobPtrType &  gptr 
)
inline

Write a value to a global pointer.

Calls to this routine are blocking

Parameters
[in]newvalValue to set
[in]gptrGlobal pointer referencing target address of value

Definition at line 214 of file Onesided.h.

Referenced by dash::GlobHeapMem< ElementType, LocalMemorySpace, AllocationPolicy, LocalAlloc >::put_value().

219 {
220  dash::internal::put_blocking(gptr.dart_gptr(), &newval, 1);
221 }

◆ put_value_async()

template<typename T , typename GlobPtrType >
void dash::put_value_async ( const T &  newval,
const GlobPtrType &  gptr 
)
inline

Write a value to a global pointer, non-blocking.

Requires a later fence operation to guarantee local and/or remote completion.

Parameters
[in]newvalValue to set
[in]gptrGlobal pointer referencing target address of value

Definition at line 180 of file Onesided.h.

185 {
186  dash::internal::put(gptr.dart_gptr(), &newval, 1);
187 }

◆ summa()

template<typename MatrixTypeA , typename MatrixTypeB , typename MatrixTypeC >
void dash::summa ( MatrixTypeA &  A,
MatrixTypeB &  B,
MatrixTypeC &  C 
)

Multiplies two matrices using the SUMMA algorithm.

Performs (2 * (nunits-1) * nunits^2) async copy operations of submatrices in A and B.

Pseudocode:

C = zeros(n,n) for k = 1:b:n { // k increments in steps of blocksize b u = k:(k+b-1) // u is [k, k+1, ..., k+b-1] C = C + A(:,u) * B(u,:) // Multiply n x b matrix from A with // b x p matrix from B }

Parameters
AMatrix to multiply, extents n x m
BMatrix to multiply, extents m x p
CMatrix to contain the multiplication result, extents n x p, initialized with zeros

Definition at line 151 of file SUMMA.h.

References check_pattern_constraints(), copy(), copy_async(), dash::pattern_mapping_tag::diagonal, dash::pattern_partitioning_tag::minimal, mmult(), and dash::Future< ResultT >::wait().

159 {
160  typedef typename MatrixTypeA::value_type value_type;
161  typedef typename MatrixTypeA::index_type index_t;
162  typedef typename MatrixTypeA::size_type extent_t;
163 //typedef typename MatrixTypeA::pattern_type pattern_a_type;
164 //typedef typename MatrixTypeB::pattern_type pattern_b_type;
165 //typedef typename MatrixTypeC::pattern_type pattern_c_type;
166  typedef std::array<index_t, 2> coords_t;
167 
168  const bool shifted_tiling = dash::pattern_constraints<
172  >,
174  typename MatrixTypeC::pattern_type
175  >::satisfied::value;
176  const bool minimal_tiling = dash::pattern_constraints<
179  >,
181  dash::pattern_layout_properties<>,
182  typename MatrixTypeC::pattern_type
183  >::satisfied::value;
184 
185  static_assert(
186  std::is_floating_point<value_type>::value,
187  "dash::summa expects matrix element type double or float");
188 
189  DASH_LOG_DEBUG("dash::summa()");
190  // Verify that matrix patterns satisfy pattern constraints:
192  summa_pattern_partitioning_constraints,
193  summa_pattern_mapping_constraints,
194  summa_pattern_layout_constraints
195  >(A.pattern())) {
196  DASH_THROW(
198  "dash::summa(): "
199  "pattern of first matrix argument does not match constraints");
200  }
202  summa_pattern_partitioning_constraints,
203  summa_pattern_mapping_constraints,
204  summa_pattern_layout_constraints
205  >(B.pattern())) {
206  DASH_THROW(
208  "dash::summa(): "
209  "pattern of second matrix argument does not match constraints");
210  }
212  summa_pattern_partitioning_constraints,
213  summa_pattern_mapping_constraints,
214  summa_pattern_layout_constraints
215  >(C.pattern())) {
216  DASH_THROW(
218  "dash::summa(): "
219  "pattern of result matrix does not match constraints");
220  }
221  DASH_LOG_TRACE("dash::summa", "matrix pattern properties valid");
222 
223  if (shifted_tiling) {
224  DASH_LOG_TRACE("dash::summa",
225  "using communication scheme for diagonal-shift mapping");
226  }
227  if (minimal_tiling) {
228  DASH_LOG_TRACE("dash::summa",
229  "using communication scheme for minimal partitioning");
230  }
231  // A B C
232  // _____ _____ _____
233  // | | | | | |
234  // n | x m | = n |
235  // |_ m _| |_ p _| |_ p _|
236  //
237  dash::Team & team = C.team();
238  auto unit_id = team.myid();
239  // Check run-time invariants on pattern instances:
240  auto pattern_a = A.pattern();
241  auto pattern_b = B.pattern();
242  auto pattern_c = C.pattern();
243  auto m = pattern_a.extent(0); // number of columns in A, rows in B
244 #if DASH_ENABLE_TRACE_LOGGING
245  auto n = pattern_a.extent(1); // number of rows in A and C
246  auto p = pattern_b.extent(0); // number of columns in B and C
247 #endif
248  const dash::MemArrange memory_order = pattern_a.memory_order();
249 
250  DASH_ASSERT_EQ(
251  pattern_a.extent(1),
252  pattern_b.extent(0),
253  "dash::summa(): "
254  "Extents of first operand in dimension 1 do not match extents of "
255  "second operand in dimension 0");
256  DASH_ASSERT_EQ(
257  pattern_c.extent(0),
258  pattern_a.extent(0),
259  "dash::summa(): "
260  "Extents of result matrix in dimension 0 do not match extents of "
261  "first operand in dimension 0");
262  DASH_ASSERT_EQ(
263  pattern_c.extent(1),
264  pattern_b.extent(1),
265  "dash::summa(): "
266  "Extents of result matrix in dimension 1 do not match extents of "
267  "second operand in dimension 1");
268 
269  DASH_LOG_TRACE("dash::summa", "matrix pattern extents valid");
270 
271  // Patterns are balanced, all blocks have identical size:
272  auto block_size_m = pattern_a.block(0).extent(0);
273  auto block_size_n = pattern_b.block(0).extent(1);
274  auto block_size_p = pattern_b.block(0).extent(0);
275  auto num_blocks_m = m / block_size_m;
276 #if DASH_ENABLE_TRACE_LOGGING
277  auto num_blocks_n = n / block_size_n;
278  auto num_blocks_p = p / block_size_p;
279 #endif
280  // Size of temporary local blocks
281  auto block_a_size = block_size_n * block_size_m;
282  auto block_b_size = block_size_m * block_size_p;
283  // Number of units in rows and columns:
284  auto teamspec = C.pattern().teamspec();
285  auto unit_ts_coords = teamspec.coords(unit_id);
286 
287  DASH_LOG_TRACE("dash::summa", "blocks:",
288  "m:", num_blocks_m, "*", block_size_m,
289  "n:", num_blocks_n, "*", block_size_n,
290  "p:", num_blocks_p, "*", block_size_p);
291  DASH_LOG_TRACE("dash::summa",
292  "number of units:",
293  "cols:", teamspec.extent(0),
294  "rows:", teamspec.extent(1),
295  "unit team coords:", unit_ts_coords);
296  DASH_LOG_TRACE("dash::summa", "allocating local temporary blocks, sizes:",
297  "A:", block_a_size,
298  "B:", block_b_size);
299 
300 #ifdef DASH_ENABLE_MKL
301  value_type * buf_block_a_get = (value_type *)(mkl_malloc(
302  sizeof(value_type) * block_a_size, 64));
303  value_type * buf_block_b_get = (value_type *)(mkl_malloc(
304  sizeof(value_type) * block_b_size, 64));
305  value_type * buf_block_a_comp = (value_type *)(mkl_malloc(
306  sizeof(value_type) * block_a_size, 64));
307  value_type * buf_block_b_comp = (value_type *)(mkl_malloc(
308  sizeof(value_type) * block_b_size, 64));
309 #else
310  auto *buf_block_a_get = new value_type[block_a_size];
311  auto *buf_block_b_get = new value_type[block_b_size];
312  auto *buf_block_a_comp = new value_type[block_a_size];
313  auto *buf_block_b_comp = new value_type[block_b_size];
314 #endif
315  // Copy of buffer pointers for swapping, delete[] on swapped pointers tends
316  // to crash:
317  value_type * local_block_a_get = buf_block_a_get;
318  value_type * local_block_b_get = buf_block_b_get;
319  value_type * local_block_a_comp = buf_block_a_comp;
320  value_type * local_block_b_comp = buf_block_b_comp;
321  value_type * local_block_a_get_bac = nullptr;
322  value_type * local_block_b_get_bac = nullptr;
323  value_type * local_block_a_comp_bac = nullptr;
324  value_type * local_block_b_comp_bac = nullptr;
325  // -------------------------------------------------------------------------
326  // Prefetch blocks from A and B for first local multiplication:
327  // -------------------------------------------------------------------------
328  // Block coordinates of submatrices of A and B to be prefetched:
329  // Local block index of local submatrix of C for multiplication result of
330  // blocks to be prefetched:
331  auto l_block_c_get = C.local.block(0);
332  auto l_block_c_get_view = l_block_c_get.begin().viewspec();
333  index_t l_block_c_get_row = l_block_c_get_view.offset(1) / block_size_n;
334  index_t l_block_c_get_col = l_block_c_get_view.offset(0) / block_size_p;
335  // Block coordinates of blocks in A and B to prefetch:
336  coords_t block_a_get_coords = coords_t {{ static_cast<index_t>(unit_ts_coords[0]),
337  l_block_c_get_row }};
338  coords_t block_b_get_coords = coords_t {{ l_block_c_get_col,
339  static_cast<index_t>(unit_ts_coords[0]) }};
340  // Local block index of local submatrix of C for multiplication result of
341  // currently prefetched blocks:
342  auto l_block_c_comp = l_block_c_get;
343  auto l_block_c_comp_view = l_block_c_comp.begin().viewspec();
344  index_t l_block_c_comp_row = l_block_c_comp_view.offset(1) / block_size_n;
345  index_t l_block_c_comp_col = l_block_c_comp_view.offset(0) / block_size_p;
346  // Prefetch blocks from A and B for computation in next iteration:
349  auto block_a = A.block(block_a_get_coords);
350  auto block_a_lptr = block_a.begin().local();
351  auto block_b = B.block(block_b_get_coords);
352  auto block_b_lptr = block_b.begin().local();
353  DASH_LOG_TRACE("dash::summa", "summa.prefetch.block.a",
354  "block:", block_a_get_coords,
355  "local:", block_a_lptr != nullptr,
356  "unit:", block_a.begin().lpos().unit,
357  "view:", block_a.begin().viewspec());
358 
359  dash::util::Trace trace("SUMMA");
360 
361  trace.enter_state("prefetch");
362  if (block_a_lptr == nullptr) {
363 #ifdef DASH_ALGORITHM_SUMMA_ASYNC_INIT_PREFETCH
364  get_a = dash::copy_async(block_a.begin(), block_a.end(),
365  local_block_a_comp);
366 #else
367  dash::copy(block_a.begin(), block_a.end(),
368  local_block_a_comp);
370  [=]() { return local_block_a_comp + block_a.size(); });
371 #endif
372  } else {
373  local_block_a_comp_bac = local_block_a_comp;
374  local_block_a_comp = block_a_lptr;
375  }
376 
377  DASH_LOG_TRACE("dash::summa", "summa.prefetch.block.b",
378  "block:", block_b_get_coords,
379  "local:", block_b_lptr != nullptr,
380  "unit:", block_b.begin().lpos().unit,
381  "view:", block_b.begin().viewspec());
382  if (block_b_lptr == nullptr) {
383 #ifdef DASH_ALGORITHM_SUMMA_ASYNC_INIT_PREFETCH
384  get_b = dash::copy_async(block_b.begin(), block_b.end(),
385  local_block_b_comp);
386 #else
387  dash::copy(block_b.begin(), block_b.end(),
388  local_block_b_comp);
390  [=]() { return local_block_b_comp + block_b.size(); });
391 #endif
392  } else {
393  local_block_b_comp_bac = local_block_b_comp;
394  local_block_b_comp = block_b_lptr;
395  }
396 #ifdef DASH_ALGORITHM_SUMMA_ASYNC_INIT_PREFETCH
397  if (block_a_lptr == nullptr) {
398  DASH_LOG_TRACE("dash::summa", "summa.prefetch.block.a.wait",
399  "waiting for prefetching of block A from unit",
400  block_a.begin().lpos().unit);
401  get_a.wait();
402  }
403  if (block_b_lptr == nullptr) {
404  DASH_LOG_TRACE("dash::summa", "summa.prefetch.block.b.wait",
405  "waiting for prefetching of block B from unit",
406  block_b.begin().lpos().unit);
407  get_b.wait();
408  }
409 #endif
410  trace.exit_state("prefetch");
411 
412  DASH_LOG_TRACE("dash::summa", "summa.block",
413  "prefetching of blocks completed");
414  // -------------------------------------------------------------------------
415  // Iterate local blocks in matrix C:
416  // -------------------------------------------------------------------------
417  extent_t num_local_blocks_c = pattern_c.local_blockspec().size();
418 
419  DASH_LOG_TRACE("dash::summa", "summa.block.C",
420  "C.num.local.blocks:", num_local_blocks_c,
421  "C.num.column.blocks:", num_blocks_m);
422 
423  for (extent_t lb = 0; lb < num_local_blocks_c; ++lb) {
424  // Block coordinates for current block multiplication result:
425  l_block_c_comp = C.local.block(lb);
426  l_block_c_comp_view = l_block_c_comp.begin().viewspec();
427  l_block_c_comp_row = l_block_c_comp_view.offset(1) / block_size_n;
428  l_block_c_comp_col = l_block_c_comp_view.offset(0) / block_size_p;
429  // Block coordinates for next block multiplication result:
430  l_block_c_get = l_block_c_comp;
431  l_block_c_get_view = l_block_c_comp_view;
432  l_block_c_get_row = l_block_c_get_row;
433  l_block_c_get_col = l_block_c_get_col;
434  DASH_LOG_TRACE("dash::summa", "summa.block.comp", "C.local.block",
435  "l_block_idx:", lb,
436  "row:", l_block_c_comp_row,
437  "col:", l_block_c_comp_col,
438  "view:", l_block_c_comp_view);
439  // -----------------------------------------------------------------------
440  // Iterate blocks in columns of A / rows of B:
441  // -----------------------------------------------------------------------
442  for (extent_t block_k = 0; block_k < num_blocks_m; ++block_k) {
443  DASH_LOG_TRACE("dash::summa", "summa.block.k", block_k,
444  "active local block in C:", lb);
445 
446  // ---------------------------------------------------------------------
447  // Prefetch local copy of blocks from A and B for multiplication in
448  // next iteration.
449  // ---------------------------------------------------------------------
450  bool last = (lb == num_local_blocks_c - 1) &&
451  (block_k == num_blocks_m - 1);
452  // Do not prefetch blocks in last iteration:
453  if (!last) {
454  auto block_get_k = static_cast<index_t>(block_k + 1);
455  block_get_k = (block_get_k + unit_ts_coords[0]) % num_blocks_m;
456  // Block coordinate of local block in matrix C to prefetch:
457  if (block_k == num_blocks_m - 1) {
458  // Prefetch for next local block in matrix C:
459  block_get_k = unit_ts_coords[0];
460  l_block_c_get = C.local.block(lb + 1);
461  l_block_c_get_view = l_block_c_get.begin().viewspec();
462  l_block_c_get_row = l_block_c_get_view.offset(1) / block_size_n;
463  l_block_c_get_col = l_block_c_get_view.offset(0) / block_size_p;
464  }
465  // Block coordinates of blocks in A and B to prefetch:
466  block_a_get_coords = coords_t {{ block_get_k, l_block_c_get_row }};
467  block_b_get_coords = coords_t {{ l_block_c_get_col, block_get_k }};
468 
469  block_a = A.block(block_a_get_coords);
470  block_a_lptr = block_a.begin().local();
471  block_b = B.block(block_b_get_coords);
472  block_b_lptr = block_b.begin().local();
473  DASH_LOG_TRACE("dash::summa", "summa.prefetch.block.a",
474  "block:", block_a_get_coords,
475  "local:", block_a_lptr != nullptr,
476  "unit:", block_a.begin().lpos().unit,
477  "view:", block_a.begin().viewspec());
478  if (block_a_lptr == nullptr) {
479  get_a = dash::copy_async(block_a.begin(),
480  block_a.end(),
481  local_block_a_get);
482  local_block_a_get_bac = nullptr;
483  } else {
484  local_block_a_get_bac = local_block_a_get;
485  local_block_a_get = block_a_lptr;
486  }
487  DASH_LOG_TRACE("dash::summa", "summa.prefetch.block.b",
488  "block:", block_b_get_coords,
489  "local:", block_b_lptr != nullptr,
490  "unit:", block_b.begin().lpos().unit,
491  "view:", block_b.begin().viewspec());
492  if (block_b_lptr == nullptr) {
493  get_b = dash::copy_async(block_b.begin(),
494  block_b.end(),
495  local_block_b_get);
496  local_block_b_get_bac = nullptr;
497  } else {
498  local_block_b_get_bac = local_block_b_get;
499  local_block_b_get = block_b_lptr;
500  }
501  } else {
502  DASH_LOG_TRACE("dash::summa", " ->",
503  "last block multiplication",
504  "lb:", lb, "bk:", block_k);
505  }
506  // ---------------------------------------------------------------------
507  // Computation of matrix product of local block matrices:
508  // ---------------------------------------------------------------------
509  DASH_LOG_TRACE("dash::summa", "summa.block.comp.multiply",
510  "multiplying local block matrices",
511  "C.local.block.comp:", lb,
512  "view:", l_block_c_comp.begin().viewspec());
513 
514  trace.enter_state("multiply");
515  dash::internal::mmult_local<value_type>(
516  local_block_a_comp,
517  local_block_b_comp,
518  l_block_c_comp.begin().local(),
519  block_size_m,
520  block_size_n,
521  block_size_p,
522  memory_order);
523  trace.exit_state("multiply");
524 
525  if (local_block_a_comp_bac != nullptr) {
526  local_block_a_comp = local_block_a_comp_bac;
527  local_block_a_comp_bac = nullptr;
528  }
529  if (local_block_b_comp_bac != nullptr) {
530  local_block_b_comp = local_block_b_comp_bac;
531  local_block_b_comp_bac = nullptr;
532  }
533  if (!last) {
534  // -------------------------------------------------------------------
535  // Wait for local copies:
536  // -------------------------------------------------------------------
537  trace.enter_state("prefetch");
538  if (block_a_lptr == nullptr) {
539  DASH_LOG_TRACE("dash::summa", "summa.prefetch.block.a.wait",
540  "waiting for prefetching of block A from unit",
541  block_a.begin().lpos().unit);
542  get_a.wait();
543  }
544  if (block_b_lptr == nullptr) {
545  DASH_LOG_TRACE("dash::summa", "summa.prefetch.block.b.wait",
546  "waiting for prefetching of block B from unit",
547  block_b.begin().lpos().unit);
548  get_b.wait();
549  }
550  DASH_LOG_TRACE("dash::summa", "summa.prefetch.completed",
551  "local copies of next blocks received");
552  trace.exit_state("prefetch");
553 
554  // -----------------------------------------------------------------
555  // Swap communication and computation buffers:
556  // -----------------------------------------------------------------
557  std::swap(local_block_a_get, local_block_a_comp);
558  std::swap(local_block_b_get, local_block_b_comp);
559  if (local_block_a_get_bac != nullptr) {
560  local_block_a_comp_bac = local_block_a_get_bac;
561  local_block_a_get_bac = nullptr;
562  }
563  if (local_block_b_get_bac != nullptr) {
564  local_block_b_comp_bac = local_block_b_get_bac;
565  local_block_b_get_bac = nullptr;
566  }
567  }
568  }
569  } // for lb
570 
571  DASH_LOG_TRACE("dash::summa", "locally completed");
572 #ifdef DASH_ENABLE_MKL
573  mkl_free(buf_block_a_get);
574  mkl_free(buf_block_b_get);
575  mkl_free(buf_block_a_comp);
576  mkl_free(buf_block_b_comp);
577 #else
578  delete[] buf_block_a_get;
579  delete[] buf_block_b_get;
580  delete[] buf_block_a_comp;
581  delete[] buf_block_b_comp;
582 #endif
583 
584  DASH_LOG_TRACE("dash::summa", "waiting for other units");
585  trace.enter_state("barrier");
586  C.barrier();
587  trace.exit_state("barrier");
588 
589  DASH_LOG_TRACE("dash::summa >", "finished");
590 }
dash::Future< ValueType * > copy_async(InputIt in_first, InputIt in_last, OutputIt out_first)
Asynchronous variant of dash::copy.
Traits for compile-time pattern constraints checking, suitable as a helper for template definitions e...
Implementation of a future used to wait for an operation to complete and access the value returned by...
Definition: Future.h:20
Minimal number of blocks in every dimension, typically at most one block per unit.
Units are mapped to blocks in diagonal chains in all hyperplanes.
A Team instance specifies a subset of all available units.
Definition: Team.h:41
void wait()
Wait for the value to become available.
Definition: Future.h:165
bool check_pattern_constraints(const PatternType &pattern)
Traits for compile- and run-time pattern constraints checking, suitable for property checks where det...
OutputIt copy(InputIt in_first, InputIt in_last, OutputIt out_first)
Copies the elements in the range, defined by [in_first, in_last), to another range beginning at out_f...
Generic type of mapping properties of a model satisfying the Pattern concept.

◆ swap() [1/2]

template<class T1 , class T2 >
void dash::swap ( Pair< T1, T2 > &  x,
Pair< T1, T2 > &  y 
)
inlinenoexcept

Wrapper for Pair::swap.

Definition at line 192 of file Pair.h.

194  {
195  x.swap(y);
196  }

◆ swap() [2/2]

template<typename T >
void dash::swap ( dash::GlobRef< T > &&  a,
dash::GlobRef< T > &&  b 
)
inline

specialization for unqualified calls to swap

Definition at line 424 of file GlobRef.h.

Referenced by dash::Coarray< T, IndexType, Arrangement, LocalMemSpaceT >::Coarray(), and dash::GlobSharedRef< T, GlobalPointerType >::operator=().

424  {
425  a.swap(b);
426 }
void swap(dash::GlobRef< T > &b) const
specialization which swappes the values of two global references
Definition: GlobRef.h:391

◆ typestr() [1/2]

template<class T >
std::string dash::typestr ( const T &  obj)

Returns string containing the type name of the given object.

Similar to the typeid operator but ensures human-readable, demangled format.

Definition at line 20 of file TypeInfo.h.

Referenced by dash::Atomic< T >::Atomic(), dash::LocalMemoryLayout< NumDimensions, Arrangement, IndexType >::coords(), make_pair(), and dash::GlobRef< T >::swap().

20  {
21  return dash::internal::demangle(
22  typeid(obj).name()
23  );
24 }

◆ typestr() [2/2]

template<class T >
std::string dash::typestr ( )

Returns string containing the name of the specified type.

Similar to the typeid operator but ensures human-readable, demangled format.

Definition at line 33 of file TypeInfo.h.

33  {
34  return dash::internal::demangle(
35  typeid(T).name()
36  );
37 }

Variable Documentation

◆ const

struct dash::dart_operation const ValueType& rhs dash::const
Initial value:
{
return (lhs < rhs) ? lhs : rhs

Definition at line 131 of file Operation.h.

◆ UNDEFINED_GLOBAL_UNIT_ID

constexpr global_unit_t dash::UNDEFINED_GLOBAL_UNIT_ID { ((dart_unit_t)(-1)) }

Invalid global unit ID.

This is a typed version of DART_UNDEFINED_UNIT_ID.

Definition at line 348 of file Types.h.

◆ UNDEFINED_TEAM_UNIT_ID