Skip to content

Commit 419b9db

Browse files
committed
simplifying the logic
1 parent eef5e2c commit 419b9db

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

Framework/Core/src/runDataProcessing.cxx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2957,13 +2957,10 @@ int doMain(int argc, char** argv, o2::framework::WorkflowSpec const& workflow,
29572957
// once from the actual definition in the child, a second time from the
29582958
// configuration they get passed by their parents.
29592959
for (auto& dp : importedWorkflow) {
2960-
auto found = std::find_if(physicalWorkflow.begin(), physicalWorkflow.end(),
2961-
[&name = dp.name](DataProcessorSpec const& spec) { return spec.name == name; });
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()) {
2960+
auto found = std::find_if(dataProcessorInfos.begin(), dataProcessorInfos.end(),
2961+
[&name = dp.name](DataProcessorInfo const& info) { return info.name == name; });
2962+
// also adding duplicate names from different executables to the workflow to trigger the exception in the MATERIALISE_WORKFLOW state in case of duplicate names
2963+
if (found == dataProcessorInfos.end() || (found != dataProcessorInfos.end() && (*found).executable != currentWorkflow.executable)) {
29672964
physicalWorkflow.push_back(dp);
29682965
rankIndex.insert(std::make_pair(dp.name, workflowHashB));
29692966
}

0 commit comments

Comments
 (0)