Skip to content

Commit eef5e2c

Browse files
committed
DPL: trigger runtime error in case of duplicate processor names
1 parent 359b736 commit eef5e2c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Framework/Core/src/runDataProcessing.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2959,7 +2959,11 @@ int doMain(int argc, char** argv, o2::framework::WorkflowSpec const& workflow,
29592959
for (auto& dp : importedWorkflow) {
29602960
auto found = std::find_if(physicalWorkflow.begin(), physicalWorkflow.end(),
29612961
[&name = dp.name](DataProcessorSpec const& spec) { return spec.name == name; });
2962-
if (found == physicalWorkflow.end()) {
2962+
// also checking the workflow for processors with the same name but from a different executable,
2963+
// adding them to the workflow to trigger the check for duplicate names in the MATERIALISE_WORKFLOW state
2964+
auto duplicate_name = std::find_if(dataProcessorInfos.begin(), dataProcessorInfos.end(),
2965+
[&name = dp.name, &exec = currentWorkflow.executable](DataProcessorInfo const& info) { return (info.name == name && info.executable != exec); });
2966+
if (found == physicalWorkflow.end() || duplicate_name != dataProcessorInfos.end()) {
29632967
physicalWorkflow.push_back(dp);
29642968
rankIndex.insert(std::make_pair(dp.name, workflowHashB));
29652969
}

0 commit comments

Comments
 (0)