DASH
0.3.0
|
Shared access to a value in global memory across a team. More...
#include <Shared.h>
Public Types | |
typedef size_t | size_type |
typedef size_t | difference_type |
typedef GlobRef< element_t > | reference |
typedef GlobRef< const element_t > | const_reference |
typedef reference::value_type | value_type |
Public Member Functions | |
Shared (team_unit_t owner=team_unit_t(0), Team &team=dash::Team::All()) | |
Constructor, allocates shared value at single unit in specified team. More... | |
Shared (const value_type &val, team_unit_t owner=team_unit_t(0), Team &team=dash::Team::All()) | |
Constructor, allocates shared value at single unit in specified team. More... | |
~Shared ()=default | |
Destructor, frees shared memory. More... | |
Shared (const self_t &other)=delete | |
Copy-constructor: DELETED. More... | |
Shared (self_t &&other) noexcept | |
Move-constructor. More... | |
self_t & | operator= (const self_t &other)=delete |
Assignment operator: DELETED. More... | |
self_t & | operator= (self_t &&other) DASH_NOEXCEPT |
Move-assignment operator. More... | |
bool | init (value_type val=value_type{}) |
Collective allocation of a shared variable with an initial value. More... | |
void | set (const value_type &val) |
Set the value of the shared element. More... | |
reference | get () |
Get a reference on the shared value. More... | |
const_reference | get () const |
Get a const reference on the shared value. More... | |
constexpr value_type const * | local () const noexcept |
Native pointer to the starting address of the local memory of the unit that initialized this dash::Shared instance. More... | |
value_type * | local () noexcept |
Native pointer to the starting address of the local memory of the unit that initialized this dash::Shared instance. More... | |
dash::team_unit_t | owner () const noexcept |
The unit owning the memory in the global address space. More... | |
dash::Team & | team () const noexcept |
The dash::Team that created this shared object. More... | |
void | flush () |
Flush global memory of shared value. More... | |
void | barrier () |
Flush global memory of shared value and synchronize its associated units. More... | |
dart_gptr_t | dart_gptr () const noexcept |
Get underlying DART global pointer of the shared variable. More... | |
Friends | |
template<typename T_ > | |
void | swap (Shared< T_ > &a, Shared< T_ > &b) |
Shared access to a value in global memory across a team.
ElementType | The type of the shared value. |
|
inline |
Constructor, allocates shared value at single unit in specified team.
owner | Unit id of the shared value's owner. |
team | Team containing all units accessing the element in shared memory |
Definition at line 66 of file Shared.h.
References dash::Shared< ElementType >::owner(), and dash::Shared< ElementType >::team().
Referenced by dash::Shared< ElementType >::Shared().
|
inline |
Constructor, allocates shared value at single unit in specified team.
The element is initialized with the given value.
val | The value to initialize the element with |
owner | Unit id of the shared value's owner. |
team | Team containing all units accessing the element in shared memory |
Definition at line 81 of file Shared.h.
References dash::Shared< ElementType >::init(), dash::is_initialized(), dash::Shared< ElementType >::owner(), dash::Shared< ElementType >::Shared(), and dash::Shared< ElementType >::~Shared().
|
default |
Destructor, frees shared memory.
Referenced by dash::Shared< ElementType >::Shared().
|
delete |
Copy-constructor: DELETED.
|
inlinenoexcept |
Move-constructor.
Transfers ownership from other instance.
Definition at line 112 of file Shared.h.
References dash::Shared< ElementType >::operator=().
|
inline |
Flush global memory of shared value and synchronize its associated units.
Definition at line 308 of file Shared.h.
References dash::Shared< ElementType >::flush().
|
inlinenoexcept |
|
inline |
Flush global memory of shared value.
Definition at line 297 of file Shared.h.
References dart_flush(), and DART_OK.
Referenced by dash::Shared< ElementType >::barrier().
|
inline |
Get a reference on the shared value.
Definition at line 239 of file Shared.h.
Referenced by dash::io::hdf5::StoreHDF::write().
|
inline |
Get a const reference on the shared value.
|
inline |
Collective allocation of a shared variable with an initial value.
NOTE: This call succeeds only once during the lifetime of a single object.
the | initial value of the globally shared variable. |
Definition at line 175 of file Shared.h.
References dart_bcast(), dash::Team::dart_id(), DART_OK, and dash::is_initialized().
Referenced by dash::Shared< ElementType >::Shared().
|
inlinenoexcept |
Native pointer to the starting address of the local memory of the unit that initialized this dash::Shared instance.
Definition at line 264 of file Shared.h.
Referenced by dash::broadcast().
|
inlinenoexcept |
Native pointer to the starting address of the local memory of the unit that initialized this dash::Shared instance.
|
delete |
Assignment operator: DELETED.
Referenced by dash::Shared< ElementType >::Shared().
|
inline |
|
inlinenoexcept |
The unit owning the memory in the global address space.
Definition at line 281 of file Shared.h.
Referenced by dash::broadcast(), and dash::Shared< ElementType >::Shared().
|
inline |
Set the value of the shared element.
Definition at line 226 of file Shared.h.
Referenced by dash::io::hdf5::StoreHDF::write().
|
inlinenoexcept |
The dash::Team that created this shared object.
Definition at line 289 of file Shared.h.
Referenced by dash::broadcast(), and dash::Shared< ElementType >::Shared().