From d91fc4c3306f269a9fe892a6febce2fcf2e12782 Mon Sep 17 00:00:00 2001 From: Thomas Reis Date: Wed, 4 Aug 2021 15:11:50 +0200 Subject: [PATCH 1/2] Fix crash of ECAL GPU reco when ECAL is out of the run. --- EventFilter/EcalRawToDigi/plugins/EcalRawToDigiGPU.cc | 4 ++++ .../EcalRecProducers/plugins/EcalUncalibRecHitProducerGPU.cc | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/EventFilter/EcalRawToDigi/plugins/EcalRawToDigiGPU.cc b/EventFilter/EcalRawToDigi/plugins/EcalRawToDigiGPU.cc index 4dcb1bd0e26e1..b8cca380499d8 100644 --- a/EventFilter/EcalRawToDigi/plugins/EcalRawToDigiGPU.cc +++ b/EventFilter/EcalRawToDigi/plugins/EcalRawToDigiGPU.cc @@ -138,6 +138,10 @@ void EcalRawToDigiGPU::acquire(edm::Event const& event, if (counter > 0) { ecal::raw::entryPoint( inputCPU, inputGPU, outputGPU_, scratchGPU, outputCPU_, conditions, ctx.stream(), counter, currentCummOffset); + } else { + // reset the number of channels + outputCPU_.nchannels[0] = 0; + outputCPU_.nchannels[1] = 0; } } diff --git a/RecoLocalCalo/EcalRecProducers/plugins/EcalUncalibRecHitProducerGPU.cc b/RecoLocalCalo/EcalRecProducers/plugins/EcalUncalibRecHitProducerGPU.cc index c87ea1082b673..9f0c35cfcdc41 100644 --- a/RecoLocalCalo/EcalRecProducers/plugins/EcalUncalibRecHitProducerGPU.cc +++ b/RecoLocalCalo/EcalRecProducers/plugins/EcalUncalibRecHitProducerGPU.cc @@ -213,7 +213,9 @@ void EcalUncalibRecHitProducerGPU::acquire(edm::Event const& event, if ((neb_ > configParameters_.maxNumberHitsEB) || (nee_ > configParameters_.maxNumberHitsEE)) { edm::LogError("EcalUncalibRecHitProducerGPU") - << "max number of channels exceeded. See options 'maxNumberHitsEB and maxNumberHitsEE' "; + << "Max number of channels exceeded in barrel or endcap. Number of barrel channels: " << neb_ + << " with maxNumberHitsEB=" << configParameters_.maxNumberHitsEB << ", number of endcap channels: " << nee_ + << " with maxNumberHitsEE=" << configParameters_.maxNumberHitsEE; } // conditions From 2245ffbff61c3303ca9d3f8e7ef7acd479398857 Mon Sep 17 00:00:00 2001 From: Thomas Reis Date: Wed, 4 Aug 2021 16:08:16 +0200 Subject: [PATCH 2/2] Initialize the number of channels unconditionally. --- EventFilter/EcalRawToDigi/plugins/EcalRawToDigiGPU.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/EventFilter/EcalRawToDigi/plugins/EcalRawToDigiGPU.cc b/EventFilter/EcalRawToDigi/plugins/EcalRawToDigiGPU.cc index b8cca380499d8..75fa5e1656eb9 100644 --- a/EventFilter/EcalRawToDigi/plugins/EcalRawToDigiGPU.cc +++ b/EventFilter/EcalRawToDigi/plugins/EcalRawToDigiGPU.cc @@ -103,6 +103,9 @@ void EcalRawToDigiGPU::acquire(edm::Event const& event, // output cpu outputCPU_ = {cms::cuda::make_host_unique(2, ctx.stream())}; + // initialize the number of channels + outputCPU_.nchannels[0] = 0; + outputCPU_.nchannels[1] = 0; // output gpu outputGPU_.allocate(config_, ctx.stream()); @@ -138,10 +141,6 @@ void EcalRawToDigiGPU::acquire(edm::Event const& event, if (counter > 0) { ecal::raw::entryPoint( inputCPU, inputGPU, outputGPU_, scratchGPU, outputCPU_, conditions, ctx.stream(), counter, currentCummOffset); - } else { - // reset the number of channels - outputCPU_.nchannels[0] = 0; - outputCPU_.nchannels[1] = 0; } }