MemoryManager Class Reference
HiCR
|
#include <memoryManager.hpp>

Public Member Functions | |
MemoryManager () | |
~MemoryManager () override=default | |
__INLINE__ std::shared_ptr< HiCR::LocalMemorySlot > | allocateLocalMemorySlotImpl (std::shared_ptr< HiCR::MemorySpace > memorySpace, const size_t size) override |
__INLINE__ void | freeLocalMemorySlotImpl (std::shared_ptr< HiCR::LocalMemorySlot > memorySlot) override |
__INLINE__ std::shared_ptr< HiCR::LocalMemorySlot > | registerLocalMemorySlotImpl (std::shared_ptr< HiCR::MemorySpace > memorySpace, void *const ptr, const size_t size) override |
__INLINE__ void | deregisterLocalMemorySlotImpl (std::shared_ptr< HiCR::LocalMemorySlot > memorySlot) override |
![]() | |
__INLINE__ std::shared_ptr< LocalMemorySlot > | allocateLocalMemorySlot (const std::shared_ptr< MemorySpace > &memorySpace, const size_t size) |
virtual std::shared_ptr< LocalMemorySlot > | registerLocalMemorySlot (const std::shared_ptr< HiCR::MemorySpace > &memorySpace, void *const ptr, const size_t size) |
__INLINE__ void | deregisterLocalMemorySlot (const std::shared_ptr< HiCR::LocalMemorySlot > &memorySlot) |
__INLINE__ void | memset (const std::shared_ptr< HiCR::LocalMemorySlot > &memorySlot, int value, size_t size) |
__INLINE__ void | freeLocalMemorySlot (const std::shared_ptr< HiCR::LocalMemorySlot > &memorySlot) |
Additional Inherited Members | |
![]() | |
virtual void | memsetImpl (const std::shared_ptr< HiCR::LocalMemorySlot > memorySlot, int value, size_t size) |
virtual void | freeLocalMemorySlotImpl (std::shared_ptr< HiCR::LocalMemorySlot > memorySlot)=0 |
virtual void | deregisterLocalMemorySlotImpl (std::shared_ptr< HiCR::LocalMemorySlot > memorySlot)=0 |
Detailed Description
Implementation of the HiCR MPI backend
This backend is very useful for testing other HiCR modules in isolation (unit tests) without involving the use of threading, which might incur side-effects
Constructor & Destructor Documentation
◆ MemoryManager()
|
inline |
Constructor for the mpi backend.
◆ ~MemoryManager()
|
overridevirtualdefault |
Default destructor
Reimplemented from HiCR::MemoryManager.
Member Function Documentation
◆ allocateLocalMemorySlotImpl()
|
inlineoverridevirtual |
Allocates memory in the current memory space (whole system) using MPI_Alloc_mem This method, as opposed to a normal malloc ensures portability for all MPI implementations
- Parameters
-
[in] memorySpace Memory space in which to perform the allocation. [in] size Size of the memory slot to create
- Returns
- The address of the newly allocated memory slot
Implements HiCR::MemoryManager.
◆ deregisterLocalMemorySlotImpl()
|
inlineoverride |
Deregisters a local memory slot
- Parameters
-
[in] memorySlot The memory slot to deregister
◆ freeLocalMemorySlotImpl()
|
inlineoverride |
Frees a local memory slot memory
- Parameters
-
[in] memorySlot the memory slot to free up
We do not free up MPI local memory slots since they are freed upon promotion. If you did not promote the local memory slot, it will leak memory.
◆ registerLocalMemorySlotImpl()
|
inlineoverridevirtual |
Backend-internal implementation of the registerLocalMemorySlot function
- Parameters
-
[in] memorySpace Memory space to register memory in [in] ptr Pointer to the start of the memory slot [in] size Size of the memory slot to create
- Returns
- A newly created memory slot
Implements HiCR::MemoryManager.
The documentation for this class was generated from the following file:
- /home/runner/work/HiCR/HiCR/include/hicr/backends/mpi/memoryManager.hpp
Generated by