InstanceManager Class Reference
HiCR
|
#include <instanceManager.hpp>

Public Types | |
using | RPCTargetIndex_t = uint64_t |
using | RPCFunction_t = std::function< void()> |
using | instanceList_t = std::vector< std::shared_ptr< HiCR::Instance > > |
Public Member Functions | |
InstanceManager ()=default | |
virtual | ~InstanceManager ()=default |
__INLINE__ instanceList_t & | getInstances () |
__INLINE__ std::shared_ptr< HiCR::Instance > | getCurrentInstance () const |
__INLINE__ std::shared_ptr< HiCR::InstanceTemplate > | createInstanceTemplate (const HiCR::Topology &requestedTopology=HiCR::Topology()) |
__INLINE__ std::shared_ptr< HiCR::Instance > | createInstance (const HiCR::InstanceTemplate instanceTemplate) |
__INLINE__ void | terminateInstance (const std::shared_ptr< HiCR::Instance > instance) |
__INLINE__ void | addInstance (HiCR::Instance::instanceId_t instanceId) |
virtual void | finalize ()=0 |
virtual void | abort (int errorCode)=0 |
virtual HiCR::Instance::instanceId_t | getRootInstanceId () const =0 |
Protected Member Functions | |
virtual std::shared_ptr< HiCR::Instance > | createInstanceImpl (const HiCR::InstanceTemplate instanceTemplate) |
virtual std::shared_ptr< HiCR::Instance > | addInstanceImpl (HiCR::Instance::instanceId_t instanceId) |
virtual void | terminateInstanceImpl (const std::shared_ptr< HiCR::Instance > instance) |
__INLINE__ void | setCurrentInstance (const std::shared_ptr< HiCR::Instance > &instance) |
__INLINE__ void | addInstance (const std::shared_ptr< HiCR::Instance > &instance) |
Detailed Description
Encapsulates a HiCR Backend Instance Manager.
Backends need to fulfill the abstract virtual functions described here, so that HiCR can detect/create/communicate with other HiCR instances
Member Typedef Documentation
◆ instanceList_t
using HiCR::InstanceManager::instanceList_t = std::vector<std::shared_ptr<HiCR::Instance> > |
Type definition for an unsorted set of unique pointers to the detected instances
◆ RPCFunction_t
using HiCR::InstanceManager::RPCFunction_t = std::function<void()> |
Type definition for a function that can be executed as RPC
◆ RPCTargetIndex_t
using HiCR::InstanceManager::RPCTargetIndex_t = uint64_t |
Type definition for an index for a listenable unit.
Constructor & Destructor Documentation
◆ InstanceManager()
|
default |
Default constructor is deleted, this class requires the passing of a memory manager
◆ ~InstanceManager()
|
virtualdefault |
Default destructor
Reimplemented in HiCR::backend::hwloc::InstanceManager, and HiCR::backend::mpi::InstanceManager.
Member Function Documentation
◆ abort()
|
pure virtual |
This function calls the internal implementation of the abort procedure for the given instance manager
- Parameters
-
[in] errorCode The error code to publish upon aborting execution
Implemented in HiCR::backend::hwloc::InstanceManager, and HiCR::backend::mpi::InstanceManager.
◆ addInstance() [1/2]
|
inlineprotected |
Add a new instance to the manager scope
- Parameters
-
[in] instance The instance to add
◆ addInstance() [2/2]
|
inline |
Function to add a new instance to the set of instances tracked by the instance manager.
- Parameters
-
[in] instanceId the id of the instance
◆ addInstanceImpl()
|
inlineprotectedvirtual |
Backend-specific implementation of the addInstance function
- Parameters
-
[in] instanceId the id of the instance
- Returns
- A pointer to the backend-specific instance
◆ createInstance()
|
inline |
Function to create a new HiCR instance
- Parameters
-
[in] instanceTemplate The HiCR instance template to try to obtain in the new instance
- Returns
- A pointer to the newly created instance (if successful), a null pointer otherwise.
◆ createInstanceImpl()
|
inlineprotectedvirtual |
Backend-specific implementation of the createInstance function
- Parameters
-
[in] instanceTemplate The HiCR instance template to try to obtain in the new instance
- Returns
- A pointer to the newly created instance (if successful), a null pointer otherwise.
◆ createInstanceTemplate()
|
inline |
Function to create new instance template
- Parameters
-
[in] requestedTopology The HiCR topology to try to obtain in the new instance
- Returns
- A pointer to the newly created instance template
◆ finalize()
|
pure virtual |
This function calls the internal implementation of the finalization procedure for the given instance manager
Implemented in HiCR::backend::hwloc::InstanceManager, and HiCR::backend::mpi::InstanceManager.
◆ getCurrentInstance()
|
inline |
Function to retrieve the currently executing instance
- Returns
- A pointer to the local HiCR instance (in other words, the one running this function)
◆ getInstances()
|
inline |
This function prompts the backend to perform the necessary steps to discover and list the currently created (active or not)
- Returns
- A set of pointers to HiCR instances that refer to both local and remote instances
◆ getRootInstanceId()
|
pure virtual |
Returns the id of the backend's root instance id
- Returns
- The id of the root instance id
Implemented in HiCR::backend::hwloc::InstanceManager, and HiCR::backend::mpi::InstanceManager.
◆ setCurrentInstance()
|
inlineprotected |
Set the current instance
- Parameters
-
[in] instance The instance to set as current instance
◆ terminateInstance()
|
inline |
Function to terminate a given instance
- Parameters
-
[in] instance The HiCR instance to terminate
◆ terminateInstanceImpl()
|
inlineprotectedvirtual |
Backend-specific implementation of the terminate function
- Parameters
-
[in] instance The HiCR instance to terminate
The documentation for this class was generated from the following file:
- /home/runner/work/HiCR/HiCR/include/hicr/core/instanceManager.hpp
Generated by