CommunicationManager Class Reference

HiCR: HiCR::CommunicationManager Class Reference
HiCR
HiCR::CommunicationManager Class Referenceabstract

#include <communicationManager.hpp>

Inheritance diagram for HiCR::CommunicationManager:
HiCR::backend::ascend::CommunicationManager HiCR::backend::lpf::CommunicationManager HiCR::backend::mpi::CommunicationManager HiCR::backend::opencl::CommunicationManager HiCR::backend::pthreads::CommunicationManager

Public Types

using globalKeyMemorySlotPair_t = std::pair< GlobalMemorySlot::globalKey_t, std::shared_ptr< LocalMemorySlot > >
 
using globalKeyToMemorySlotMap_t = std::map< GlobalMemorySlot::globalKey_t, std::shared_ptr< GlobalMemorySlot > >
 
using globalMemorySlotTagKeyMap_t = std::map< GlobalMemorySlot::tag_t, globalKeyToMemorySlotMap_t >
 

Public Member Functions

virtual ~CommunicationManager ()=default
 
virtual void lock ()
 
virtual void unlock ()
 
__INLINE__ void exchangeGlobalMemorySlots (GlobalMemorySlot::tag_t tag, const std::vector< globalKeyMemorySlotPair_t > &memorySlots)
 
__INLINE__ std::shared_ptr< GlobalMemorySlotgetGlobalMemorySlot (GlobalMemorySlot::tag_t tag, GlobalMemorySlot::globalKey_t globalKey)
 
virtual uint8_t * serializeGlobalMemorySlot (const std::shared_ptr< HiCR::GlobalMemorySlot > &globalSlot) const
 
virtual std::shared_ptr< GlobalMemorySlotdeserializeGlobalMemorySlot (uint8_t *buffer, GlobalMemorySlot::tag_t tag)
 
virtual std::shared_ptr< GlobalMemorySlotpromoteLocalMemorySlot (const std::shared_ptr< LocalMemorySlot > &localMemorySlot, GlobalMemorySlot::tag_t tag)
 
__INLINE__ void deregisterGlobalMemorySlot (const std::shared_ptr< GlobalMemorySlot > &memorySlot)
 
__INLINE__ void destroyGlobalMemorySlot (const std::shared_ptr< GlobalMemorySlot > &memorySlot)
 
virtual void destroyPromotedGlobalMemorySlot (const std::shared_ptr< GlobalMemorySlot > &memorySlot)
 
__INLINE__ void queryMemorySlotUpdates (std::shared_ptr< LocalMemorySlot > memorySlot)
 
__INLINE__ void memcpy (const std::shared_ptr< LocalMemorySlot > &destination, size_t dst_offset, const std::shared_ptr< LocalMemorySlot > &source, size_t src_offset, size_t size)
 
__INLINE__ void memcpy (const std::shared_ptr< GlobalMemorySlot > &destination, size_t dst_offset, const std::shared_ptr< LocalMemorySlot > &source, size_t src_offset, size_t size)
 
__INLINE__ void memcpy (const std::shared_ptr< LocalMemorySlot > &destination, size_t dst_offset, const std::shared_ptr< GlobalMemorySlot > &source, size_t src_offset, size_t size)
 
__INLINE__ void fence (GlobalMemorySlot::tag_t tag)
 
__INLINE__ void fence (const std::shared_ptr< LocalMemorySlot > &slot, size_t expectedSent, size_t expectedRecvd)
 
__INLINE__ void fence (const std::shared_ptr< GlobalMemorySlot > &slot, size_t expectedSent, size_t expectedRecvd)
 
__INLINE__ bool acquireGlobalLock (const std::shared_ptr< GlobalMemorySlot > &memorySlot)
 
__INLINE__ void releaseGlobalLock (const std::shared_ptr< GlobalMemorySlot > &memorySlot)
 
virtual __INLINE__ void flushSent ()
 
virtual __INLINE__ void flushReceived ()
 

Protected Member Functions

