#include <topology.hpp>
|
static __INLINE__ void | verify (const nlohmann::json &input) |
|
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
◆ deviceList_t
Common type for a collection of devices
◆ Topology()
HiCR::Topology::Topology |
( |
const nlohmann::json & |
input | ) |
|
|
inline |
Deserializing constructor
- Parameters
-
[in] | input | A JSON-encoded serialized topology information |
◆ 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] | device | The device to add |
◆ deserialize()
__INLINE__ void HiCR::Topology::deserialize |
( |
const nlohmann::json & |
input | ) |
|
|
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__ 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 currents that refer to both local and remote currents
◆ 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
◆ isSubset()
__INLINE__ bool HiCR::Topology::isSubset |
( |
const HiCR::Topology |
givenTopology | ) |
|
|
inline |
Checks whether the given topology is a subset of this topology 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] | givenTopology | The given topology to compare this topology with |
- Returns
- true, if this current satisfies the current type; false, otherwise.
◆ merge()
__INLINE__ void HiCR::Topology::merge |
( |
const Topology & |
source | ) |
|
|
inline |
This function allows manually merging one topology information into another
- Parameters
-
[in] | source | The source topology to add into this current |
◆ serialize()
__INLINE__ nlohmann::json HiCR::Topology::serialize |
( |
| ) |
const |
|
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()
void HiCR::Topology::setMetadata |
( |
const nlohmann::json & |
metadata | ) |
|
|
inline |
A function to set internal topology metadata
- Parameters
-
[in] | metadata | The 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] | input | JSON-formatted serialized topology |
The documentation for this class was generated from the following file: