@@ -29,17 +29,17 @@ WorkflowSpec InfrastructureGenerator::generateLocalInfrastructure(std::string co
2929 TaskRunnerFactory taskRunnerFactory;
3030 auto config = ConfigurationFactory::getConfiguration (configurationSource);
3131
32- for (const auto & task : config->getRecursive (" qc.tasks" )) {
33- if (task. second . get <bool >(" active" ) && task. second .get <std::string>(" location" ) == " local" ) {
32+ for (const auto & [taskName, taskConfig] : config->getRecursive (" qc.tasks" )) {
33+ if (taskConfig. get <bool >(" active" ) && taskConfig .get <std::string>(" location" ) == " local" ) {
3434 // ids are assigned to local tasks in order to distinguish monitor objects outputs from each other and be able to
3535 // merge them. If there is no need to merge (only one qc task), it gets subspec 0.
3636 // todo: use matcher for subspec when available in DPL
37- size_t id = task. second .get_child (" machines" ).size () > 1 ? 1 : 0 ;
38- for (const auto & machine : task. second .get_child (" machines" )) {
37+ size_t id = taskConfig .get_child (" machines" ).size () > 1 ? 1 : 0 ;
38+ for (const auto & machine : taskConfig .get_child (" machines" )) {
3939
4040 if (machine.second .get <std::string>(" " ) == host) {
4141 // todo: optimize it by using the same ptree?
42- workflow.emplace_back (taskRunnerFactory.create (task. first , configurationSource, id, true ));
42+ workflow.emplace_back (taskRunnerFactory.create (taskName , configurationSource, id, true ));
4343 break ;
4444 }
4545 id++;
@@ -63,20 +63,20 @@ o2::framework::WorkflowSpec InfrastructureGenerator::generateRemoteInfrastructur
6363
6464 TaskRunnerFactory taskRunnerFactory;
6565 CheckerFactory checkerFactory;
66- for (const auto & task : config->getRecursive (" qc.tasks" )) {
66+ for (const auto & [taskName, taskConfig] : config->getRecursive (" qc.tasks" )) {
6767 // todo sanitize somehow this if-frenzy
68- if (task. second .get <bool >(" active" , true )) {
69- if (task. second .get <std::string>(" location" ) == " local" ) {
68+ if (taskConfig .get <bool >(" active" , true )) {
69+ if (taskConfig .get <std::string>(" location" ) == " local" ) {
7070 // if tasks are LOCAL, generate mergers + checkers
7171
7272 // todo use real mergers when they are done
7373
7474 // generate merger only, when there is a need to merge something
75- if (task. second .get_child (" machines" ).size () > 1 ) {
76- HistoMerger merger (task. first + " -merger" , 1 );
75+ if (taskConfig .get_child (" machines" ).size () > 1 ) {
76+ HistoMerger merger (taskName + " -merger" , 1 );
7777 merger.configureInputsOutputs (TaskRunner::createTaskDataOrigin (),
78- TaskRunner::createTaskDataDescription (task. first ),
79- { 1 , task. second .get_child (" machines" ).size () });
78+ TaskRunner::createTaskDataDescription (taskName ),
79+ { 1 , taskConfig .get_child (" machines" ).size () });
8080 DataProcessorSpec mergerSpec{
8181 merger.getName (),
8282 merger.getInputSpecs (),
@@ -87,13 +87,13 @@ o2::framework::WorkflowSpec InfrastructureGenerator::generateRemoteInfrastructur
8787 workflow.emplace_back (mergerSpec);
8888 }
8989
90- } else if (task. second .get <std::string>(" location" ) == " remote" ) {
90+ } else if (taskConfig .get <std::string>(" location" ) == " remote" ) {
9191 // -- if tasks are REMOTE, generate tasks + mergers + checkers
9292
93- workflow.emplace_back (taskRunnerFactory.create (task. first , configurationSource, 0 ));
93+ workflow.emplace_back (taskRunnerFactory.create (taskName , configurationSource, 0 ));
9494 }
9595
96- workflow.emplace_back (checkerFactory.create (task. first + " -checker" , task. first , configurationSource));
96+ workflow.emplace_back (checkerFactory.create (taskName + " -checker" , taskName , configurationSource));
9797 }
9898 }
9999 return workflow;
0 commit comments