__INLINE__ void registerGlobalMemorySlot (const std::shared_ptr< GlobalMemorySlot > &memorySlot)
 
virtual std::shared_ptr< GlobalMemorySlotgetGlobalMemorySlotImpl (GlobalMemorySlot::tag_t tag, GlobalMemorySlot::globalKey_t globalKey)=0
 
virtual void exchangeGlobalMemorySlotsImpl (GlobalMemorySlot::tag_t tag, const std::vector< globalKeyMemorySlotPair_t > &memorySlots)=0
 
virtual void queryMemorySlotUpdatesImpl (std::shared_ptr< LocalMemorySlot > memorySlot)=0
 
virtual void deregisterGlobalMemorySlotImpl (const std::shared_ptr< GlobalMemorySlot > &memorySlot)
 
virtual void destroyGlobalMemorySlotImpl (std::shared_ptr< GlobalMemorySlot > memorySlot)=0
 
virtual void memcpyImpl (const std::shared_ptr< LocalMemorySlot > &destination, size_t dst_offset, const std::shared_ptr< LocalMemorySlot > &source, size_t src_offset, size_t size)
 
virtual void memcpyImpl (const std::shared_ptr< GlobalMemorySlot > &destination, size_t dst_offset, const std::shared_ptr< LocalMemorySlot > &source, size_t src_offset, size_t size)
 
virtual void memcpyImpl (const std::shared_ptr< LocalMemorySlot > &destination, size_t dst_offset, const std::shared_ptr< GlobalMemorySlot > &source, size_t src_offset, size_t size)
 
virtual void fenceImpl (const std::shared_ptr< LocalMemorySlot > &slot, size_t expectedSent, size_t expectedRcvd)
 
virtual void fenceImpl (const std::shared_ptr< GlobalMemorySlot > &slot, size_t expectedSent, size_t expectedRcvd)
 
virtual void fenceImpl (GlobalMemorySlot::tag_t tag)=0
 
virtual bool acquireGlobalLockImpl (std::shared_ptr< GlobalMemorySlot > memorySlot)=0
 
virtual void releaseGlobalLockImpl (std::shared_ptr< GlobalMemorySlot > memorySlot)=0
 
__INLINE__ auto & getGlobalMemorySlotsToDestroyPerTag ()
 
__INLINE__ auto & getGlobalMemorySlotTagKeyMap ()
 
__INLINE__ void increaseMessageRecvCounter (HiCR::LocalMemorySlot &memorySlot) noexcept
 
__INLINE__ void increaseMessageSentCounter (HiCR::LocalMemorySlot &memorySlot) noexcept
 
__INLINE__ void setMessagesRecv (HiCR::LocalMemorySlot &memorySlot, const size_t count) noexcept
 
__INLINE__ void setMessagesSent (HiCR::LocalMemorySlot &memorySlot, const size_t count) noexcept
 

Detailed Description

Encapsulates a HiCR Backend Communication Manager.

Backends represent plugins to HiCR that provide support for a communication or device library. By adding new plugins developers extend HiCR's support for new hardware and software technologies.

Backends need to fulfill the abstract virtual functions described here, so that HiCR can perform communication operations on the supported device/network library.

Member Typedef Documentation

◆ globalKeyMemorySlotPair_t

Type definition for a global key / local memory slot pair

◆ globalKeyToMemorySlotMap_t

Type definition for an array that stores sets of memory slots, separated by global key

◆ globalMemorySlotTagKeyMap_t

Type definition for a tag-mapped set of key-mapped memory slot arrays

Constructor & Destructor Documentation

◆ ~CommunicationManager()

virtual HiCR::CommunicationManager::~CommunicationManager ( )
virtualdefault

Member Function Documentation

◆ acquireGlobalLock()

__INLINE__ bool HiCR::CommunicationManager::acquireGlobalLock ( const std::shared_ptr< GlobalMemorySlot > &  memorySlot)
inline

This function ensures that the global memory slot is reserved exclusively for access by the caller.

