1 #ifndef ARRAY_H_INCLUDED 2 #define ARRAY_H_INCLUDED 4 #include <dash/Cartesian.h> 5 #include <dash/Dimensional.h> 6 #include <dash/Exception.h> 7 #include <dash/GlobRef.h> 8 #include <dash/GlobAsyncRef.h> 9 #include <dash/HView.h> 10 #include <dash/Meta.h> 11 #include <dash/Team.h> 12 #include <dash/Types.h> 14 #include <dash/allocator/GlobalAllocator.h> 15 #include <dash/iterator/GlobIter.h> 16 #include <dash/memory/MemorySpace.h> 17 #include <dash/memory/UniquePtr.h> 18 #include <dash/pattern/BlockPattern1D.h> 21 #include <initializer_list> 22 #include <type_traits> 88 class LocalMemSpaceT >
104 typename LocalMemSpaceT>
108 static const dim_t NumDimensions = 1;
116 typedef std::array<typename PatternType::size_type, NumDimensions>
120 template <
typename T_,
typename I_,
typename P_,
typename M_>
124 typedef T value_type;
126 typedef typename std::make_unsigned<IndexType>::type size_type;
127 typedef IndexType index_type;
129 typedef IndexType difference_type;
131 typedef T & reference;
132 typedef const T & const_reference;
135 typedef const T * const_pointer;
137 typedef T * iterator;
138 typedef const T * const_iterator;
147 typedef std::integral_constant<dim_t, 1>
159 const Array_t * array)
165 const Array_t * array,
167 const ViewSpec_t & viewspec)
175 self_t & operator=(
const self_t &) =
default;
176 self_t & operator=(self_t &&) =
default;
181 constexpr const_iterator
begin() const noexcept {
182 return _array->m_lbegin;
189 return _array->m_lbegin;
195 constexpr const_iterator
end() const noexcept {
196 return _array->m_lend;
202 inline iterator
end() noexcept {
203 return _array->m_lend;
209 constexpr size_type
size() const noexcept {
216 constexpr const_reference
operator[](
const size_type n)
const {
217 return (_array->m_lbegin)[n];
224 return (_array->m_lbegin)[n];
234 index_type local_index)
const {
241 constexpr self_t
block(index_type block_lindex)
const 243 return self_t(_array,
pattern().local_block(block_lindex));
249 constexpr
const PatternType &
pattern() const noexcept {
255 const Array_t * _array;
257 ViewSpec_t _viewspec;
266 typename LocalMemSpaceT>
270 typedef AsyncArrayRef<T, IndexType, PatternType, LocalMemSpaceT>
274 template <
typename T_,
typename I_,
typename P_,
typename M_>
275 friend class AsyncArrayRef;
278 typedef T value_type;
279 typedef typename std::make_unsigned<IndexType>::type size_type;
280 typedef IndexType difference_type;
282 typedef T & reference;
283 typedef const T & const_reference;
285 typedef T * iterator;
286 typedef const T * const_iterator;
289 typedef const T * const_pointer;
295 typedef std::integral_constant<dim_t, 1>
314 AsyncArrayRef(
const self_t &) =
default;
315 AsyncArrayRef(self_t &&) =
default;
317 self_t & operator=(
const self_t &) =
default;
318 self_t & operator=(self_t &&) =
default;
326 constexpr const_iterator
begin()
const noexcept {
327 return _array->m_begin;
335 inline iterator
begin() noexcept {
336 return _array->m_begin;
344 constexpr const_iterator
end()
const noexcept {
345 return _array->m_end;
353 inline iterator
end() noexcept {
354 return _array->m_end;
360 constexpr size_type
size()
const noexcept {
361 return _array->
size();
367 constexpr const_async_reference
operator[](
const size_type n)
const {
368 return const_async_reference(
369 (*(_array->
begin() + n)).dart_gptr());
375 async_reference
operator[](
const size_type n) {
376 return async_reference(
377 (*(_array->
begin() + n)).dart_gptr());
384 inline void flush()
const {
393 _array->
flush(target);
400 inline void flush_local()
const {
429 typedef typename PatternT::index_type index_type;
443 typename ElementType,
446 typename LocalMemSpaceT>
450 static const dim_t NumDimensions = 1;
458 typedef std::array<typename PatternType::size_type, NumDimensions>
464 typedef IndexType index_type;
465 typedef typename std::make_unsigned<IndexType>::type size_type;
466 typedef typename std::make_unsigned<IndexType>::type difference_type;
477 typedef std::reverse_iterator<iterator> reverse_iterator;
478 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
495 typedef AsyncArrayRef<value_type, IndexType, PatternType, LocalMemSpaceT>
499 typedef std::integral_constant<dim_t, 1>
509 const Array_t * array,
511 const ViewSpec_t & viewspec)
514 _begin(array->
begin() + _viewspec.offsets()[0]),
515 _end(array->
begin() + _viewspec.offsets()[0] + _viewspec.extents()[0]),
516 _size(_viewspec.
size())
520 constexpr
Team & team()
const {
524 constexpr size_type
size()
const noexcept {
528 constexpr size_type local_size()
const noexcept;
529 constexpr size_type local_capacity()
const noexcept;
531 constexpr size_type
extent(
dim_t dim)
const noexcept {
532 return _viewspec.extents()[dim];
534 constexpr Extents_t extents()
const noexcept {
535 return _viewspec.extents();
537 constexpr
bool empty()
const noexcept {
543 constexpr const_pointer data()
const noexcept {
546 inline iterator
begin() noexcept {
549 constexpr const_iterator
begin()
const noexcept {
552 inline iterator
end() noexcept {
555 constexpr const_iterator
end()
const noexcept {
559 inline local_type sub_local() noexcept;
561 constexpr ElementType * lbegin()
const noexcept;
563 constexpr ElementType * lend()
const noexcept;
567 size_type global_index)
569 DASH_LOG_TRACE(
"ArrayRef.[]=", global_index);
570 return _arr->_begin[global_index];
575 size_type global_index)
const 577 return _arr->_begin[global_index];
582 size_type global_pos)
584 if (global_pos >=
size()) {
587 "Position " << global_pos
588 <<
" is out of range " <<
size()
589 <<
" in ArrayRef.at()" );
591 return _arr->_begin[global_pos];
596 size_type global_pos)
const 598 if (global_pos >=
size()) {
601 "Position " << global_pos
602 <<
" is out of range " <<
size()
603 <<
" in ArrayRef.at()" );
605 return _arr->_begin[global_pos];
611 constexpr
const PatternType &
pattern()
const {
612 return _arr->pattern();
617 const Array_t *
const _arr;
619 ViewSpec_t _viewspec;
640 typename ElementType,
650 "Type not supported for DASH containers");
659 typedef IndexType index_type;
660 typedef typename std::make_unsigned<IndexType>::type size_type;
661 typedef typename std::make_unsigned<IndexType>::type difference_type;
669 typedef std::reverse_iterator< iterator> reverse_iterator;
670 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
675 typedef typename iterator::pointer pointer;
676 typedef typename pointer::const_type const_pointer;
678 typedef typename pointer::local_type local_pointer;
679 typedef typename pointer::const_local_type const_local_pointer;
695 friend class AsyncArrayRef;
707 typedef AsyncArrayRef<value_type, IndexType, PatternType, LocalMemSpaceT>
711 typedef std::integral_constant<dim_t, 1>
722 using unique_gptr_t = decltype(
723 dash::allocate_unique<value_type>(allocator_type{}, std::size_t{}));
725 using allocator_traits =
726 std::allocator_traits<typename memory_type::allocator_type>;
728 static constexpr
size_t alignment =
alignof(value_type);
740 PatternType m_pattern{};
742 memory_type m_globmem{};
744 allocator_type m_allocator{};
746 unique_gptr_t m_data{
nullptr};
756 size_type m_lcapacity{};
758 ElementType * m_lbegin{};
760 ElementType * m_lend{};
774 , m_pattern(SizeSpec_t(0), distribution_spec(
dash::BLOCKED), team)
776 DASH_LOG_TRACE(
"Array() >",
"finished default constructor");
784 const distribution_spec &distribution,
789 , m_pattern(SizeSpec_t(nelem), distribution, team)
791 DASH_LOG_TRACE(
"Array(nglobal,dist,team)()",
"size:", nelem);
793 DASH_LOG_TRACE(
"Array(nglobal,dist,team) >");
803 "Array(nglobal,team) >",
"finished delegating constructor");
812 std::initializer_list<value_type> local_elements,
813 const distribution_spec & distribution,
818 , m_pattern(SizeSpec_t(nelem), distribution, team)
820 , m_allocator(&m_globmem)
821 , m_myid(team.
myid())
823 DASH_LOG_TRACE(
"Array(nglobal,lvals,dist,team)()",
825 "nlocal:", local_elements.size());
826 allocate(local_elements);
827 DASH_LOG_TRACE(
"Array(nglobal,lvals,dist,team) >");
836 std::initializer_list<value_type> local_elements,
838 :
Array(nelem, local_elements,
dash::BLOCKED, team)
840 DASH_LOG_TRACE(
"Array(nglobal,lvals,team) >",
841 "finished delegating constructor");
852 m_team(&pattern.team()),
854 m_myid(m_team->
myid())
856 DASH_LOG_TRACE(
"Array()",
"pattern instance constructor");
878 Array(
const self_t & other) =
delete;
888 std::is_nothrow_move_constructible<memory_type>::value)
891 , m_team(other.m_team)
892 , m_pattern(
std::move(other.m_pattern))
893 , m_globmem(
std::move(other.m_globmem))
894 , m_allocator(&m_globmem)
896 other.m_data.release(),
897 typename unique_gptr_t::deleter_type{m_allocator,
898 m_pattern.local_size()})
899 , m_begin(other.m_begin)
901 , m_size(other.m_size)
902 , m_lsize(other.m_lsize)
903 , m_lcapacity(other.m_lcapacity)
904 , m_lbegin(other.m_lbegin)
905 , m_lend(other.m_lend)
906 , m_myid(other.m_myid)
908 other.m_begin = iterator{};
909 other.m_end = iterator{};
910 other.m_lbegin =
nullptr;
911 other.m_lend =
nullptr;
919 m_team->register_deallocator(
this, std::bind(&Array::deallocate,
this));
940 self_t & operator=(
const self_t & rhs) =
delete;
950 if (
this == &other) {
954 m_pattern = std::move(other.m_pattern);
957 m_allocator.resource(),
959 "invalid state in move assignment");
963 destruct_at_end(m_lbegin);
967 m_globmem = std::move(other.m_globmem);
969 unique_gptr_t __tmp{other.m_data.release(),
970 typename unique_gptr_t::deleter_type{
971 m_allocator, m_pattern.local_size()}};
972 m_data = std::move(__tmp);
976 this->m_begin = iterator{&m_globmem, m_pattern, other.m_begin.
pos()};
977 this->m_end = iterator{&m_globmem, m_pattern, other.m_end.
pos()};
979 this->m_lbegin = other.m_lbegin;
980 this->m_lcapacity = other.m_lcapacity;
981 this->m_lend = other.m_lend;
982 this->m_lsize = other.m_lsize;
983 this->m_myid = other.m_myid;
984 this->m_size = other.m_size;
985 this->m_team = other.m_team;
987 other.m_begin = iterator{};
988 other.m_end = iterator{};
990 other.m_lbegin =
nullptr;
991 other.m_lend =
nullptr;
997 m_team->register_deallocator(
this, std::bind(&Array::deallocate,
this));
1007 DASH_LOG_TRACE_VAR(
"Array.~Array()",
this);
1009 DASH_LOG_TRACE_VAR(
"Array.~Array >",
this);
1015 constexpr
const view_type
block(index_type block_gindex)
const 1024 constexpr
const memory_type &
globmem() const noexcept
1032 constexpr const_pointer
data() const noexcept
1034 return const_pointer(m_data.get());
1048 constexpr const_iterator
begin() const noexcept
1050 return const_iterator(
1051 const_cast<memory_type *>(&m_globmem), m_pattern, m_begin.pos());
1064 constexpr const_iterator
end() const noexcept
1066 return const_iterator(
1067 const_cast<memory_type *>(&m_globmem), m_pattern, m_end.pos());
1073 constexpr
const ElementType *
lbegin() const noexcept {
1087 constexpr
const ElementType *
lend() const noexcept {
1106 size_type global_index)
1108 return m_begin[global_index];
1119 size_type global_index)
const 1121 return m_begin[global_index];
1134 size_type global_pos)
1136 if (global_pos >=
size()) {
1139 "Position " << global_pos
1140 <<
" is out of range " <<
size()
1141 <<
" in Array.at()" );
1143 return m_begin[global_pos];
1156 size_type global_pos)
const 1158 if (global_pos >=
size()) {
1161 "Position " << global_pos
1162 <<
" is out of range " <<
size()
1163 <<
" in Array.at()" );
1165 return m_begin[global_pos];
1173 constexpr size_type
size() const noexcept
1206 constexpr size_type
lsize() const noexcept
1232 constexpr view_type local_in(dash::util::Locality::Scope scope)
const 1245 index_type global_index)
const 1247 return m_pattern.is_local(global_index, m_myid);
1256 DASH_LOG_TRACE_VAR(
"Array.barrier()", m_team);
1261 DASH_LOG_TRACE(
"Array.barrier >",
"passed barrier");
1272 m_globmem.flush(m_data.get());
1282 m_globmem.flush(m_data.get(), target);
1292 m_globmem.flush_local(m_data.get());
1303 m_globmem.flush_local(m_data.get(), target);
1310 constexpr
const PatternType &
pattern() const noexcept
1324 DASH_LOG_TRACE_VAR(
"Array.allocate(nlocal,ds,team)", nelem);
1325 DASH_LOG_TRACE_VAR(
"Array.allocate", m_team->dart_id());
1326 DASH_LOG_TRACE_VAR(
"Array.allocate", team.dart_id());
1329 DASH_LOG_WARN(
"Array.allocate",
"allocating dash::Array with size 0");
1332 DASH_LOG_TRACE(
"Array.allocate",
1333 "initializing with specified team -",
1334 "team size:", team.size());
1336 m_pattern = PatternType(nelem, distribution, team);
1337 DASH_LOG_TRACE_VAR(
"Array.allocate", team.dart_id());
1338 DASH_LOG_TRACE_VAR(
"Array.allocate", m_pattern.team().dart_id());
1340 DASH_LOG_TRACE(
"Array.allocate",
1341 "initializing pattern with initial team");
1342 m_pattern = PatternType(nelem, distribution, *m_team);
1345 bool ret = allocate(m_pattern);
1346 DASH_LOG_TRACE(
"Array.allocate(nlocal,ds,team) >");
1359 return allocate(nelem, dash::BLOCKED, team);
1369 std::initializer_list<value_type> local_elements,
1373 DASH_LOG_TRACE_VAR(
"Array.allocate(lvals,ds,team)",
1374 local_elements.size());
1375 DASH_LOG_TRACE_VAR(
"Array.allocate", m_team->dart_id());
1376 DASH_LOG_TRACE_VAR(
"Array.allocate", team.dart_id());
1381 "Tried to allocate dash::Array with size 0");
1384 DASH_LOG_TRACE(
"Array.allocate",
1385 "initializing pattern with Team::All()");
1387 m_pattern = PatternType(nelem, distribution, team);
1388 DASH_LOG_TRACE_VAR(
"Array.allocate", team.dart_id());
1389 DASH_LOG_TRACE_VAR(
"Array.allocate", m_pattern.team().dart_id());
1391 DASH_LOG_TRACE(
"Array.allocate",
1392 "initializing pattern with initial team");
1393 m_pattern = PatternType(nelem, distribution, *m_team);
1395 bool ret = allocate(local_elements);
1396 DASH_LOG_TRACE(
"Array.allocate(lvals,ds,team) >");
1402 DASH_LOG_TRACE_VAR(
"Array.deallocate()",
this);
1403 DASH_LOG_TRACE_VAR(
"Array.deallocate()", m_size);
1410 m_team->unregister_deallocator(
1411 this, std::bind(&Array::deallocate,
this));
1414 DASH_LOG_TRACE_VAR(
"Array.deallocate()", m_data.get());
1417 destruct_at_end(m_lbegin);
1424 m_begin = iterator{};
1428 DASH_LOG_TRACE_VAR(
"Array.deallocate >",
this);
1432 void destruct_at_end(local_pointer new_last)
1434 if (0 == m_lsize || m_lend ==
nullptr)
return;
1436 local_pointer soon_to_be_new_last = m_lend;
1438 auto local_alloc = this->globmem().get_allocator();
1440 while (new_last != soon_to_be_new_last) {
1441 allocator_traits::destroy(local_alloc, --soon_to_be_new_last);
1446 void do_allocate() {
1450 m_team = &(m_pattern.team());
1451 m_globmem = memory_type{*m_team};
1452 m_allocator = allocator_type{&m_globmem};
1455 m_size = m_pattern.capacity();
1456 m_team = &m_pattern.team();
1458 DASH_LOG_WARN(
"Array.allocate",
"allocating dash::Array with size 0");
1461 m_lsize = m_pattern.local_size();
1462 m_lcapacity = m_pattern.local_capacity();
1463 m_myid = m_pattern.team().myid();
1465 DASH_LOG_TRACE_VAR(
"Array._allocate", m_myid);
1466 DASH_LOG_TRACE_VAR(
"Array._allocate", m_lcapacity);
1467 DASH_LOG_TRACE_VAR(
"Array._allocate", m_lsize);
1469 m_data = std::move(dash::allocate_unique<value_type>(
1470 m_allocator, m_pattern.local_size()));
1472 if (m_pattern.local_size()) {
1473 DASH_ASSERT(m_data);
1477 m_begin = iterator(&m_globmem, m_pattern);
1478 m_end = iterator(m_begin) + m_size;
1481 bool allocate(std::initializer_list<value_type> local_elements)
1483 DASH_LOG_TRACE(
"< Array.allocate",
"finished");
1486 m_pattern.local_size(), local_elements.size(),
"invalid arguments");
1491 auto soon_to_be_lbegin = m_data.get();
1492 soon_to_be_lbegin.set_unit(m_myid);
1493 m_lbegin = soon_to_be_lbegin.local();
1495 DASH_ASSERT(m_lbegin);
1498 std::uninitialized_copy(
std::begin(local_elements),
std::end(local_elements), m_lbegin);
1499 m_lend = std::next(m_lbegin, local_elements.size());
1501 DASH_LOG_TRACE_VAR(
"Array._allocate", m_myid);
1502 DASH_LOG_TRACE_VAR(
"Array._allocate", m_size);
1503 DASH_LOG_TRACE_VAR(
"Array._allocate", m_lsize);
1506 m_team->register_deallocator(
1507 this, std::bind(&Array::deallocate,
this));
1511 DASH_LOG_TRACE(
"Array._allocate",
"waiting for allocation of all units");
1514 DASH_LOG_TRACE(
"Array._allocate >",
"finished");
1524 DASH_LOG_TRACE(
"< Array.allocate",
"finished");
1525 if (&m_pattern != &pattern) {
1526 DASH_LOG_TRACE(
"Array.allocate()",
"using specified pattern");
1533 auto soon_to_be_lbegin = m_data.get();
1534 soon_to_be_lbegin.set_unit(m_myid);
1535 m_lbegin = soon_to_be_lbegin.local();
1538 m_lend = std::next(m_lbegin, m_lsize);
1545 m_team->register_deallocator(
this, std::bind(&Array::deallocate,
this));
1549 DASH_LOG_TRACE(
"Array.allocate",
"waiting for allocation of all units");
1551 DASH_LOG_TRACE(
"Array.allocate >",
"finished");
constexpr dim_t rank(const DimensionalType &d)
ElementType value_type
Public types as required by iterator concept.
async_type async
Proxy object, provides non-blocking operations on array.
constexpr size_type size() const noexcept
Number of array elements in local memory.
bool allocate(size_type nelem, Team &team=dash::Team::All())
Delayed allocation of global memory using the default blocked distribution spec.
global_unit_t myid()
Shortcut to query the global unit ID of the calling unit.
constexpr const_iterator end() const noexcept
Pointer past final local element in the array.
constexpr auto end(RangeType &&range) -> decltype(std::forward< RangeType >(range).end())
This class is a simple memory pool which holds allocates elements of size ValueType.
constexpr const_iterator begin() const noexcept
Global pointer to the beginning of the array.
Specifies cartesian extents in a specific number of dimensions.
Specifies view parameters for implementing submat, rows and cols.
constexpr size_type lcapacity() const noexcept
The capacity of the local part of the array.
constexpr auto begin(RangeType &&range) -> decltype(std::forward< RangeType >(range).begin())
constexpr const ElementType * lbegin() const noexcept
Native pointer to the first local element in the array.
iterator end() noexcept
Global pointer to the end of the array.
int dim_t
Scalar type for a dimension value, with 0 indicating the first dimension.
void flush_local() const
Locally complete all outstanding non-blocking operations to all units on the array's underlying globa...
Array(size_type nelem, std::initializer_list< value_type > local_elements, const distribution_spec &distribution, Team &team=dash::Team::All())
Constructor, specifies the array's global capacity, values of local elements and distribution.
constexpr size_type lsize() const noexcept
The number of elements in the local part of the array.
Array(size_type nelem, Team &team=dash::Team::All())
Delegating constructor, specifies the array's global capacity.
Array(const PatternType &pattern)
Constructor, specifies distribution pattern explicitly.
const_reference at(size_type global_pos) const
Random access operator, range-checked.
void flush(dash::team_unit_t target) const
Complete all outstanding non-blocking operations to the specified unit on the array's underlying glob...
ArrayRef(const Array_t *array, const ViewSpec_t &viewspec)
void unregister_deallocator(void *object, Deallocator::dealloc_function dealloc)
Unregister a deallocator function for a team-allocated object.
Proxy type representing local access to elements in a dash::Array.
bool is_initialized()
Check whether DASH has been initialized already.
ElementType value_type
Public types as required by iterator concept.
constexpr const ElementType * lend() const noexcept
Native pointer to the end of the array.
LocalArrayRef(const Array_t *array)
Constructor, creates a local access proxy for the given array.
constexpr Team & team() const noexcept
The team containing all units accessing this array.
PatternType pattern_type
Public types as required by dash container concept.
reference operator[](const size_type n)
Subscript operator, access to local array element at given position.
Array(size_type nelem, const distribution_spec &distribution, Team &team=dash::Team::All())
Constructor, specifies the array's global capacity and distribution.
ElementType * lend() noexcept
Native pointer to the end of the array.
internal::default_signed_index default_index_t
Signed integer type used as default for index values.
void flush() const
Complete all outstanding non-blocking operations to all units on the array's underlying global memory...
constexpr const PatternType & pattern() const
The pattern used to distribute array elements to units.
A Team instance specifies a subset of all available units.
reference at(size_type global_pos)
Random access assignment operator, range-checked.
LocalArrayRef(const Array_t *array, const ViewSpec_t &viewspec)
constexpr const_reference operator[](const size_type n) const
Subscript operator, access to local array element at given position.
constexpr const memory_type & globmem() const noexcept
The instance of GlobStaticMem used by this iterator to resolve addresses in global memory...
DASH_CONSTEXPR index_type pos() const DASH_NOEXCEPT
Position of the iterator in global index space.
bool allocate(const PatternType &pattern)
Delayed allocation of global memory using the specified pattern.
iterator end() noexcept
Pointer past final local element in the array.
constexpr const PatternType & pattern() const noexcept
The pattern used to distribute array elements to units.
constexpr bool empty() const noexcept
Checks whether the array is empty.
constexpr const_reference operator[](size_type global_index) const
constexpr dim_t ndim(const DimensionalType &d)
void flush_local(dash::team_unit_t target) const
Locally complete all outstanding non-blocking operations to the specified unit on the array's underly...
Proxy type representing an access modifier on elements in a dash::Array.
~Array()
Destructor, deallocates array elements.
constexpr const_reference operator[](size_type global_index) const
Subscript operator, not range-checked.
struct dash::unit_id< dash::local_unit, dart_team_unit_t > team_unit_t
Unit ID to use for team-local IDs.
constexpr size_type size() const noexcept
The size of the array.
PatternType pattern_type
Public types as required by dash container concept.
constexpr size_type capacity() const noexcept
The number of elements that can be held in currently allocated storage of the array.
constexpr const PatternType & pattern() const noexcept
The pattern used to distribute array elements to units.
constexpr self_t block(index_type block_lindex) const
View at block at given global block offset.
self_t & operator=(self_t &&other)
Move assignment is supported for the container with the following limitations:
void barrier() const
Establish a barrier for all units operating on the array, publishing all changes to all units...
reference at(size_type global_pos)
Proxy type representing a view specifier on elements in a dash::Array.
constexpr bool is_local(index_type global_index) const
Checks whether the given global index is local to the calling unit.
Type trait indicating whether the specified type is eligible for elements of DASH containers...
bool allocate(size_type nelem, std::initializer_list< value_type > local_elements, dash::DistributionSpec< 1 > distribution, dash::Team &team=dash::Team::All())
Delayed allocation of global memory using a one-dimensional distribution spec and initializing values...
static Team & Null()
The invariant Team instance representing an undefined team.
constexpr Array(Team &team=dash::Team::Null())
Default constructor, for delayed allocation.
Array(size_type nelem, std::initializer_list< value_type > local_elements, Team &team=dash::Team::All())
Delegating constructor, specifies the array's global capacity and values of local elements...
constexpr bool is_local(index_type local_index) const
Checks whether the given local index is local to the calling unit.
iterator begin() noexcept
Pointer to initial local element in the array.
constexpr DimensionalType::extent_type extent(const DimensionalType &d)
constexpr const_iterator begin() const noexcept
Pointer to initial local element in the array.
reference operator[](size_type global_index)
constexpr const view_type block(index_type block_gindex) const
View at block at given global block offset.
void barrier()
A global barrier involving all units.
Global value reference for asynchronous / non-blocking operations.
reference operator[](size_type global_index)
Subscript assignment operator, not range-checked.
static Team & All()
The invariant Team instance containing all available units.
see https://en.cppreference.com/w/cpp/feature_test for recommended feature tests
ElementType * lbegin() noexcept
Native pointer to the first local element in the array.
constexpr const_pointer data() const noexcept
Global const pointer to the beginning of the array.
iterator begin() noexcept
Global pointer to the beginning of the array.
const_reference at(size_type global_pos) const
Array(self_t &&other) noexcept(std::is_nothrow_move_constructible< memory_type >::value)
Move construction is supported for the container with the following limitations:
constexpr const_iterator end() const noexcept
Global pointer to the end of the array.
LocalArrayRef< T, IndexType, PatternType, LocalMemSpaceT > View
Type alias for LocalArrayRef<T,I,P>::view_type.
DistributionSpec describes distribution patterns of all dimensions,.
bool allocate(size_type nelem, dash::DistributionSpec< 1 > distribution, dash::Team &team=dash::Team::All())
Delayed allocation of global memory using a one-dimensional distribution spec.
local_type local
Local proxy object, allows use in range-based for loops.