1 #ifndef DART_GLOBMEM_H_INCLUDED 2 #define DART_GLOBMEM_H_INCLUDED 15 #include <dash/dart/if/dart_util.h> 24 #define DART_INTERFACE_ON 103 #define DART_GPTR_NULL (dart_gptr_t { -1, 0, 0, DART_TEAM_NULL, { 0 } }) 105 #define DART_GPTR_NULL \ 106 (dart_gptr_t){ .unitid = -1, \ 109 .teamid = DART_TEAM_NULL, \ 110 .addr_or_offs.offset = 0 } 118 #define DART_GPTR_ISNULL(gptr_) \ 119 (gptr_.unitid<0 && gptr_.segid==0 && \ 120 gptr_.teamid==DART_TEAM_NULL && \ 121 gptr_.addr_or_offs.addr==0) 128 #define DART_GPTR_EQUAL(gptr1_, gptr2_ ) \ 129 ((gptr1_.unitid == gptr2_.unitid) && \ 130 (gptr1_.segid == gptr2_.segid) && \ 131 (gptr1_.teamid == gptr2_.teamid) && \ 132 (gptr1_.addr_or_offs.offset == \ 133 gptr2_.addr_or_offs.offset) ) 142 #define DART_SEGMENT_LOCAL ((int16_t)0) 161 void ** addr) DART_NOTHROW;
177 void * addr) DART_NOTHROW;
190 DART_INLINE DART_NOTHROW
211 DART_INLINE DART_NOTHROW
233 uint16_t * flags) DART_NOTHROW;
253 uint16_t flags) DART_NOTHROW;
290 dart_allocator_t * new_allocator);
313 dart_allocator_t allocator);
330 dart_allocator_t allocator);
504 #define DART_INTERFACE_OFF dart_ret_t dart_team_memregister(dart_team_t teamid, size_t nlelem, dart_datatype_t dtype, void *addr, dart_gptr_t *gptr)
Collective function, attaches external memory previously allocated by the user.
int16_t teamid
The team associated with the allocation.
union dart_gptr_t::@0 addr_or_offs
Absolute address or relative offset.
dart_ret_t dart_gptr_setflags(dart_gptr_t *gptr, uint16_t flags)
Set the flags field for the segment specified by the global pointer.
intptr_t dart_datatype_t
Raw data types supported by the DART interface.
int32_t dart_unit_t
Data type for storing a unit ID.
dart_ret_t dart_memfree(dart_gptr_t gptr)
Frees memory in the global address space allocated by a previous call of dart_memalloc.
dart_ret_t dart_memalloc(size_t nelem, dart_datatype_t dtype, dart_gptr_t *gptr)
Allocates memory for nelem elements of type dtype in the global address space of the calling unit and...
dart_unit_t unitid
The unit holding the memory element.
dart_ret_t dart_allocator_free(dart_gptr_t *gptr, dart_allocator_t allocator)
Free memory allocated through dart_allocator_alloc.
Data type for storing a unit ID relative to a team.
dart_ret_t dart_allocator_alloc(size_t nelem, dart_datatype_t dtype, dart_gptr_t *gptr, dart_allocator_t allocator)
Allocate global memory from a DART allocator instance created using dart_allocator_new.
dart_ret_t dart_allocator_new(size_t pool_size, dart_team_t team, dart_allocator_t *new_allocator)
Create a new allocator for non-collective global memory allocations.
dart_ret_t dart_team_memfree(dart_gptr_t gptr)
Collective function to free global memory previously allocated using dart_team_memalloc_aligned.
DART Global pointer type.
dart_ret_t dart_gptr_getflags(dart_gptr_t gptr, uint16_t *flags)
Get the flags field for the segment specified by the global pointer.
dart_ret_t dart_gptr_getaddr(const dart_gptr_t gptr, void **addr)
Get the local memory address for the specified global pointer gptr.
int16_t segid
The segment ID of the allocation.
dart_ret_t
Return values of functions in the DART interface.
int16_t dart_team_t
Data type for storing a team ID.
dart_ret_t dart_team_memderegister(dart_gptr_t gptr)
Collective function similar to dart_team_memfree() but on previously externally allocated memory...
struct dart_allocator_struct * dart_allocator_t
DART allocator used for non-collective global memory allocations using dart_allocator_alloc similar t...
dart_ret_t dart_gptr_setaddr(dart_gptr_t *gptr, void *addr)
Set the local memory address for the specified global pointer such the the specified address...
dart_ret_t dart_team_memalloc_aligned(dart_team_t teamid, size_t nelem, dart_datatype_t dtype, dart_gptr_t *gptr)
Collective function on the specified team to allocate nelem elements of type dtype of memory in each ...
dart_ret_t dart_allocator_destroy(dart_allocator_t *allocator)
Destroy an allocator created through dart_allocator_new.
unsigned int flags
Reserved.
dart_ret_t dart_team_memregister_aligned(dart_team_t teamid, size_t nelem, dart_datatype_t dtype, void *addr, dart_gptr_t *gptr)
Collective function similar to dart_team_memalloc_aligned but on previously externally allocated memo...