This function might (or might not) block the caller to satisfy the exclusion, if the lock is already held by another caller.

Parameters
[in]memorySlotThe memory slot to reserve
Returns
true, if the lock was acquired successfully; false, otherwise

◆ acquireGlobalLockImpl()

virtual bool HiCR::CommunicationManager::acquireGlobalLockImpl ( std::shared_ptr< GlobalMemorySlot memorySlot)
protectedpure virtual

Backend-specific implementation of the acquireGlobalLock function

Parameters
[in]memorySlotSee the acquireGlobalLock function
Returns
See the acquireGlobalLock function

◆ deregisterGlobalMemorySlot()

__INLINE__ void HiCR::CommunicationManager::deregisterGlobalMemorySlot ( const std::shared_ptr< GlobalMemorySlot > &  memorySlot)
inline

De-registers a previously registered global memory slot. This can be a local operation, and is a CommunicationManager internal operation. The slot is not destroyed, it can be used, but can no longer be accessed via getGlobalMemorySlot.

Parameters
[in]memorySlotMemory slot to deregister.
Note
This method is not thread-safe. It is up to the application developer to ensure that it is called with proper locking.

◆ deregisterGlobalMemorySlotImpl()

virtual void HiCR::CommunicationManager::deregisterGlobalMemorySlotImpl ( const std::shared_ptr< GlobalMemorySlot > &  memorySlot)
inlineprotectedvirtual

Optional backend-internal implementation of the deregisterGlobalMemorySlot function

Parameters
[in]memorySlotMemory slot to deregister.

◆ deserializeGlobalMemorySlot()

virtual std::shared_ptr< GlobalMemorySlot > HiCR::CommunicationManager::deserializeGlobalMemorySlot ( uint8_t *  buffer,
GlobalMemorySlot::tag_t  tag 
)
inlinevirtual

Deserializes a global memory slot from a given buffer.

Parameters
[in]bufferThe buffer to deserialize the global memory slot from
[in]tagThe tag to associate with the deserialized global memory slot
Returns
A pointer to the deserialized global memory slot

Reimplemented in HiCR::backend::lpf::CommunicationManager.

◆ destroyGlobalMemorySlot()

__INLINE__ void HiCR::CommunicationManager::destroyGlobalMemorySlot ( const std::shared_ptr< GlobalMemorySlot > &  memorySlot)
inline

Destroys a (collectively exchanged) global memory slot. This operation is non-blocking and non-collective. Its effects will be visible after the next call to fence(GlobalMemorySlot::tag_t) where the tag is the tag of the memory slot to destroy. That means that multiple slots under the same tag can be destroyed in a single fence operation.

If the memory slot has not been created through exchangeGlobalMemorySlots, the behavior is undefined.

Parameters
[in]memorySlotMemory slot to destroy.
Note
This method is not thread-safe. It is up to the application developer to ensure that

◆ destroyGlobalMemorySlotImpl()

virtual void HiCR::CommunicationManager::destroyGlobalMemorySlotImpl ( std::shared_ptr< GlobalMemorySlot memorySlot)
protectedpure virtual

Deletes a global memory slot from the backend. This operation is collective. Attempting to access the global memory slot after this operation will result in undefined behavior.

Parameters
[in]memorySlotMemory slot to destroy.

◆ destroyPromotedGlobalMemorySlot()

virtual void HiCR::CommunicationManager::destroyPromotedGlobalMemorySlot ( const std::shared_ptr< GlobalMemorySlot > &  memorySlot)
inlinevirtual

Destroys a (locally promoted) global memory slot. This operation is blocking and non-collective. The effects will be visible immediately after the call to this function.

If the memory slot has not been created through promoteLocalMemorySlot, the behavior is undefined.

Parameters
[in]memorySlotMemory slot to destroy.

◆ exchangeGlobalMemorySlots()

__INLINE__ void HiCR::CommunicationManager::exchangeGlobalMemorySlots ( GlobalMemorySlot::tag_t  tag,
const std::vector< globalKeyMemorySlotPair_t > &  memorySlots 
)
inline

