DASH  0.3.0
Coarray.h
1 #ifndef COARRAY_H_INCLUDED
2 #define COARRAY_H_INCLUDED
3 
4 #include <type_traits>
5 
6 #include <dash/Types.h>
7 #include <dash/GlobRef.h>
8 #include <dash/iterator/GlobIter.h>
9 
10 #include <dash/pattern/BlockPattern.h>
11 #include <dash/Dimensional.h>
12 #include <dash/TeamSpec.h>
13 #include <dash/util/ArrayExpr.h>
14 
15 #include <dash/Array.h>
16 #include <dash/Matrix.h>
17 
18 #include <dash/Dimensional.h>
19 
20 #include <dash/atomic/Type_traits.h>
21 
44 namespace dash {
45 
46 namespace coarray {
47 
48 // forward decls
49 template<typename Container>
50 inline void sync_images(const Container & image_ids);
51 
52 namespace detail {
53 
54 template <
55  class ArrayT,
56  class ValueT,
57  std::size_t Rank,
58  std::size_t... Is >
59 constexpr std::array<ValueT, Rank>
60 type_extents_as_array_impl(
62  return { ( static_cast<ValueT>(std::extent<ArrayT,Is>::value) )... };
63 }
64 
65 template <
66  class ArrayT,
67  class ValueT,
68  std::size_t Rank >
69 constexpr std::array<ValueT, Rank>
70 type_extents_as_array() {
71  return type_extents_as_array_impl<ArrayT,ValueT,Rank>(
73 }
74 
75 template <
76  typename T >
77 constexpr bool type_is_complete() {
78  return (std::get<0>(coarray::detail::type_extents_as_array<T,
79  int, std::rank<T>::value>()) > 0);
80 }
81 
82 template<
83  typename element_type,
84  typename pattern_type,
85  int rank,
86  typename LocalMemSpaceT>
87 struct local_ref_type {
88  using type = LocalMatrixRef<element_type,
89  rank+1,
90  rank-1,
91  pattern_type, LocalMemSpaceT>;
92 };
93 
94 template<
95  typename element_type,
96  typename pattern_type,
97  typename LocalMemSpaceT>
98 struct local_ref_type<dash::Atomic<element_type>, pattern_type, 1, LocalMemSpaceT> {
99  using type = GlobRef<element_type>;
100 };
101 
102 template<
103  typename element_type,
104  typename pattern_type,
105  typename LocalMemSpaceT>
106 struct local_ref_type<element_type, pattern_type, 1, LocalMemSpaceT> {
107  using type = element_type &;
108 };
109 
110 template<typename element_type>
111 struct ref_type {
112 // GAR needs conversion operator
113 // using type = GlobAsyncRef<element_type>;
114  using type = GlobRef<element_type>;
115 };
116 
120 template<typename element_type>
121 struct ref_type<dash::Atomic<element_type>> {
122  using type = GlobRef<dash::Atomic<element_type>>;
123 };
124 
125 template<typename element_type>
126 struct const_ref_type {
127  using type = GlobAsyncRef<const element_type>;
128 };
129 
133 template<typename element_type>
134 struct const_ref_type<dash::Atomic<element_type>> {
135  using type = GlobRef<dash::Atomic<const element_type>>;
136 };
137 
138 } // namespace detail
139 
144 template<
145  typename T,
146  typename IndexType = dash::default_index_t,
147  MemArrange Arrangement = ROW_MAJOR>
149  using type = BlockPattern<
150  std::rank<
151  typename dash::remove_atomic<T>::type>::value+1,
152  Arrangement,
153  IndexType>;
154 };
155 
156 } // namespace coarray
157 
179 template<
180  typename T,
181  typename IndexType = dash::default_index_t,
182  MemArrange Arrangement = ROW_MAJOR,
183  typename LocalMemSpaceT = HostSpace>
184 class Coarray {
185 private:
186 
188 
193  using _element_type = typename std::remove_all_extents<T>::type;
194  using _base_type = typename dash::remove_atomic<_element_type>::type;
195 
196  using _valuetype_rank = std::integral_constant<int,
197  std::rank<T>::value>;
198  using _rank = std::integral_constant<int,
199  _valuetype_rank::value+1>;
200 
201  using _size_type = typename std::make_unsigned<IndexType>::type;
204 
206 
207  template<int _subrank = _valuetype_rank::value>
208  using _view_type = typename _storage_type::template view_type<_subrank>;
209  using _local_ref_type = typename coarray::detail::local_ref_type<
210  _element_type,
211  _pattern_type,
212  _valuetype_rank::value, LocalMemSpaceT>::type;
213 
214  using _offset_type = std::array<IndexType, _rank::value>;
215 
216 public:
217  // Types
218  using value_type = _element_type;
220  using value_base_type = _base_type;
221  using difference_type = IndexType;
222  using index_type = IndexType;
223  using size_type = _size_type;
224  using iterator = typename _storage_type::iterator;
225  using const_iterator = typename _storage_type::const_iterator;
226  using reverse_iterator = typename _storage_type::reverse_iterator;
227  using const_reverse_iterator = typename _storage_type::const_reverse_iterator;
228  using reference = typename coarray::detail::ref_type<_element_type>::type;
229  using const_reference = typename coarray::detail::const_ref_type<_element_type>::type;
230  using local_pointer = _element_type *;
231  using const_local_pointer = const _element_type *;
232  template<int subrank>
233  using view_type = _view_type<subrank>;
234  using local_type = _local_ref_type;
235  using pattern_type = _pattern_type;
236 
237 private:
238  constexpr _sspec_type _make_size_spec() const noexcept {
239  return _sspec_type(dash::ce::append(
240  std::array<size_type, 1> {static_cast<size_type>(dash::size())},
241  coarray::detail::type_extents_as_array<T,
242  size_type, _valuetype_rank::value>()));
243  }
244 
245  constexpr _sspec_type _make_size_spec(const size_type & first_dim) const noexcept {
246  static_assert(
247  !coarray::detail::type_is_complete<T>(),
248  "Array type may not be fully specified");
249 
250  return _sspec_type(dash::ce::append(
251  std::array<size_type, 1> {static_cast<size_type>(dash::size())},
252  dash::ce::replace_nth<0>(
253  first_dim,
254  coarray::detail::type_extents_as_array<T,
255  size_type, _valuetype_rank::value>())));
256  }
257 
258  constexpr _offset_type _offsets_unit(const team_unit_t & unit) const noexcept {
259  return _storage.pattern().global(unit, std::array<index_type, _rank::value> {});
260  }
261 
262  constexpr _offset_type _extents_unit(const team_unit_t & unit) const noexcept {
263  return _storage.pattern().local_extents(unit);
264  }
265 
266  inline index_type _myid() const {
267  return static_cast<index_type>(_storage.team().myid());
268  }
269 
270 public:
271 
272  static constexpr dim_t ndim() noexcept {
273  return static_cast<dim_t>(_rank::value);
274  }
275 
283  explicit Coarray(Team & team = Team::All()) {
284  if(dash::is_initialized() &&
285  (std::is_array<_base_type>::value == false
286  || std::extent<_base_type, 0>::value != 0))
287  {
288  allocate(team);
289  }
290  }
291 
298  template<
299  int __valuetype_rank = _valuetype_rank::value,
300  typename = typename std::enable_if<(__valuetype_rank != 0)>::type>
301  explicit Coarray(const size_type & first_dim, Team & team = Team::All()) {
302  if(dash::is_initialized()){
303  allocate(first_dim, team);
304  }
305  }
306 
307 #if 0
308  // disabled as currently no at least 2-dimensional pattern supports this
320  explicit Coarray(std::vector<size_type> extents,
321  Team & team = Team::All()){
322  if(dash::is_initialized()){
323  extents.insert(extents.begin(), static_cast<size_type>(dash::size()));
324  // asymmetric pattern
325  const _pattern_type a_pattern(extents,
328  team);
329  _storage.allocate(a_pattern);
330  }
331  }
332 #endif
333 
334  template<
335  int __valuetype_rank = _valuetype_rank::value,
336  typename = typename std::enable_if<(__valuetype_rank == 0)>::type>
337  explicit Coarray(const value_type & value, Team & team = Team::All()){
338  DASH_ASSERT_MSG(dash::is_initialized(), "DASH has to be initialized");
339  allocate(team);
340  *(_storage.lbegin()) = value;
341  _storage.barrier();
342  }
343 
344  /* ======================================================================== */
345  /* DASH Container Concept */
346  /* ======================================================================== */
347 
348  constexpr const pattern_type & pattern() const noexcept {
349  return _storage.pattern();
350  }
351 
352  iterator begin() noexcept {
353  return _storage.begin();
354  }
355 
356  constexpr const_iterator begin() const noexcept {
357  return _storage.begin();
358  }
359 
360  constexpr const_iterator cbegin() const noexcept {
361  return _storage.begin();
362  }
363 
364  iterator end() noexcept {
365  return _storage.end();
366  }
367 
368  constexpr const_iterator end() const noexcept {
369  return _storage.end();
370  }
371 
372  constexpr const_iterator cend() const noexcept {
373  return _storage.cend();
374  }
375 
376  local_pointer lbegin() noexcept {
377  return _storage.lbegin();
378  }
379 
380  constexpr const_local_pointer lbegin() const noexcept {
381  return _storage.lbegin();
382  }
383 
384  local_pointer lend() noexcept {
385  return _storage.lend();
386  }
387 
388  constexpr const_local_pointer lend() const noexcept {
389  return _storage.lend();
390  }
391 
392  constexpr size_type size() const noexcept {
393  return _storage.size();
394  }
395 
396  constexpr bool empty() const noexcept {
397  return _storage.size() == 0;
398  }
399 
400  void swap(self_t && other){
401  std::swap(this->_storage, other._storage);
402  dash::barrier();
403  }
404 
405  constexpr size_type local_size() const noexcept {
406  return _storage.local_size();
407  }
408 
409  constexpr bool is_local(index_type gi) const noexcept {
410  return _storage.is_local(gi);
411  }
412 
416  inline void allocate(Team & team = dash::Team::All()){
417  if(_storage.size() == 0){
418  _storage.allocate(_pattern_type(_make_size_spec(),
420  TeamSpec<_rank::value,
421  IndexType>(team),
422  team));
423  }
424  }
425 
429  inline void allocate(
430  const size_type & n,
431  Team & team = dash::Team::All())
432  {
433  if((_storage.size() == 0) && (n > 0)){
434  _storage.allocate(_pattern_type(_make_size_spec(n),
436  TeamSpec<_rank::value,
437  IndexType>(team),
438  team));
439  }
440  }
441 
446  inline void deallocate(){
447  _storage.deallocate();
448  }
449 
450  inline Team & team() {
451  return _storage.team();
452  }
453 
454  inline void barrier() {
455  _storage.barrier();
456  }
457 
462  inline void sync_all() {
463  _storage.barrier();
464  }
465 
470  template<typename Container>
471  inline void sync_images(const Container & image_ids){
472  _storage.flush();
473  dash::coarray::sync_images(image_ids);
474  }
475 
476  inline void flush(){
477  _storage.flush();
478  }
479 
480  inline void flush_local(){
481  _storage.flush_local();
482  }
483 
484  /* ======================================================================== */
485  /* Operators for element access */
486  /* ======================================================================== */
490  template<int __valuetype_rank = _valuetype_rank::value>
491  inline view_type<__valuetype_rank> operator()(const team_unit_t & unit) {
492  return this->operator ()(static_cast<index_type>(unit));
493  }
497  template<int __valuetype_rank = _valuetype_rank::value>
498  typename std::enable_if<(__valuetype_rank != 0), view_type<__valuetype_rank>>::type
499  inline operator()(const index_type & unit) {
500  return _storage[unit];
501  }
502 
506  template<int __valuetype_rank = _valuetype_rank::value>
507  typename std::enable_if<(__valuetype_rank == 0), reference>::type
508  inline operator()(const index_type & unit) {
509  return _storage.at(unit);
510  }
511 
516  template<int __valuetype_rank = _valuetype_rank::value>
517  typename std::enable_if<(
518  __valuetype_rank == 1 &&
520  const local_type>::type
521  inline operator[](const index_type & idx) const
522  {
523  return const_cast<const local_type>(
524  *(_storage.lbegin()+idx));
525  }
526 
531  template<int __valuetype_rank = _valuetype_rank::value>
532  typename std::enable_if<(
533  __valuetype_rank == 1 &&
534  !is_atomic<value_type>::value), local_type>::type
535  inline operator[](const index_type & idx) {
536  return *(_storage.lbegin()+idx);
537  }
538 
546  template<int __valuetype_rank = _valuetype_rank::value>
547  typename std::enable_if<(
548  __valuetype_rank > 1 &&
549  !is_atomic<value_type>::value), local_type>::type
550  inline operator[](const index_type & idx) {
551  // The Coarray internally is based on dash::Narray, with extents:
552  // global: team.size() x T[0] x ... x T[n]
553  // local: 1 x T[0] x ... x T[n]
554  // The first (0) dimenson of the Narray is used for the Coindex.
555  // Example: Coarray<T[10][5]> ~ NArray<T, 3,...>(team.size(), 10, 5)
556  //
557  // The pattern of the NArray is created in a way, that the offset in the
558  // first (0) dimension selects the unit the data is local to. While the
559  // dimensionality of the local and global parts are always equal, the rank
560  // of the local part is reduced by one (the co-dimension).
561  //
562  // Hence: deref. first dimension and return a view on the remaining ones.
563  // This is logically equivalent to _storage[myid][idx] but uses (faster)
564  // local view types
565  return _storage.local[0][idx];
566  }
567 
571  template<int __valuetype_rank = _valuetype_rank::value>
572  typename std::enable_if<(
573  __valuetype_rank > 0 &&
574  is_atomic<value_type>::value), local_type>::type
575  inline operator[](const index_type & idx) {
576  // dereference first dimension and return a view on the remaining ones
577  return operator()(_myid())[idx];
578  }
579 
587  template<int __valuetype_rank = _valuetype_rank::value>
588  typename std::enable_if<(
589  __valuetype_rank == 0 &&
590  !is_atomic<value_type>::value), value_type>::type
591  inline operator=(const value_type & value){
592  return *(_storage.lbegin()) = value;
593  }
594 
599  template<int __valuetype_rank = _valuetype_rank::value>
600  typename std::enable_if<(
601  __valuetype_rank == 0 &&
602  is_atomic<value_type>::value), value_type>::type
603  inline operator=(const value_type & value){
604  return operator()(_myid()) = value;
605  }
606 
607 
616  template<
617  int __valuetype_rank = _valuetype_rank::value,
618  typename = typename std::enable_if<(
619  __valuetype_rank == 0 &&
621  inline operator value_type() const {
622  return *(_storage.lbegin());
623  }
624 
629  template<
630  int __valuetype_rank = _valuetype_rank::value,
631  typename = typename std::enable_if<(
632  __valuetype_rank == 0 &&
634  inline operator value_base_type() {
635  return _storage[_myid()];
636  }
637 
641  template<
642  int __valuetype_rank = _valuetype_rank::value,
643  typename = typename std::enable_if<(__valuetype_rank == 0)>::type>
644  explicit inline operator reference() {
645  return _storage[myid()];
646  }
647 
652  template<
653  typename MEMTYPE,
654  int __valuetype_rank = _valuetype_rank::value,
655  typename = typename std::enable_if<(__valuetype_rank == 0)>::type>
656  inline MEMTYPE & member(size_t offs) {
657  auto *s_begin = reinterpret_cast<char *>(_storage.lbegin());
658  s_begin += offs;
659  return *(reinterpret_cast<MEMTYPE*>(s_begin));
660  }
661 
670  template<
671  class MEMTYPE,
672  class P=T,
673  int __valuetype_rank = _valuetype_rank::value,
674  typename = typename std::enable_if<(__valuetype_rank == 0)>::type>
675  inline MEMTYPE & member(const MEMTYPE P::*mem) {
676  auto offs = (size_t) & (reinterpret_cast<P *>(0)->*mem);
677  return member<MEMTYPE>(offs);
678  }
679 
688  template<
689  int __valuetype_rank = _valuetype_rank::value,
690  typename = typename std::enable_if<(
691  __valuetype_rank == 0 &&
693  inline value_type & operator +=(const value_type & value) {
694  return *(_storage.lbegin()) += value;
695  }
696 
697  template<
698  int __valuetype_rank = _valuetype_rank::value,
699  typename = typename std::enable_if<(
700  __valuetype_rank == 0 &&
702  inline value_base_type operator +=(const value_base_type & value) {
703  return operator()(_myid()) += value;
704  }
705 
706 
710  template<
711  int __valuetype_rank = _valuetype_rank::value,
712  typename = typename std::enable_if<(
713  __valuetype_rank == 0 &&
715  inline value_type & operator -=(const value_type & value) {
716  return *(_storage.lbegin()) -= value;
717  }
718 
719  template<
720  int __valuetype_rank = _valuetype_rank::value,
721  typename = typename std::enable_if<(
722  __valuetype_rank == 0 &&
724  inline value_base_type operator -=(const value_base_type & value) {
725  return operator()(_myid()) -= value;
726  }
727 
728 
732  template<
733  int __valuetype_rank = _valuetype_rank::value,
734  typename = typename std::enable_if<(
735  __valuetype_rank == 0 &&
737  inline value_type & operator *=(const value_type & value) {
738  return *(_storage.lbegin()) *= value;
739  }
740 
741  template<
742  int __valuetype_rank = _valuetype_rank::value,
743  typename = typename std::enable_if<(
744  __valuetype_rank == 0 &&
746  inline reference operator *=(const value_type & value) {
747  return operator()(_myid()) *= value;
748  }
749 
753  template<
754  int __valuetype_rank = _valuetype_rank::value,
755  typename = typename std::enable_if<(
756  __valuetype_rank == 0 &&
758  inline value_type & operator /=(const value_type & value) {
759  return *(_storage.lbegin()) /= value;
760  }
761 
762  template<
763  int __valuetype_rank = _valuetype_rank::value,
764  typename = typename std::enable_if<(
765  __valuetype_rank == 0 &&
767  inline reference operator /=(const value_type & value) {
768  return operator()(_myid()) /= value;
769  }
770 
771 
780  template<
781  int __valuetype_rank = _valuetype_rank::value,
782  typename = typename std::enable_if<(
783  __valuetype_rank == 0 &&
785  inline value_type operator +(const value_type & value) const {
786  return *(_storage.lbegin()) + value;
787  }
788 
792  template<
793  int __valuetype_rank = _valuetype_rank::value,
794  typename = typename std::enable_if<(
795  __valuetype_rank == 0 &&
797  inline value_type operator -(const value_type & value) const {
798  return *(_storage.lbegin()) - value;
799  }
800 
804  template<
805  int __valuetype_rank = _valuetype_rank::value,
806  typename = typename std::enable_if<(
807  __valuetype_rank == 0 &&
809  inline value_type operator *(const value_type & value) const {
810  return *(_storage.lbegin()) * value;
811  }
812 
816  template<
817  int __valuetype_rank = _valuetype_rank::value,
818  typename = typename std::enable_if<(
819  __valuetype_rank == 0 &&
821  inline value_type operator /(const value_type & value) const {
822  return *(_storage.lbegin()) / value;
823  }
824 
828  template<
829  int __valuetype_rank = _valuetype_rank::value,
830  typename = typename std::enable_if<(
831  __valuetype_rank == 0 &&
833  inline value_type & operator ++() {
834  return ++(*(_storage.lbegin()));
835  }
836 
837  template<
838  int __valuetype_rank = _valuetype_rank::value,
839  typename = typename std::enable_if<(
840  __valuetype_rank == 0 &&
842  inline value_base_type operator ++() {
843  return ++(operator()(_myid()));
844  }
845 
849  template<
850  int __valuetype_rank = _valuetype_rank::value,
851  typename = typename std::enable_if<(
852  __valuetype_rank == 0 &&
854  inline value_type operator ++(int) {
855  return (*(_storage.lbegin()))++;
856  }
857 
861  template<
862  int __valuetype_rank = _valuetype_rank::value,
863  typename = typename std::enable_if<(
864  __valuetype_rank == 0 &&
866  inline value_type & operator --() {
867  return --(*(_storage.lbegin()));
868  }
869 
870  template<
871  int __valuetype_rank = _valuetype_rank::value,
872  typename = typename std::enable_if<(
873  __valuetype_rank == 0 &&
875  inline value_base_type operator --() {
876  return --(operator()(_myid()));
877  }
878 
882  template<
883  int __valuetype_rank = _valuetype_rank::value,
884  typename = typename std::enable_if<(
885  __valuetype_rank == 0 &&
887  inline value_type operator --(int) {
888  return (*(_storage.lbegin()))--;
889  }
890 
891 private:
893  _storage_type _storage;
894 };
895 } // namespace dash
896 
897 /* ======================================================================== */
898 /* Ugly global overloads necessary to mimic fortran co_array interface */
899 /* All types are supported to which dash::Coarray can be converted */
900 /* ======================================================================== */
901 template<
902  typename Lhs,
903  typename T>
904 inline Lhs operator+(const Lhs & lhs, const dash::Coarray<T> & rhs) {
905  return lhs + static_cast<Lhs>(rhs);
906 }
907 
908 template<
909  typename Lhs,
910  typename T>
911 inline Lhs operator-(const Lhs & lhs, const dash::Coarray<T> & rhs) {
912  return lhs - static_cast<Lhs>(rhs);
913 }
914 
915 template<
916  typename Lhs,
917  typename T>
918 inline Lhs operator*(const Lhs & lhs, const dash::Coarray<T> & rhs) {
919  return lhs * static_cast<Lhs>(rhs);
920 }
921 
922 template<
923  typename Lhs,
924  typename T>
925 inline Lhs operator/(const Lhs & lhs, const dash::Coarray<T> & rhs) {
926  return lhs / static_cast<Lhs>(rhs);
927 }
928 
929 #include <dash/coarray/Utils.h>
930 #include <dash/Coevent.h>
931 
932 #endif /* COARRAY_H_INCLUDED */
constexpr dim_t rank(const DimensionalType &d)
Definition: Dimensional.h:64
void sync_images(const Container &image_ids)
Blocks until all selected units reach this statement.
Definition: Utils.h:75
global_unit_t myid()
Shortcut to query the global unit ID of the calling unit.
type traits for dash::Atomic
Definition: Type_traits.h:18
Defines how a list of global indices is mapped to single units within a Team.
Definition: BlockPattern.h:42
size_t size()
Return the number of units in the global team.
constexpr auto end(RangeType &&range) -> decltype(std::forward< RangeType >(range).end())
Definition: Range.h:98
Coarray(const size_type &first_dim, Team &team=Team::All())
Constructor for array types with one unspecified dimension:
Definition: Coarray.h:301
This class is a simple memory pool which holds allocates elements of size ValueType.
Definition: AllOf.h:8
MEMTYPE & member(const MEMTYPE P::*mem)
Get the member via pointer to member.
Definition: Coarray.h:675
Specifies cartesian extents in a specific number of dimensions.
Definition: Cartesian.h:197
Generates a compile-sequence integer (size_t) sequence in ascending order.
Definition: IndexSequence.h:41
constexpr auto begin(RangeType &&range) -> decltype(std::forward< RangeType >(range).begin())
Definition: Range.h:89
int dim_t
Scalar type for a dimension value, with 0 indicating the first dimension.
Definition: Types.h:39
view_type< __valuetype_rank > operator()(const team_unit_t &unit)
Operator to select remote unit.
Definition: Coarray.h:491
MEMTYPE & member(size_t offs)
Get a reference to a member of a certain type at the specified offset.
Definition: Coarray.h:656
DASH_CONSTEXPR auto operator-(const GlobIter< ElementType, Pattern, GlobMemType, Pointer, Reference > &lhs, const GlobIter< ElementType, Pattern, GlobMemType, Pointer, Reference > &rhs) DASH_NOEXCEPT
Definition: Iterator.h:147
bool is_initialized()
Check whether DASH has been initialized already.
void allocate(const size_type &n, Team &team=dash::Team::All())
allocate an array which was initialized before dash has been initialized
Definition: Coarray.h:429
std::enable_if<(__valuetype_rank !=0), view_type< __valuetype_rank > >::type operator()(const index_type &unit)
Operator to select remote unit for array types.
Definition: Coarray.h:499
helper to create a coarray pattern for coarrays where the local size of each unit is equal (symmetric...
Definition: Coarray.h:148
internal::default_signed_index default_index_t
Signed integer type used as default for index values.
Definition: Types.h:59
A Team instance specifies a subset of all available units.
Definition: Team.h:41
void allocate(Team &team=dash::Team::All())
allocate an array which was initialized before dash has been initialized
Definition: Coarray.h:416
void deallocate()
free the memory allocated by this coarray.
Definition: Coarray.h:446
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
std::enable_if<(__valuetype_rank==0), reference >::type operator()(const index_type &unit)
Operator to select remote unit for scalar types.
Definition: Coarray.h:508
struct dash::unit_id< dash::local_unit, dart_team_unit_t > team_unit_t
Unit ID to use for team-local IDs.
Definition: Types.h:319
Coarray(Team &team=Team::All())
Constructor for scalar types and fully specified array types:
Definition: Coarray.h:283
void sync_all()
Blocks until all team members of this container have reached the statement and flushes the memory...
Definition: Coarray.h:462
void sync_images(const Container &image_ids)
Blocks until all selected team members of this container have reached the statement and flushes the m...
Definition: Coarray.h:471
_base_type value_base_type
Same as value_type but without atomic wrapper.
Definition: Coarray.h:220
void barrier()
A global barrier involving all units.
Global value reference for asynchronous / non-blocking operations.
Definition: GlobAtomicRef.h:17
A fortran style coarray.
Definition: Coarray.h:184
static Team & All()
The invariant Team instance containing all available units.
Definition: Team.h:213
void swap(dash::GlobRef< T > &&a, dash::GlobRef< T > &&b)
specialization for unqualified calls to swap
Definition: GlobRef.h:424
DistributionSpec describes distribution patterns of all dimensions,.
Definition: Dimensional.h:222