Topology Class Reference
HiCR
|
#include <topology.hpp>
Public Types | |
using | deviceList_t = std::vector< std::shared_ptr< Device > > |
Public Member Functions | |
Topology (const nlohmann::json &input) | |
__INLINE__ const deviceList_t & | getDevices () const |
__INLINE__ void | addDevice (const std::shared_ptr< HiCR::Device > &device) |
__INLINE__ void | merge (const Topology &source) |
__INLINE__ nlohmann::json | serialize () const |
__INLINE__ void | deserialize (const nlohmann::json &input) |
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) |
static __INLINE__ bool | isSubset (const HiCR::Topology &topology1, const HiCR::Topology &topology2) |
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 currents)
- 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
Constructor & Destructor Documentation
◆ Topology()
|
inline |
Deserializing constructor
- Parameters
-
[in] input A JSON-encoded serialized topology information
Member Function Documentation
◆ addDevice()
|
inline |
This function allows manually adding a new device into an existing topology
- Parameters
-
[in] device The device to add
◆ deserialize()
|
inline |
De-serialization function to re-construct the serialized topology information coming (typically) from remote instances
- Parameters
-
[in] input JSON-formatted serialized device information
- Note
- Important: Deserialized devices are not meant to be used in any from other than printing or reporting its topology. Any attempt of actually using them for computation or data transfers will result in undefined behavior.
◆ getDevices()
|
inline |
This function prompts the backend to perform the necessary steps to return existing devices
- Returns
- A set of pointers to HiCR currents that refer to both local and remote currents
◆ getMetadata() [1/2]
|
inline |
A function to get internal topology metadata
- Returns
- The internal topology metadata
◆ getMetadata() [2/2]
|
inline |
A const variant of the function to get internal topology metadata
- Returns
- The internal topology metadata
◆ isSubset()
|
inlinestatic |
Checks whether the given topology 2 is a subset of a given topology 1 That is, whether it contains the given devices in the current type provided
The devices are checked in order. That is the first current device that satisfies a given device will be removed from the list when checking the next given device.
- Parameters
-
[in] topology1 The topology proposed as superset [in] topology2 The topology proposed as subset
- Returns
- true, if topology2 is a subset of topology 1; false, otherwise.
◆ merge()
|
inline |
This function allows manually merging one topology information into another
- Parameters
-
[in] source The source topology to add into this current
◆ serialize()
|
inline |
Serialization function to enable sharing topology information across different HiCR currents (or any other purposes)
- Returns
- JSON-formatted serialized topology, as detected by this topology manager
◆ setMetadata()
|
inline |
A function to set internal topology metadata
- Parameters
-
[in] metadata The JSON-based metadata to store
◆ verify()
|
inlinestatic |
Verifies the provided input (encoded in JSON) satisfied the standard format to describe a topology
- Parameters
-
[in] input JSON-formatted serialized topology
The documentation for this class was generated from the following file:
- /home/runner/work/HiCR/HiCR/include/hicr/core/topology.hpp
Generated by