Exchanges memory slots among different local instances of HiCR to enable global (remote) communication

Parameters
[in]tagIdentifies a particular subset of global memory slots
[in]memorySlotsArray of local memory slots to make globally accessible

◆ exchangeGlobalMemorySlotsImpl()

virtual void HiCR::CommunicationManager::exchangeGlobalMemorySlotsImpl ( GlobalMemorySlot::tag_t  tag,
const std::vector< globalKeyMemorySlotPair_t > &  memorySlots 
)
protectedpure virtual

Exchanges memory slots among different local instances of HiCR to enable global (remote) communication

Parameters
[in]tagIdentifies a particular subset of global memory slots
[in]memorySlotsArray of local memory slots to make globally accessible

◆ fence() [1/3]

__INLINE__ void HiCR::CommunicationManager::fence ( const std::shared_ptr< GlobalMemorySlot > &  slot,
size_t  expectedSent,
size_t  expectedRecvd 
)
inline

Fences locally on a global, but locally allocated memory slot, until a number of messages are sent/received

This is a non-collective and blocking call; returning from this function indicates that specific to this locally allocated memory slot, incoming memory movement has completed and that outgoing memory movement has left the local interface.

Parameters
[in]slotA global memory slot which is locally allocated
[in]expectedSentnumber of messages to finish sending on slot before returning
[in]expectedRecvdnumber of messages to finish receiving on slot before returning

◆ fence() [2/3]

__INLINE__ void HiCR::CommunicationManager::fence ( const std::shared_ptr< LocalMemorySlot > &  slot,
size_t  expectedSent,
size_t  expectedRecvd 
)
inline

Fences locally on a local memory slot until a number of messages are sent/received

This is a non-collective and blocking call; returning from this function indicates that specific to this memory slot, incoming memory movement has completed and that outgoing memory movement has left the local interface.

Parameters
[in]slotA local memory slot
[in]expectedSentnumber of messages to finish sending on slot before returning
[in]expectedRecvdnumber of messages to finish receiving on slot before returning

◆ fence() [3/3]

__INLINE__ void HiCR::CommunicationManager::fence ( GlobalMemorySlot::tag_t  tag)
inline

Fences a group of memory copies.

This is a collective and blocking call; returning from this function indicates that all local incoming memory movement has completed and that all outgoing memory movement has left the local interface (and is guaranteed to arrive at the remote memory space, modulo any fatal exception).

This function also finishes all pending local to global memory slot promotions, as well as destructions, only for the specified tag.

This call is thread-safe.

Parameters
[in]tagA tag that releases all processes that share the same value once they have arrived at it Exceptions are thrown in the following cases:
  1. One of the remote address spaces no longer has an active communication channel. This is a fatal exception from which HiCR cannot recover. The user is encouraged to exit gracefully without initiating any further communication or waits.
Todo:
How does this interact with malleability of resources of which HiCR is aware? One possible answer is a special event that if left unhandled, is promoted to a fatal exception.

◆ fenceImpl() [1/3]

virtual void HiCR::CommunicationManager::fenceImpl ( const std::shared_ptr< GlobalMemorySlot > &  slot,
size_t  expectedSent,
size_t  expectedRcvd 
)
inlineprotectedvirtual

Backend-internal implementation of the fence on a global memory slot

Parameters
[in]slotA global (but locally allocated) memory slot
[in]expectedSentnumber of messages to finish sending on slot before returning
[in]expectedRcvdnumber of messages to finish receiving on slot before returning

◆ fenceImpl() [2/3]

virtual void HiCR::CommunicationManager::fenceImpl ( const std::shared_ptr< LocalMemorySlot > &  slot,
size_t  expectedSent,
size_t  expectedRcvd 
)
inlineprotectedvirtual

Backend-internal implementation of the fence on a local memory slot

Parameters
[in]slotA local memory slot
[in]expectedSentnumber of messages to finish sending on slot before returning
[in]expectedRcvdnumber of messages to finish receiving on slot before returning

