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 PF Clustering due to empty HCAL RecHits collection #44693

Merged
merged 3 commits into from
Apr 11, 2024

Conversation

jsamudio
Copy link
Contributor

PR description:

This fix addresses #44668 where Alpaka-based PF Clustering was crashing at HLT when HCAL is off. The reason was due to the input HCAL RecHit number being used to specify the work division for kernels, and it was not protected against a case of requesting 0 blocks when there are no RecHits.

Included now are checks on the number of rechits and the SoA size to only launch the Alpaka kernels if they are non-zero.

PR validation:

In 14_1_0_pre2, tested on matrix workflows 12434.422, 12434.424. The missing HCAL validation for HLT is done in the backport.

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 10, 2024

cms-bot internal usage

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-44693/39900

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-44693/39901

@mmusich
Copy link
Contributor

mmusich commented Apr 10, 2024

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @jsamudio for master.

It involves the following packages:

  • RecoParticleFlow/PFClusterProducer (reconstruction)
  • RecoParticleFlow/PFRecHitProducer (reconstruction)

@mandrenguyen, @jfernan2 can you please review it and eventually sign? Thanks.
@hatakeyamak, @lgray, @mmarionncern, @felicepantaleo, @seemasharmafnal, @rovere, @sameasy, @missirol this is something you requested to watch as well.
@sextonkennedy, @rappoccio, @antoniovilela you are the release manager for this.

cms-bot commands are listed here

@mmusich
Copy link
Contributor

mmusich commented Apr 10, 2024

type pf

@cmsbuild cmsbuild added the pf label Apr 10, 2024
for (const auto& token : recHitsToken_)
kernel.processRecHits(event.queue(), event.get(token.first), setup.getData(token.second), topology, pfRecHits);
kernel.associateTopologyInfo(event.queue(), topology, pfRecHits);
if (pfRecHits->metadata().size() != 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (pfRecHits->metadata().size() != 0) {
if (num_recHits != 0) {

?

Comment on lines 56 to 62
reco::PFRecHitCollection out;
out.reserve(alpakaPfRecHits.size());
int reserveSize = 0;
if (alpakaPfRecHits.metadata().size() != 0)
reserveSize = alpakaPfRecHits.size();
out.reserve(reserveSize);

for (size_t i = 0; i < alpakaPfRecHits.size(); i++) {
reco::PFRecHit& pfrh =
out.emplace_back(caloGeo_.at(alpakaPfRecHits[i].layer())->getGeometry(alpakaPfRecHits[i].detId()),
alpakaPfRecHits[i].detId(),
alpakaPfRecHits[i].layer(),
alpakaPfRecHits[i].energy());
pfrh.setTime(alpakaPfRecHits[i].time());
pfrh.setDepth(alpakaPfRecHits[i].depth());
if (alpakaPfRecHits.metadata().size() != 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this could be more simply

reco::PFRecHitCollection out;

if (alpakaPfRecHits.metadata().size() != 0) {
  out.reserve(alpakaPfRecHits.size());
  for (size_t i = 0; i < alpakaPfRecHits.size(); i++) {
    ...

@fwyzard
Copy link
Contributor

fwyzard commented Apr 10, 2024

assign heterogeneous

@fwyzard
Copy link
Contributor

fwyzard commented Apr 10, 2024

+heterogeneous

@fwyzard
Copy link
Contributor

fwyzard commented Apr 10, 2024

just to say that the changes look good to me

@fwyzard
Copy link
Contributor

fwyzard commented Apr 10, 2024

please test

@cmsbuild
Copy link
Contributor

New categories assigned: heterogeneous

@fwyzard,@makortel you have been requested to review this Pull request/Issue and eventually sign? Thanks

@fwyzard
Copy link
Contributor

fwyzard commented Apr 10, 2024

to see if the DAS errors are only transient

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-1e1055/38756/summary.html
COMMIT: 0398bdc
CMSSW: CMSSW_14_1_X_2024-04-10-1100/el8_amd64_gcc12
Additional Tests: GPU
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/44693/38756/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially removed 4 lines from the logs
  • Reco comparison results: 44 differences found in the comparisons
  • DQMHistoTests: Total files compared: 48
  • DQMHistoTests: Total histograms compared: 3316263
  • DQMHistoTests: Total failures: 3
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3316240
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 47 files compared)
  • Checked 202 log files, 165 edm output root files, 48 DQM output files
  • TriggerResults: no differences found

GPU Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 104 differences found in the comparisons
  • DQMHistoTests: Total files compared: 6
  • DQMHistoTests: Total histograms compared: 161166
  • DQMHistoTests: Total failures: 681
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 160485
  • DQMHistoTests: Total skipped: 0
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 5 files compared)
  • Checked 23 log files, 30 edm output root files, 6 DQM output files
  • TriggerResults: no differences found

@mandrenguyen
Copy link
Contributor

+reconstruction
Bug fix to prevent crashing on empty rechit collection.
No change to reco comparisons, as expected.

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @sextonkennedy, @rappoccio, @antoniovilela (and backports should be raised in the release meeting by the corresponding L2)

@antoniovilela
Copy link
Contributor

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants