CommunicationManager Class Reference

HiCR: HiCR::backend::lpf::CommunicationManager Class Reference
HiCR
HiCR::backend::lpf::CommunicationManager Class Referencefinal

#include <communicationManager.hpp>

Inheritance diagram for HiCR::backend::lpf::CommunicationManager:
HiCR::CommunicationManager

Public Member Functions

 CommunicationManager (size_t size, size_t rank, lpf_t lpf)
 
__INLINE__ uint8_t * serializeGlobalMemorySlot (const std::shared_ptr< HiCR::GlobalMemorySlot > &globalSlot) const override
 
__INLINE__ std::shared_ptr< HiCR::GlobalMemorySlotdeserializeGlobalMemorySlot (uint8_t *buffer, GlobalMemorySlot::tag_t tag) override
 
__INLINE__ std::shared_ptr< HiCR::GlobalMemorySlotpromoteLocalMemorySlot (const std::shared_ptr< HiCR::LocalMemorySlot > &memorySlot, HiCR::GlobalMemorySlot::tag_t tag) override
 
__INLINE__ void destroyPromotedGlobalMemorySlot (const std::shared_ptr< HiCR::GlobalMemorySlot > &memorySlot) override
 
- Public Member Functions inherited from HiCR::CommunicationManager
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< 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)
 

Additional Inherited Members

- Public Types inherited from HiCR::CommunicationManager
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 >
 
- Protected Member Functions inherited from HiCR::CommunicationManager
__INLINE__ void registerGlobalMemorySlot (const std::shared_ptr< GlobalMemorySlot > &memorySlot)
 
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 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

Implementation of the HiCR LPF communication manager

The only LPF engine currently of interest is the IB Verbs engine

Constructor & Destructor Documentation

◆ CommunicationManager()

HiCR::backend::lpf::CommunicationManager::CommunicationManager ( size_t  size,
size_t  rank,
lpf_t  lpf 
)
inline

Constructor of the LPF memory manager

Parameters
[in]sizeCommunicator size
[in]rankProcess rank
[in]lpfLPF context
Note
The decision to resize memory register in the constructor is because this call requires lpf_sync to become effective. This makes it almost impossible to do local memory registrations with LPF. On the other hand, the resize message queue could also be locally made, and placed elsewhere.

Member Function Documentation

◆ deserializeGlobalMemorySlot()

__INLINE__ std::shared_ptr< HiCR::GlobalMemorySlot > HiCR::backend::lpf::CommunicationManager::deserializeGlobalMemorySlot ( uint8_t *  buffer,
GlobalMemorySlot::tag_t  tag 
)
inlineoverridevirtual

Deserializes a global memory slot from a buffer.

Note
The returned slot will not have a swap slot associated with it.
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 from HiCR::CommunicationManager.

◆ destroyPromotedGlobalMemorySlot()

__INLINE__ void HiCR::backend::lpf::CommunicationManager::destroyPromotedGlobalMemorySlot ( const std::shared_ptr< HiCR::GlobalMemorySlot > &  memorySlot)
inlineoverride

Destroys a (locally promoted) global memory slot. This operation is local.

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

Parameters
[in]memorySlotMemory slot to destroy.

◆ promoteLocalMemorySlot()

__INLINE__ std::shared_ptr< HiCR::GlobalMemorySlot > HiCR::backend::lpf::CommunicationManager::promoteLocalMemorySlot ( const std::shared_ptr< HiCR::LocalMemorySlot > &  memorySlot,
HiCR::GlobalMemorySlot::tag_t  tag 
)
inlineoverride

Promotes a local memory slot to a global memory slot (see abstract class for more details)

Parameters
[in]memorySlotThe 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

◆ serializeGlobalMemorySlot()

__INLINE__ uint8_t * HiCR::backend::lpf::CommunicationManager::serializeGlobalMemorySlot ( const std::shared_ptr< HiCR::GlobalMemorySlot > &  globalSlot) const
inlineoverride

Serializes a global memory slot, registered on 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. LPF is responsible for the serialization of the slot, which contains registration information etc.

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.
Note
The user is responsible for freeing the buffer, using delete[]

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