◆ fenceImpl() [3/3]

virtual void HiCR::CommunicationManager::fenceImpl ( GlobalMemorySlot::tag_t  tag)
protectedpure virtual

Backend-internal implementation of the fence function

Parameters
[in]tagA tag that releases all processes that share the same value once they have arrived at it

◆ flushReceived()

virtual __INLINE__ void HiCR::CommunicationManager::flushReceived ( )
inlinevirtual

This function flushes receives registered at remote queue of receiver

◆ flushSent()

virtual __INLINE__ void HiCR::CommunicationManager::flushSent ( )
inlinevirtual

This function flushes pending send operations

◆ getGlobalMemorySlot()

__INLINE__ std::shared_ptr< GlobalMemorySlot > HiCR::CommunicationManager::getGlobalMemorySlot ( GlobalMemorySlot::tag_t  tag,
GlobalMemorySlot::globalKey_t  globalKey 
)
inline

Retrieves the map of globally registered slots

Parameters
[in]tagTag that identifies a subset of all global memory slots
[in]globalKeyThe sorting key inside the tag subset that distinguished between registered slots
Returns
The map of registered global memory slots, filtered by tag and mapped by key
Note
This method is not thread-safe. It is up to the application developer to ensure that

◆ getGlobalMemorySlotImpl()

virtual std::shared_ptr< GlobalMemorySlot > HiCR::CommunicationManager::getGlobalMemorySlotImpl ( GlobalMemorySlot::tag_t  tag,
GlobalMemorySlot::globalKey_t  globalKey 
)
protectedpure virtual

Backend-internal implementation of the getGlobalMemorySlot function

Retrieves the map of globally registered slots

Parameters
[in]tagTag that identifies a subset of all global memory slots
[in]globalKeyThe sorting key inside the tag subset that distinguished between registered slots
Returns
The map of registered global memory slots, filtered by tag and mapped by key

Implemented in HiCR::backend::pthreads::CommunicationManager.

◆ getGlobalMemorySlotsToDestroyPerTag()

__INLINE__ auto & HiCR::CommunicationManager::getGlobalMemorySlotsToDestroyPerTag ( )
inlineprotected

Accessor for the Global slots to destroy per tag field

Returns
A reference to the Global slots to destroy per tag field

◆ getGlobalMemorySlotTagKeyMap()

__INLINE__ auto & HiCR::CommunicationManager::getGlobalMemorySlotTagKeyMap ( )
inlineprotected

Accessor for the Global slots/tag key map

Returns
A reference to the Global slots/tag key map

◆ increaseMessageRecvCounter()

__INLINE__ void HiCR::CommunicationManager::increaseMessageRecvCounter ( HiCR::LocalMemorySlot memorySlot)
inlineprotectednoexcept

Increases the message receive counter for a given memory slot

Parameters
[in]memorySlotThe provided memory slot

◆ increaseMessageSentCounter()

__INLINE__ void HiCR::CommunicationManager::increaseMessageSentCounter ( HiCR::LocalMemorySlot memorySlot)
inlineprotectednoexcept

Increases the message sent counter for a given memory slot

Parameters
[in]memorySlotThe provided memory slot

◆ lock()

virtual void HiCR::CommunicationManager::lock ( )
inlinevirtual

Backend-internal implementation of the locking of a mutual exclusion mechanism. By default, a single mutex can protect access to internal fields. It is up to the application developer to ensure that the mutex is used correctly and efficiently, e.g., grouping multiple operations under a single lock.

Todo:
: Implement a more fine-grained locking mechanism, e.g., per map mutex or parallel maps, and expose thread-safe operations to the user.

◆ memcpy() [1/3]

__INLINE__ void HiCR::CommunicationManager::memcpy ( const std::shared_ptr< GlobalMemorySlot > &  destination,
size_t  dst_offset,
const std::shared_ptr< LocalMemorySlot > &  source,
size_t  src_offset,
size_t  size 
)
inline

