@@ -185,6 +185,41 @@ std::vector<RawChannel> extractRawChannels(const DeviceSpec& spec, const DeviceE
185185 return rawChannels;
186186}
187187
188+ bool isUniqueProxy (const DeviceSpec& spec)
189+ {
190+ return std::find (spec.labels .begin (), spec.labels .end (), ecs::uniqueProxyLabel) != spec.labels .end ();
191+ }
192+
193+ bool shouldPreserveRawChannels (const DeviceSpec& spec)
194+ {
195+ return std::find (spec.labels .begin (), spec.labels .end (), ecs::preserveRawChannelsLabel) != spec.labels .end ();
196+ }
197+
198+ bool isQcReconfigurable (const DeviceSpec& spec)
199+ {
200+ return std::find (spec.labels .begin (), spec.labels .end (), ecs::qcReconfigurable) != spec.labels .end ();
201+ }
202+
203+ void dumpProperties (std::ostream& dumpOut, const DeviceExecution& execution, const DeviceSpec& spec, const std::string& indLevel)
204+ {
205+ // get the argument `--config`
206+ std::string configPath;
207+ auto it = std::find_if (execution.args .begin (), execution.args .end (), [](char * v) { return v != nullptr && strcmp (v, " --config" ) == 0 ; });
208+
209+ // get the next argument and find `/o2/components/` in it, then take what comes after in the string.
210+ if (it != execution.args .end ()) {
211+ std::string configParam = *(++it);
212+ std::string prefix = " /o2/components/" ; // keep only the path to the config file, i.e. stuff after "/o2/components/"
213+ size_t pos = configParam.find (prefix);
214+ if (pos != std::string::npos) {
215+ configPath = configParam.substr (pos + prefix.length ());
216+ }
217+ }
218+
219+ dumpOut << indLevel << " properties:\n " ;
220+ dumpOut << indLevel << indScheme << " qcConfiguration: " << configPath << " \n " ;
221+ }
222+
188223void dumpCommand (std::ostream& dumpOut, const DeviceExecution& execution, std::string indLevel)
189224{
190225 dumpOut << indLevel << " shell: true\n " ;
@@ -260,16 +295,6 @@ std::string findBinder(const std::vector<DeviceSpec>& specs, const std::string&
260295 throw std::runtime_error (" Could not find a device which binds the '" + channel + " ' channel." );
261296}
262297
263- bool isUniqueProxy (const DeviceSpec& spec)
264- {
265- return std::find (spec.labels .begin (), spec.labels .end (), ecs::uniqueProxyLabel) != spec.labels .end ();
266- }
267-
268- bool shouldPreserveRawChannels (const DeviceSpec& spec)
269- {
270- return std::find (spec.labels .begin (), spec.labels .end (), ecs::preserveRawChannelsLabel) != spec.labels .end ();
271- }
272-
273298void dumpRole (std::ostream& dumpOut, const std::string& taskName, const DeviceSpec& spec, const std::vector<DeviceSpec>& allSpecs, const DeviceExecution& execution, const std::string indLevel)
274299{
275300 dumpOut << indLevel << " - name: \" " << spec.id << " \"\n " ;
@@ -374,6 +399,10 @@ void dumpTask(std::ostream& dumpOut, const DeviceSpec& spec, const DeviceExecuti
374399 }
375400 }
376401
402+ if (implementation::isQcReconfigurable (spec)) {
403+ implementation::dumpProperties (dumpOut, execution, spec, indLevel);
404+ }
405+
377406 dumpOut << indLevel << " command:\n " ;
378407 implementation::dumpCommand (dumpOut, execution, indLevel + indScheme);
379408}
0 commit comments