Quantum Resource Manager and Compiler Infrastructure (QRM&CI) 0.1.0
Config.h File Reference
Include dependency graph for Config.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  mqss::qrmci::RabbitMqConnectionConfig
 RabbitMQ connection settings, shared by every stage's messaging. More...
struct  mqss::qrmci::BackendRegistryConfig
 How long a BackendRegistry entry stays usable after its last refresh. More...
struct  mqss::qrmci::CommonConfig
 Settings shared by every pipeline stage: the RabbitMQ connection, logging, the queues common to more than one stage (task intake, results, and scheduling – which never runs as its own distributed process), and the daemon's outer poll loop cadence. More...
struct  mqss::qrmci::SelectorConfig
 Backend-selector stage configuration: the distributed selector's own queues, logging, and the timing of its own BackendRegistry (which only ever absorbs published status – it never publishes). More...
struct  mqss::qrmci::CompilerConfig
 Compiler-stage configuration: the queue a worker receives already-selected tasks from, and its logging. More...
struct  mqss::qrmci::SubmitterConfig
 Submitter-specific configuration: its own queue/logging, QDMI credentials and device selection, and the timing of the BackendRegistry owned by any stage that holds a submitter (the distributed worker and the standalone daemon both source their registry's timing from here, since both look up backends through it for submission and publish their own status into it). More...
struct  mqss::qrmci::Config
 A daemon's complete configuration, grouped by the pipeline responsibility each field belongs to. More...

Functions

std::expected< Config, Error > mqss::qrmci::loadConfig ()
 Build a configuration from defaults, an optional TOML file and environment overrides.
std::expected< Config, Error > mqss::qrmci::loadConfig (const std::filesystem::path &configFile)
 Build a configuration from defaults, the TOML file at configFile, and environment overrides, bypassing the usual QRMCI_CONFIG_FILE/default-path discovery.

Detailed Description

The runtime configuration model shared by every QRM&CI daemon.

A configuration is assembled from compiled-in defaults, an optional TOML file and environment overrides, in that order of increasing precedence. Fields are grouped by the pipeline responsibility that owns them (selector, compiler, submitter), plus a common group for settings shared across every stage. The grouping names which stage's concern a field is, not which process is allowed to read it: a distributed process reads every group whose responsibility its own work touches, not only the one named after it. For example the distributed worker reads [submitter] for its own device and registry timing but also [selector]'s backendStatusQueue to publish its status, and [compiler] for the queue it receives tasks on – see Config below for the exact reads of each shipped entrypoint.

Definition in file Config.h.

Function Documentation

◆ loadConfig() [1/2]

std::expected< Config, Error > mqss::qrmci::loadConfig ( )

Build a configuration from defaults, an optional TOML file and environment overrides.

Precedence is defaults < file < environment variables. The file is discovered from the QRMCI_CONFIG_FILE environment variable if set, otherwise from the relative default path config/qrmci.toml; a missing file is not an error and simply leaves the corresponding fields at their defaults/environment values. A file that exists but fails to parse, an unknown key, a present value of the wrong type, or a value that violates one of the range/cross-field constraints documented on the affected field is reported as Error::Kind::ConfigError naming the exact dotted key at fault.

Returns
The assembled configuration, or a ConfigError describing why the discovered file could not be read or the assembled configuration is invalid.

◆ loadConfig() [2/2]

std::expected< Config, Error > mqss::qrmci::loadConfig ( const std::filesystem::path & configFile)

Build a configuration from defaults, the TOML file at configFile, and environment overrides, bypassing the usual QRMCI_CONFIG_FILE/default-path discovery.

Parameters
configFileThe TOML file to load. A missing file is not an error.
Returns
The assembled configuration, or a ConfigError describing why configFile could not be read or the assembled configuration is invalid.