Instructs the backend to perform an asynchronous memory copy from within a local memory slot, to within a global memory slot.

Parameters
[in]destinationThe destination global memory slot
[in]dst_offsetThe offset (in bytes) within destination at dst_locality
[in]sourceThe local source memory slot
[in]src_offsetThe offset (in bytes) within source at src_locality
[in]sizeThe number of bytes to copy from the source to the destination

◆ memcpy() [2/3]

__INLINE__ void HiCR::CommunicationManager::memcpy ( const std::shared_ptr< LocalMemorySlot > &  destination,
size_t  dst_offset,
const std::shared_ptr< GlobalMemorySlot > &  source,
size_t  src_offset,
size_t  size 
)
inline

Instructs the backend to perform an asynchronous memory copy from within a global memory slot, to within a local memory slot.

Parameters
[in]destinationThe destination local memory slot
[in]dst_offsetThe offset (in bytes) within destination at dst_locality
[in]sourceThe global source memory slot
[in]src_offsetThe offset (in bytes) within source at src_locality
[in]sizeThe number of bytes to copy from the source to the destination

◆ memcpy() [3/3]

__INLINE__ void HiCR::CommunicationManager::memcpy ( const std::shared_ptr< LocalMemorySlot > &  destination,
size_t  dst_offset,
const std::shared_ptr< LocalMemorySlot > &  source,
size_t  src_offset,
size_t  size 
)
inline

Instructs the backend to perform an asynchronous memory copy from within a local memory slot, to within a local memory slot.

Parameters
[in]sourceThe local source memory slot
[in]src_offsetThe offset (in bytes) within source at src_locality
[in]destinationThe destination local memory slot
[in]dst_offsetThe offset (in bytes) within destination at dst_locality
[in]sizeThe number of bytes to copy from the source to the destination

◆ memcpyImpl() [1/3]

virtual void HiCR::CommunicationManager::memcpyImpl ( const std::shared_ptr< GlobalMemorySlot > &  destination,
size_t  dst_offset,
const std::shared_ptr< LocalMemorySlot > &  source,
size_t  src_offset,
size_t  size 
)
inlineprotectedvirtual

Backend-internal implementation of the memcpy function

Parameters
[in]destinationThe destination global memory slot
[in]dst_offsetThe offset (in bytes) within destination at dst_locality
[in]sourceThe source local memory slot
[in]src_offsetThe offset (in bytes) within source at src_locality
[in]sizeThe number of bytes to copy from the source to the destination

◆ memcpyImpl() [2/3]

virtual void HiCR::CommunicationManager::memcpyImpl ( const std::shared_ptr< LocalMemorySlot > &  destination,
size_t  dst_offset,
const std::shared_ptr< GlobalMemorySlot > &  source,
size_t  src_offset,
size_t  size 
)
inlineprotectedvirtual

Backend-internal implementation of the memcpy function

Parameters
[in]destinationThe destination local memory slot
[in]dst_offsetThe offset (in bytes) within destination at dst_locality
[in]sourceThe source global memory slot
[in]src_offsetThe offset (in bytes) within source at src_locality
[in]sizeThe number of bytes to copy from the source to the destination

◆ memcpyImpl() [3/3]

virtual void HiCR::CommunicationManager::memcpyImpl ( const std::shared_ptr< LocalMemorySlot > &  destination,
size_t  dst_offset,
const std::shared_ptr< LocalMemorySlot > &  source,
size_t  src_offset,
size_t  size 
)
inlineprotectedvirtual

Backend-internal implementation of the memcpy function

Parameters
[in]destinationThe destination local memory slot
[in]dst_offsetThe offset (in bytes) within destination at dst_locality
[in]sourceThe source local memory slot
[in]src_offsetThe offset (in bytes) within source at src_locality
[in]sizeThe number of bytes to copy from the source to the destination

◆ promoteLocalMemorySlot()

