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 of ECAL GPU reco when ECAL is out of the run - 11_3_X #34768

Merged
merged 2 commits into from Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions EventFilter/EcalRawToDigi/plugins/EcalRawToDigiGPU.cc
Expand Up @@ -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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be cleaner to set these to 0 unconditionally, before calling (or not) ecal::raw::entryPoint.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be done as well but zeroing seems an unnecessary operation when ecal::raw::entryPoint is called.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is to make sure the variables are in a clean (initialised) state, independently of the future use.
Especially because they are only set in the subsequent call to produce(), and anybody looking at them inside ecal::raw::entryPoint (for example, to debug the next problem in a few weeks/months/years time) will likely be confused by seeing random values.

// reset the number of channels
outputCPU_.nchannels[0] = 0;
outputCPU_.nchannels[1] = 0;
}
}

Expand Down
Expand Up @@ -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
Expand Down