Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash in ECAL local reco on GPU if ECAL is not in the run #34292

Merged
merged 1 commit into from Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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