DASH
0.3.0
|
LocalAllocationPolicy: Implements a mechanism to allocate locally, independent of the other units. More...
#include <AllocationPolicy.h>
Public Member Functions | |
dart_gptr_t | allocate_segment (LocalMemorySpaceBase< memory_space_tag > *, std::size_t nbytes, std::size_t) |
Variant to allocate only locally in global memory space if we allocate in the default Host Space. More... | |
bool | deallocate_segment (dart_gptr_t gptr, LocalMemorySpaceBase< memory_space_tag > *, void *, size_t, size_t) |
Similar to the allocation case above global memory is deallocated symmetrically in DART. More... | |
LocalAllocationPolicy: Implements a mechanism to allocate locally, independent of the other units.
This local memory portion is allocated from a memory pool which is already attached to global memory. This variant is a good fit in cases where only one units needs to allocate memory while the other units do not contribute any local portion. It is used for example used to implement dash::Shared.
Note: Both allocation and deallocation are non-collective. The user has to ensure that the owning unit does not release the memory while other units are still operating on it.
Definition at line 224 of file AllocationPolicy.h.
|
inline |
Variant to allocate only locally in global memory space if we allocate in the default Host Space.
In this case DART allocates from the internal buddy allocator.
nbytes | the number of bytes to allocate |
Definition at line 234 of file AllocationPolicy.h.
References DART_GPTR_NULL, dart_memalloc(), and DART_OK.
|
inline |
Similar to the allocation case above global memory is deallocated symmetrically in DART.
Definition at line 261 of file AllocationPolicy.h.
References dart_memfree(), and DART_OK.