virtual std::shared_ptr< GlobalMemorySlot > HiCR::CommunicationManager::promoteLocalMemorySlot ( const std::shared_ptr< LocalMemorySlot > &  localMemorySlot,
GlobalMemorySlot::tag_t  tag 
)
inlinevirtual

Promotes a local memory slot to a global memory slot without collective exchange across all instances. This is an alternative to the exchangeGlobalMemorySlots function, which is a collective operation, and remains the primary way to promote local memory slots to global memory slots, since using a slot produced by this promote operation requires communicating it via a pre-established communication channel.

Parameters
[in]localMemorySlotThe local memory slot to promote
[in]tagThe tag to associate with the promoted global memory slot
Returns
A pointer to the promoted global memory slot

◆ queryMemorySlotUpdates()

__INLINE__ void HiCR::CommunicationManager::queryMemorySlotUpdates ( std::shared_ptr< LocalMemorySlot memorySlot)
inline

Queries the backend to update the internal state of the memory slot. One main use case of this function is to update the number of messages received and sent to/from this slot. This is a non-blocking, non-collective function.

Parameters
[in]memorySlotIdentifier of the memory slot to query for updates.

◆ queryMemorySlotUpdatesImpl()

virtual void HiCR::CommunicationManager::queryMemorySlotUpdatesImpl ( std::shared_ptr< LocalMemorySlot memorySlot)
protectedpure virtual

Backend-internal implementation of the queryMemorySlotUpdates function

Parameters
[in]memorySlotMemory slot to query updates for.

◆ registerGlobalMemorySlot()

__INLINE__ void HiCR::CommunicationManager::registerGlobalMemorySlot ( const std::shared_ptr< GlobalMemorySlot > &  memorySlot)
inlineprotected

Registers a global memory slot from a given address.

Parameters
[in]memorySlotNewly created global memory slot to register

◆ releaseGlobalLock()

__INLINE__ void HiCR::CommunicationManager::releaseGlobalLock ( const std::shared_ptr< GlobalMemorySlot > &  memorySlot)
inline

This function releases a previously acquired lock on a global memory slot

Parameters
[in]memorySlotThe memory slot to release

◆ releaseGlobalLockImpl()

virtual void HiCR::CommunicationManager::releaseGlobalLockImpl ( std::shared_ptr< GlobalMemorySlot memorySlot)
protectedpure virtual

Backend-specific implementation of the releaseGlobalLock function

Parameters
[in]memorySlotSee the releaseGlobalLock function

◆ serializeGlobalMemorySlot()

virtual uint8_t * HiCR::CommunicationManager::serializeGlobalMemorySlot ( const std::shared_ptr< HiCR::GlobalMemorySlot > &  globalSlot) const
inlinevirtual

Serializes a global memory slot, belonging to the current instance, into a buffer that can be sent over the network to other instances, without the need to engage in a collective operation.

Parameters
[in]globalSlotThe global memory slot to serialize
Returns
A pointer to the serialized representation of the global memory slot in a newly allocated buffer. An exception is thrown if the backend does not support the operation
Note
The user is responsible for freeing the buffer, using delete[]

◆ setMessagesRecv()

__INLINE__ void HiCR::CommunicationManager::setMessagesRecv ( HiCR::LocalMemorySlot memorySlot,
const size_t  count 
)
inlineprotectednoexcept

Sets the message receive counter for a given memory slot

Parameters
[in]memorySlotThe provided memory slot
[in]countThe new value to set for the counter

◆ setMessagesSent()

__INLINE__ void HiCR::CommunicationManager::setMessagesSent ( HiCR::LocalMemorySlot memorySlot,
const size_t  count 
)
inlineprotectednoexcept

Sets the message sent counter for a given memory slot

Parameters
[in]memorySlotThe provided memory slot
[in]countThe new value to set for the counter

◆ unlock()

virtual void HiCR::CommunicationManager::unlock ( )
inlinevirtual

Backend-internal implementation of the unlocking of a mutual exclusion mechanism. Same considerations as for lock() apply.


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