RPCEngine Class Reference
HiCR
|
#include <RPCEngine.hpp>
Public Types | |
using | RPCTargetIndex_t = uint64_t |
Public Member Functions | |
RPCEngine (CommunicationManager &communicationManager, InstanceManager &instanceManager, MemoryManager &memoryManager, ComputeManager &computeManager, std::shared_ptr< MemorySpace > bufferMemorySpace, std::shared_ptr< ComputeResource > computeResource, const uint64_t baseTag=_HICR_RPC_ENGINE_CHANNEL_BASE_TAG) | |
__INLINE__ void | initialize () |
~RPCEngine ()=default | |
__INLINE__ void | addRPCTarget (const std::string &RPCName, const std::shared_ptr< HiCR::ExecutionUnit > e) |
__INLINE__ bool | hasPendingRPCs () |
__INLINE__ void | listen () |
__INLINE__ std::shared_ptr< HiCR::Instance > | getRPCRequester () |
virtual void | requestRPC (HiCR::Instance &instance, const std::string &RPCName) |
__INLINE__ void | submitReturnValue (void *pointer, const size_t size) |
__INLINE__ std::shared_ptr< HiCR::LocalMemorySlot > | getReturnValue (HiCR::Instance &instance) const |
__INLINE__ HiCR::CommunicationManager * | getCommunicationManager () const |
__INLINE__ HiCR::InstanceManager * | getInstanceManager () const |
__INLINE__ HiCR::MemoryManager * | getMemoryManager () const |
__INLINE__ HiCR::ComputeManager * | getComputeManager () const |
Detailed Description
This class encapsulates the HICR-based logic for sending, listening to, and executing remote procedure calls among HiCR distances. An RPC request is represented by a single 64-bit identifier. The requester simply sends this identifier to the receiver instance. Incoming requests are stored in a channel, ready to be picked up by the receiver. To pick up a request, the receiver must enter the listening state. For an RPC to execute, the listener must have registered the corresponding index, together with an associated listenable unit to run. The listenable unit is described as a HiCR execution unit object.
Member Typedef Documentation
◆ RPCTargetIndex_t
using HiCR::frontend::RPCEngine::RPCTargetIndex_t = uint64_t |
Type definition for an index for a listenable unit.
Constructor & Destructor Documentation
◆ RPCEngine()
|
inline |
Constructor
- Parameters
-
[in] communicationManager The communication manager to use to communicate with other instances [in] instanceManager The instance manager to use to get information about other instances [in] memoryManager The memory manager to use to allocate buffer memory [in] computeManager The compute manager to use to execute incoming RPCs [in] bufferMemorySpace The memory space where the RPC engine will allocate all of its internal buffer from [in] computeResource The compute resource to use to execute RPCs [in] baseTag The tag to use for the creation of channels. Provide different values if you plan to create multiple RPC engines otherwise collisions might occur
◆ ~RPCEngine()
|
default |
Default Destructor
Member Function Documentation
◆ addRPCTarget()
|
inline |
Function to add an RPC target with a name, and the combination of a execution unit and the processing unit that is in charge of executing it
- Parameters
-
[in] RPCName Name of the RPC to add [in] e Indicates the execution unit to run when this RPC is triggered
◆ getCommunicationManager()
|
inline |
Gets the internal communication manager this module was initialized with
- Returns
- A pointer to the internal communication manager
◆ getComputeManager()
|
inline |
Gets the internal compute manager this module was initialized with
- Returns
- A pointer to the internal computey manager
◆ getInstanceManager()
|
inline |
Gets the internal instance manager this module was initialized with
- Returns
- A pointer to the internal instance manager
◆ getMemoryManager()
|
inline |
Gets the internal memory manager this module was initialized with
- Returns
- A pointer to the internal memory manager
◆ getReturnValue()
|
inline |
Function to get a return value from a remote instance that ran an RPC
- Parameters
-
[in] instance Instance from which to read the return value. An RPC request should be sent to that instance before calling this function.
- Returns
- A pointer to a newly allocated local memory slot containing the return value
◆ getRPCRequester()
|
inline |
Function to retrieve a pointer to the instance who has requested the executing RPC
- Returns
- a pointer to the instance who requested the RPC
◆ hasPendingRPCs()
|
inline |
Function to check whether there is a pending RPC to listen to.
- Returns
- true, if there is a pending RPC; false, otherwise.
◆ initialize()
|
inline |
Initializes the RPC engine:
- Creates RPC channels
- Creates Return value channels
◆ listen()
|
inline |
Function to put the current instance to listen for incoming RPCs
◆ requestRPC()
|
inlinevirtual |
Function to request the execution of a remote function in a remote HiCR instance
- Parameters
-
[in] RPCName The name of the RPC to run [in] instance Instance on which to run the RPC
◆ submitReturnValue()
|
inline |
Function to submit a return value for the currently running RPC
- Parameters
-
[in] pointer Pointer to the start of the data buffer to send [in] size Size of the data buffer to send
The documentation for this class was generated from the following file:
- /home/runner/work/HiCR/HiCR/include/hicr/frontends/RPCEngine/RPCEngine.hpp
Generated by