CommunicationManager Class Reference

HiCR: HiCR::backend::ascend::CommunicationManager Class Reference
HiCR
HiCR::backend::ascend::CommunicationManager Class Referencefinal

#include <communicationManager.hpp>

Inheritance diagram for HiCR::backend::ascend::CommunicationManager:
HiCR::CommunicationManager

Public Types

enum  deviceType_t { none , host , device }
 
- 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 >
 

Public Member Functions

 CommunicationManager ()
 
 ~CommunicationManager ()=default
 
__INLINE__ void memcpyAsync (const std::shared_ptr< HiCR::LocalMemorySlot > &destination, const size_t dst_offset, const std::shared_ptr< HiCR::LocalMemorySlot > &source, const size_t src_offset, const size_t size, const aclrtStream stream)
 
- Public Member Functions inherited from HiCR::CommunicationManager
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 ()
 

Additional Inherited Members

- 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 Communication Manager for the Ascend backend.

Note
Supported local memory slots:
  • Ascend
  • HWLoC

Member Enumeration Documentation

◆ deviceType_t

Enumeration to indicate a type of device involved in data communication operations

Enumerator
none 

No device – used as safeguard to detect errors

host 

Host – Involves the main host memory (RAM) in the operation

device 

Device – Involves an Ascend device memory (DRAM) in the operation

Constructor & Destructor Documentation

◆ CommunicationManager()

HiCR::backend::ascend::CommunicationManager::CommunicationManager ( )
inline

Constructor for the ascend communication manager class for the Ascend backend.

◆ ~CommunicationManager()

HiCR::backend::ascend::CommunicationManager::~CommunicationManager ( )
virtualdefault

Default destructor

Reimplemented from HiCR::CommunicationManager.

Member Function Documentation

◆ memcpyAsync()

__INLINE__ void HiCR::backend::ascend::CommunicationManager::memcpyAsync ( const std::shared_ptr< HiCR::LocalMemorySlot > &  destination,
const size_t  dst_offset,
const std::shared_ptr< HiCR::LocalMemorySlot > &  source,
const size_t  src_offset,
const size_t  size,
const aclrtStream  stream 
)
inline

Backend-internal asyncrhonous implementation of the memcpy operation. It passes an Ascend stream as context for later asynchrounous check for completion

For more information, see: memcpyImpl

Parameters
[in]destinationdestination memory slot
[in]dst_offsetdestination offset
[in]sourcesource memory slot
[in]src_offsetsource offset
[in]sizethe number of bytes to copy
[in]streamAscend stream containing the state of the operation for later checks for completion

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