Skip to content

Commit

Permalink
Merge pull request #34292 from thomreis/ecal_localreco_gpu_nofeds_fix
Browse files Browse the repository at this point in the history
Fix crash in ECAL local reco on GPU if ECAL is not in the run
  • Loading branch information
cmsbuild committed Jul 1, 2021
2 parents c8162b3 + 07a68aa commit ae5a5be
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
7 changes: 5 additions & 2 deletions EventFilter/EcalRawToDigi/plugins/EcalRawToDigiGPU.cc
Expand Up @@ -134,8 +134,11 @@ void EcalRawToDigiGPU::acquire(edm::Event const& event,
++counter;
}

ecal::raw::entryPoint(
inputCPU, inputGPU, outputGPU_, scratchGPU, outputCPU_, conditions, ctx.stream(), counter, currentCummOffset);
// unpack if at least one FED has data
if (counter > 0) {
ecal::raw::entryPoint(
inputCPU, inputGPU, outputGPU_, scratchGPU, outputCPU_, conditions, ctx.stream(), counter, currentCummOffset);
}
}

void EcalRawToDigiGPU::produce(edm::Event& event, edm::EventSetup const& setup) {
Expand Down
Expand Up @@ -164,6 +164,10 @@ void EcalRecHitProducerGPU::acquire(edm::Event const& event,
neb_ = ebUncalibRecHits.size;
nee_ = eeUncalibRecHits.size;

// stop here if there are no uncalibRecHits
if (neb_ + nee_ == 0)
return;

if ((neb_ > configParameters_.maxNumberHitsEB) || (nee_ > configParameters_.maxNumberHitsEE)) {
edm::LogError("EcalRecHitProducerGPU")
<< "max number of channels exceeded. See options 'maxNumberHitsEB and maxNumberHitsEE' ";
Expand Down
Expand Up @@ -207,6 +207,10 @@ void EcalUncalibRecHitProducerGPU::acquire(edm::Event const& event,
neb_ = ebDigis.size;
nee_ = eeDigis.size;

// stop here if there are no digis
if (neb_ + nee_ == 0)
return;

if ((neb_ > configParameters_.maxNumberHitsEB) || (nee_ > configParameters_.maxNumberHitsEE)) {
edm::LogError("EcalUncalibRecHitProducerGPU")
<< "max number of channels exceeded. See options 'maxNumberHitsEB and maxNumberHitsEE' ";
Expand Down

0 comments on commit ae5a5be

Please sign in to comment.