GlobalMemorySlot Class Reference

HiCR: HiCR::backend::hwloc::GlobalMemorySlot Class Reference
HiCR
HiCR::backend::hwloc::GlobalMemorySlot Class Referencefinal

#include <globalMemorySlot.hpp>

Inheritance diagram for HiCR::backend::hwloc::GlobalMemorySlot:
HiCR::GlobalMemorySlot

Public Member Functions

 GlobalMemorySlot (const HiCR::GlobalMemorySlot::tag_t globalTag=0, const HiCR::GlobalMemorySlot::globalKey_t globalKey=0, std::shared_ptr< HiCR::LocalMemorySlot > sourceLocalMemorySlot=nullptr)
 
 ~GlobalMemorySlot () override=default
 
__INLINE__ bool trylock ()
 
__INLINE__ void lock ()
 
__INLINE__ void unlock ()
 
- Public Member Functions inherited from HiCR::GlobalMemorySlot
 GlobalMemorySlot (const tag_t globalTag=0, const globalKey_t globalKey=0, std::shared_ptr< HiCR::LocalMemorySlot > sourceLocalMemorySlot=nullptr)
 
__INLINE__ tag_t getGlobalTag () const noexcept
 
__INLINE__ globalKey_t getGlobalKey () const noexcept
 
__INLINE__ std::shared_ptr< HiCR::LocalMemorySlotgetSourceLocalMemorySlot () noexcept
 

Additional Inherited Members

- Public Types inherited from HiCR::GlobalMemorySlot
using globalKey_t = uint64_t
 
using tag_t = uint64_t
 

Detailed Description

This class represents an abstract definition for a global Memory Slot resource for the hwloc backends

It uses mutexes to enforce the mutual exclusion logic

Constructor & Destructor Documentation

◆ GlobalMemorySlot()

HiCR::backend::hwloc::GlobalMemorySlot::GlobalMemorySlot ( const HiCR::GlobalMemorySlot::tag_t  globalTag = 0,
const HiCR::GlobalMemorySlot::globalKey_t  globalKey = 0,
std::shared_ptr< HiCR::LocalMemorySlot sourceLocalMemorySlot = nullptr 
)
inline

Constructor for a MemorySlot class for the MPI backend

Parameters
[in]globalTagFor global memory slots, indicates the subset of global memory slots this belongs to
[in]globalKeyUnique identifier for that memory slot that this slot occupies.
[in]sourceLocalMemorySlotThe local memory slot (if applicable) from whence this global memory slot is created

◆ ~GlobalMemorySlot()

HiCR::backend::hwloc::GlobalMemorySlot::~GlobalMemorySlot ( )
overridevirtualdefault

Default destructor

Reimplemented from HiCR::GlobalMemorySlot.

Member Function Documentation

◆ lock()

__INLINE__ void HiCR::backend::hwloc::GlobalMemorySlot::lock ( )
inline

Attempts to lock memory lock using its mutex object

This function might block the caller if the memory slot is already locked

◆ trylock()

__INLINE__ bool HiCR::backend::hwloc::GlobalMemorySlot::trylock ( )
inline

Attempts to lock memory lock using its mutex object

This function never blocks the caller

Returns
True, if successful; false, otherwise.

◆ unlock()

__INLINE__ void HiCR::backend::hwloc::GlobalMemorySlot::unlock ( )
inline

Unlocks the memory slot, if previously locked by the caller


The documentation for this class was generated from the following file: