DASH  0.3.0
dart_globmem.h File Reference
#include <dash/dart/if/dart_util.h>
#include <dash/dart/if/dart_types.h>
#include <dash/dart/if/dart_team_group.h>
Include dependency graph for dart_globmem.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  dart_gptr_t
 DART Global pointer type. More...
 

Macros

#define DART_GPTR_NULL
 A NULL global pointer. More...
 
#define DART_GPTR_ISNULL(gptr_)
 Test for NULL global pointer. More...
 
#define DART_GPTR_EQUAL(gptr1_, gptr2_)
 Compare two global pointers. More...
 
#define DART_SEGMENT_LOCAL   ((int16_t)0)
 Segment ID identifying unaligned allocations. More...
 

Typedefs

typedef struct dart_allocator_struct * dart_allocator_t
 DART allocator used for non-collective global memory allocations using dart_allocator_alloc similar to dart_memalloc. More...
 

Functions

dart_ret_t dart_gptr_getaddr (const dart_gptr_t gptr, void **addr)
 Get the local memory address for the specified global pointer gptr. More...
 
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. More...
 
static __attribute__ ((unused)) dart_ret_t dart_gptr_incaddr(dart_gptr_t *gptr
 Add 'offs' to the address specified by the global pointer. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
dart_ret_t dart_allocator_free (dart_gptr_t *gptr, dart_allocator_t allocator)
 Free memory allocated through dart_allocator_alloc. More...
 
dart_ret_t dart_allocator_destroy (dart_allocator_t *allocator)
 Destroy an allocator created through dart_allocator_new. More...
 
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 returns a global pointer to it. More...
 
dart_ret_t dart_memfree (dart_gptr_t gptr)
 Frees memory in the global address space allocated by a previous call of dart_memalloc. More...
 
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 unit's global address space with a local displacement of the specified type. More...
 
dart_ret_t dart_team_memfree (dart_gptr_t gptr)
 Collective function to free global memory previously allocated using dart_team_memalloc_aligned. More...
 
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 memory. More...
 
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. More...
 
dart_ret_t dart_team_memderegister (dart_gptr_t gptr)
 Collective function similar to dart_team_memfree() but on previously externally allocated memory. More...
 

Variables

static int64_t offs
 
return DART_OK
 
static dart_team_unit_t unit
 

Macro Definition Documentation

◆ DART_SEGMENT_LOCAL

#define DART_SEGMENT_LOCAL   ((int16_t)0)

Segment ID identifying unaligned allocations.

See also
dart_memalloc
dart_memfree

Definition at line 142 of file dart_globmem.h.

Typedef Documentation

◆ dart_allocator_t

typedef struct dart_allocator_struct* dart_allocator_t

DART allocator used for non-collective global memory allocations using dart_allocator_alloc similar to dart_memalloc.

An instance of the allocator has to be created using dart_allocator_new before allocating memory using dart_allocator_alloc, which can then be shared with other units in the same team. The memory has to be free'd using dart_allocator_free by the unit that allocated it. The allocator should be destroyed after all allocations have been free'd using dart_allocator_destroy.

Definition at line 265 of file dart_globmem.h.

Variable Documentation

◆ offs

int64_t offs
Initial value:
{
gptr->addr_or_offs.offset += offs

Definition at line 195 of file dart_globmem.h.

◆ unit

Initial value:
{
gptr->unitid = unit.id

Definition at line 215 of file dart_globmem.h.