Quantum Resource Manager and Compiler Infrastructure (QRM&CI) 0.1.0
Config.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2026 MQSS Maintainers
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 */
7
23
24#pragma once
25
27#include "qrmci/Error.h"
28
29#include <chrono>
30#include <expected>
31#include <filesystem>
32#include <string>
33
34namespace mqss::qrmci {
35
38 std::string host;
39 int port{};
40 std::string user;
41 std::string password;
42 std::string vhost;
43};
44
51 std::chrono::seconds entryTimeToLive{30};
52};
53
60
61 std::string logDir;
62
63 std::string daemonLogger;
64 std::string daemonLog;
65
66 std::string qrmciQueue;
67 std::string resultsQueue;
68
69 std::string schedulerQueue;
70 std::string schedulerLogger;
71 std::string schedulerLog;
72
76 std::chrono::milliseconds stagePollInterval{100};
77};
78
96
100 std::string queue;
101 std::string logger;
102 std::string logFile;
103
105 std::chrono::milliseconds taskReceiveTimeout{500};
106};
107
115 std::string queue;
116 std::string logger;
117 std::string logFile;
118
122 std::string qdmiDriver;
123 std::string qdmiDeviceName;
124 std::string qdmiDeviceId;
125 std::string qdmiClientToken;
126
133 std::chrono::seconds jobWaitTimeout{0};
134
136
139 std::chrono::milliseconds backendStatusPublishInterval{5000};
140};
141
158
174std::expected<Config, Error> loadConfig();
175
183std::expected<Config, Error>
184loadConfig(const std::filesystem::path &configFile);
185
186} // namespace mqss::qrmci
The set of backends a QRM&CI process may schedule onto, and the time-to-live after which an entry nob...
BackendSelectionPolicy
Named rule deciding which backend wins when several of them could run the same task.
@ LowestName
The compatible backend whose name sorts first.
std::expected< Config, Error > loadConfig()
Build a configuration from defaults, an optional TOML file and environment overrides.
The error type every std::expected in QRM&CI's public interfaces carries.
How long a BackendRegistry entry stays usable after its last refresh.
Definition Config.h:49
std::chrono::seconds entryTimeToLive
Entry time-to-live, forwarded to BackendRegistry's constructor.
Definition Config.h:51
Settings shared by every pipeline stage: the RabbitMQ connection, logging, the queues common to more ...
Definition Config.h:58
std::string schedulerQueue
Queue used by the scheduler stage.
Definition Config.h:69
std::string logDir
Directory where log files are written.
Definition Config.h:61
RabbitMqConnectionConfig connection
RabbitMQ connection settings.
Definition Config.h:59
std::string daemonLogger
Logger name for the daemon.
Definition Config.h:63
std::chrono::milliseconds stagePollInterval
Sleep between turns of a daemon's main loop.
Definition Config.h:76
std::string schedulerLogger
Logger name for the scheduler.
Definition Config.h:70
std::string qrmciQueue
Queue incoming tasks arrive on.
Definition Config.h:66
std::string resultsQueue
Queue that carries execution results.
Definition Config.h:67
std::string schedulerLog
Log file for the scheduler.
Definition Config.h:71
std::string daemonLog
Log file for the daemon.
Definition Config.h:64
Compiler-stage configuration: the queue a worker receives already-selected tasks from,...
Definition Config.h:99
std::string logger
Logger name for the compiler.
Definition Config.h:101
std::chrono::milliseconds taskReceiveTimeout
Timeout for the worker's receive() from this queue.
Definition Config.h:105
std::string logFile
Log file for the compiler.
Definition Config.h:102
std::string queue
Queue used by the compiler stage.
Definition Config.h:100
A daemon's complete configuration, grouped by the pipeline responsibility each field belongs to.
Definition Config.h:152
SelectorConfig selector
Backend-selector stage configuration.
Definition Config.h:154
CompilerConfig compiler
Compiler stage configuration.
Definition Config.h:155
CommonConfig common
Settings shared by every stage.
Definition Config.h:153
SubmitterConfig submitter
Submitter stage configuration.
Definition Config.h:156
RabbitMQ connection settings, shared by every stage's messaging.
Definition Config.h:37
int port
RabbitMQ TCP port.
Definition Config.h:39
std::string password
RabbitMQ password.
Definition Config.h:41
std::string user
RabbitMQ user name.
Definition Config.h:40
std::string host
RabbitMQ host name.
Definition Config.h:38
std::string vhost
RabbitMQ virtual host.
Definition Config.h:42
Backend-selector stage configuration: the distributed selector's own queues, logging,...
Definition Config.h:82
std::string backendStatusQueue
Queue backend status is published on.
Definition Config.h:83
BackendRegistryConfig backendRegistry
This selector's registry timing.
Definition Config.h:87
std::string logger
Logger name for the selector.
Definition Config.h:84
std::string logFile
Log file for the selector.
Definition Config.h:85
BackendSelectionPolicy selectionPolicy
The rule for picking among several compatible backends, driving both the standalone daemon's and the ...
Definition Config.h:94
Submitter-specific configuration: its own queue/logging, QDMI credentials and device selection,...
Definition Config.h:114
std::string qdmiDeviceId
QDMI device id.
Definition Config.h:124
std::chrono::milliseconds backendStatusPublishInterval
Minimum spacing between two of this stage's own backend-status publications.
Definition Config.h:139
std::string logger
Logger name for the submitter.
Definition Config.h:116
std::chrono::seconds jobWaitTimeout
How long collectQuantumResult() waits for each submitted job to reach a final state.
Definition Config.h:133
BackendRegistryConfig backendRegistry
This submitter's registry timing.
Definition Config.h:135
std::string qdmiClientToken
QDMI client token.
Definition Config.h:125
std::string logFile
Log file for the submitter.
Definition Config.h:117
std::string qdmiDeviceName
QDMI device name.
Definition Config.h:123
std::string queue
Queue used by the submitter stage.
Definition Config.h:115
std::string qdmiDriver
Filesystem path to the QDMI driver library to load.
Definition Config.h:122