Topology Class Reference

HiCR: HiCR::Topology Class Reference
HiCR

#include <topology.hpp>

Public Types

using deviceList_t = std::vector< std::shared_ptr< Device > >
 

Public Member Functions

__INLINE__ const deviceList_tgetDevices () const
 
__INLINE__ void addDevice (const std::shared_ptr< HiCR::Device > &device)
 
__INLINE__ void merge (const Topology &source)
 
__INLINE__ nlohmann::json serialize () const
 
nlohmann::json & getMetadata ()
 
const nlohmann::json & getMetadata () const
 
void setMetadata (const nlohmann::json &metadata)
 

Static Public Member Functions

static __INLINE__ void verify (const nlohmann::json &input)
 

Detailed Description

This class represents an abstract definition for a HiCR Topology that:

  • Describes the physical resources (devices) of a given system (real or constructed for requesting new instances)
  • Information about the connectivity between the given devices

Member Typedef Documentation

◆ deviceList_t

using HiCR::Topology::deviceList_t = std::vector<std::shared_ptr<Device> >

Common type for a collection of devices

Member Function Documentation

◆ addDevice()

__INLINE__ void HiCR::Topology::addDevice ( const std::shared_ptr< HiCR::Device > &  device)
inline

This function allows manually adding a new device into an existing topology

Parameters
[in]deviceThe device to add

◆ getDevices()

__INLINE__ const deviceList_t & HiCR::Topology::getDevices ( ) const
inline

This function prompts the backend to perform the necessary steps to return existing devices

Returns
A set of pointers to HiCR instances that refer to both local and remote instances

◆ getMetadata() [1/2]

nlohmann::json & HiCR::Topology::getMetadata ( )
inline

A function to get internal topology metadata

Returns
The internal topology metadata

◆ getMetadata() [2/2]

const nlohmann::json & HiCR::Topology::getMetadata ( ) const
inline

A const variant of the function to get internal topology metadata

Returns
The internal topology metadata

◆ merge()

__INLINE__ void HiCR::Topology::merge ( const Topology source)
inline

This function allows manually merging one topology information into another

Parameters
[in]sourceThe source topology to add into this instance

◆ serialize()

__INLINE__ nlohmann::json HiCR::Topology::serialize ( ) const
inline

Serialization function to enable sharing topology information across different HiCR instances (or any other purposes)

Returns
JSON-formatted serialized topology, as detected by this topology manager

◆ setMetadata()

void HiCR::Topology::setMetadata ( const nlohmann::json &  metadata)
inline

A function to set internal topology metadata

Parameters
[in]metadataThe JSON-based metadata to store

◆ verify()

static __INLINE__ void HiCR::Topology::verify ( const nlohmann::json &  input)
inlinestatic

Verifies the provided input (encoded in JSON) satisfied the standard format to describe a topology

Parameters
[in]inputJSON-formatted serialized topology

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