Instance Class Reference

HiCR: HiCR::Instance Class Reference
HiCR

#include <instance.hpp>

Inheritance diagram for HiCR::Instance:
HiCR::backend::hwloc::Instance HiCR::backend::mpi::Instance

Public Types

using instanceId_t = uint64_t
 

Public Member Functions

virtual ~Instance ()=default
 
__INLINE__ instanceId_t getId () const
 
virtual bool isRootInstance () const =0
 

Protected Member Functions

__INLINE__ Instance (instanceId_t id)
 

Detailed Description

Defines the instance class, which represents a self-contained instance of HiCR with access to compute and memory resources.

Instances may be created during runtime (if the process managing backend allows for it), or activated/suspended on demand.

Member Typedef Documentation

◆ instanceId_t

using HiCR::Instance::instanceId_t = uint64_t

Type definition for a unique instance identifier

Constructor & Destructor Documentation

◆ ~Instance()

virtual HiCR::Instance::~Instance ( )
virtualdefault

Default destructor

Reimplemented in HiCR::backend::hwloc::Instance, and HiCR::backend::mpi::Instance.

◆ Instance()

__INLINE__ HiCR::Instance::Instance ( instanceId_t  id)
inlineprotected

Protected constructor for the base instance class.

Note
This is a purely abstract class
Parameters
[in]idIdentifier to assign to this instance

Member Function Documentation

◆ getId()

__INLINE__ instanceId_t HiCR::Instance::getId ( ) const
inline

This function returns the (hopefully) unique identifier of the current instance

Returns
The instance identifier

◆ isRootInstance()

virtual bool HiCR::Instance::isRootInstance ( ) const
pure virtual

This function reports whether the caller is the root instance

The root instance represents a single instance in the entire deployment with the following characteristics:

  • It is unique. Only a single instance shall be root in the entire deployment, even if new ones are created.
  • It belongs among the first set of instances created during launch time
  • It has no parent instance

The purpose of the root instance is to provide the minimal tiebreak mechanism that helps in role/task distribution.

Note
Each backend decides how to designate the root instance. Hence, this is a pure virtual function.
Returns
True, if the current instance is root; false, otherwise.

Implemented in HiCR::backend::hwloc::Instance, and HiCR::backend::mpi::Instance.


The documentation for this class was generated from the following file:
  • /home/runner/work/HiCR/HiCR/include/hicr/core/instance.hpp