Skip to content

Commit acd9e5d

Browse files
committed
DPL: allow adding suffix to all dataprocessors in a workflow
1 parent 8e24cc8 commit acd9e5d

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

Framework/Core/include/Framework/runDataProcessing.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ void overridePipeline(o2::framework::ConfigContext& ctx, std::vector<o2::framewo
105105
/// Helper used to customize a workflow via a template data processor
106106
void overrideCloning(o2::framework::ConfigContext& ctx, std::vector<o2::framework::DataProcessorSpec>& workflow);
107107

108+
/// Helper used to customize the workflow via a global suffix.
109+
void overrideSuffix(o2::framework::ConfigContext& ctx, std::vector<o2::framework::DataProcessorSpec>& workflow);
110+
108111
// This comes from the framework itself. This way we avoid code duplication.
109112
int doMain(int argc, char** argv, o2::framework::WorkflowSpec const& specs,
110113
std::vector<o2::framework::ChannelConfigurationPolicy> const& channelPolicies,
@@ -131,6 +134,7 @@ int main(int argc, char** argv)
131134
workflowOptions.push_back(ConfigParamSpec{"readers", VariantType::Int64, 1ll, {"number of parallel readers to use"}});
132135
workflowOptions.push_back(ConfigParamSpec{"pipeline", VariantType::String, "", {"override default pipeline size"}});
133136
workflowOptions.push_back(ConfigParamSpec{"clone", VariantType::String, "", {"clone processors from a template"}});
137+
workflowOptions.push_back(ConfigParamSpec{"workflow-suffix", VariantType::String, "", {"suffix to add to all dataprocessors"}});
134138

135139
// options for AOD rate limiting
136140
workflowOptions.push_back(ConfigParamSpec{"aod-memory-rate-limit", VariantType::Int64, 0LL, {"Rate limit AOD processing based on memory"}});
@@ -176,8 +180,9 @@ int main(int argc, char** argv)
176180
ConfigParamRegistry workflowOptionsRegistry(std::move(workflowOptionsStore));
177181
ConfigContext configContext(workflowOptionsRegistry, argc, argv);
178182
o2::framework::WorkflowSpec specs = defineDataProcessing(configContext);
179-
overridePipeline(configContext, specs);
180183
overrideCloning(configContext, specs);
184+
overrideSuffix(configContext, specs);
185+
overridePipeline(configContext, specs);
181186
for (auto& spec : specs) {
182187
UserCustomizationsHelper::userDefinedCustomization(spec.requiredServices, 0);
183188
}

Framework/Core/src/runDataProcessing.cxx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,6 +1388,17 @@ bool isOutputToPipe()
13881388
return ((s.st_mode & S_IFIFO) != 0);
13891389
}
13901390

1391+
void overrideSuffix(ConfigContext& ctx, WorkflowSpec& workflow)
1392+
{
1393+
auto suffix = ctx.options().get<std::string>("workflow-suffix");
1394+
if (suffix.empty()) {
1395+
return;
1396+
}
1397+
for (auto& processor : workflow) {
1398+
processor.name = processor.name + suffix;
1399+
}
1400+
}
1401+
13911402
void overrideCloning(ConfigContext& ctx, WorkflowSpec& workflow)
13921403
{
13931404
struct CloningSpec {

0 commit comments

Comments
 (0)