From 9b34ac3e2b782002da4b6c43aa74341d739d0262 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Fri, 26 Jan 2024 21:55:07 +0100 Subject: [PATCH] DPL: do not update the new run flag unless we do process data Data might be dropped by the oldest possible timeframe mechanism for the first timeslice which arrives, at which point we lose the information about the new run. Moving it down ensures that the check is done for the first timeframe which arrives. --- Framework/Core/src/DataProcessingDevice.cxx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Framework/Core/src/DataProcessingDevice.cxx b/Framework/Core/src/DataProcessingDevice.cxx index f5c9b7947afde..cb4598daa661f 100644 --- a/Framework/Core/src/DataProcessingDevice.cxx +++ b/Framework/Core/src/DataProcessingDevice.cxx @@ -2134,7 +2134,6 @@ bool DataProcessingDevice::tryDispatchComputation(ServiceRegistryRef ref, std::v // create messages) because the messages need to have the timeslice id into // it. auto prepareAllocatorForCurrentTimeSlice = [ref](TimesliceSlot i) -> void { - auto& dataProcessorContext = ref.get(); auto& relayer = ref.get(); auto& timingInfo = ref.get(); ZoneScopedN("DataProcessingDevice::prepareForCurrentTimeslice"); @@ -2145,6 +2144,12 @@ bool DataProcessingDevice::tryDispatchComputation(ServiceRegistryRef ref, std::v timingInfo.firstTForbit = relayer.getFirstTFOrbitForSlot(i); timingInfo.runNumber = relayer.getRunNumberForSlot(i); timingInfo.creation = relayer.getCreationTimeForSlot(i); + }; + auto updateRunInformation = [ref](TimesliceSlot i) -> void { + auto& dataProcessorContext = ref.get(); + auto& relayer = ref.get(); + auto& timingInfo = ref.get(); + auto timeslice = relayer.getTimesliceForSlot(i); timingInfo.globalRunNumberChanged = !TimingInfo::timesliceIsTimer(timeslice.value) && dataProcessorContext.lastRunNumberProcessed != timingInfo.runNumber; // A switch to runNumber=0 should not appear and thus does not set globalRunNumberChanged, unless it is seen in the first processed timeslice timingInfo.globalRunNumberChanged &= (dataProcessorContext.lastRunNumberProcessed == -1 || timingInfo.runNumber != 0); @@ -2277,9 +2282,14 @@ bool DataProcessingDevice::tryDispatchComputation(ServiceRegistryRef ref, std::v continue; } - prepareAllocatorForCurrentTimeSlice(TimesliceSlot{action.slot}); bool shouldConsume = action.op == CompletionPolicy::CompletionOp::Consume || action.op == CompletionPolicy::CompletionOp::Discard; + prepareAllocatorForCurrentTimeSlice(TimesliceSlot{action.slot}); + if (action.op != CompletionPolicy::CompletionOp::Discard && + action.op != CompletionPolicy::CompletionOp::Wait && + action.op != CompletionPolicy::CompletionOp::Retry) { + updateRunInformation(TimesliceSlot{action.slot}); + } InputSpan span = getInputSpan(action.slot, shouldConsume); auto& spec = ref.get(); InputRecord record{spec.inputs,