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 Walloc-size-larger-than warnings in SimG4CMS/Forward/*NumberingScheme #41942

Closed

Conversation

iarspider
Copy link
Contributor

PR description:

Fix warnings reported here: #41795 . The changes are similar to what was done in #41826 .

PR validation:

No special validation

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-41942/35903

  • This PR adds an extra 16KB to repository

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-41942/35904

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

  • SimG4CMS/Forward (simulation)

@cmsbuild, @civanch, @mdhildreth can you please review it and eventually sign? Thanks.
@bsunanda, @rovere, @fabiocos, @slomeo this is something you requested to watch as well.
@perrotta, @dpiparo, @rappoccio you are the release manager for this.

cms-bot commands are listed here

@iarspider
Copy link
Contributor Author

please test for el8_amd64_gcc12

@iarspider
Copy link
Contributor Author

please test

@iarspider
Copy link
Contributor Author

please test for CMSSW_13_2_DBG_X

just in case - some code changes are conditionally compiled only in DBG_X

@iarspider
Copy link
Contributor Author

please test for el8_amd64_gcc12

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-f710c1/33122/summary.html
COMMIT: 3c866ea
CMSSW: CMSSW_13_2_X_2023-06-13-1100/el8_amd64_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/41942/33122/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially removed 2 lines from the logs
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 48
  • DQMHistoTests: Total histograms compared: 3190910
  • DQMHistoTests: Total failures: 0
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3190888
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 47 files compared)
  • Checked 207 log files, 159 edm output root files, 48 DQM output files
  • TriggerResults: no differences found

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-f710c1/33124/summary.html
COMMIT: 3c866ea
CMSSW: CMSSW_13_2_X_2023-06-12-2300/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/41942/33124/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 6071 lines to the logs
  • Reco comparison results: 16068 differences found in the comparisons
  • DQMHistoTests: Total files compared: 48
  • DQMHistoTests: Total histograms compared: 3190910
  • DQMHistoTests: Total failures: 40312
  • DQMHistoTests: Total nulls: 1
  • DQMHistoTests: Total successes: 3150575
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 47 files compared)
  • Checked 207 log files, 159 edm output root files, 48 DQM output files
  • TriggerResults: no differences found

@cmsbuild
Copy link
Contributor

-1

Failed Tests: RelVals
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-f710c1/33123/summary.html
COMMIT: 3c866ea
CMSSW: CMSSW_13_2_DBG_X_2023-06-08-2300/el8_amd64_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/41942/33123/install.sh to create a dev area with all the needed externals and cmssw changes.

The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic:

You can see more details here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-f710c1/33123/git-recent-commits.json
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-f710c1/33123/git-merge-result

RelVals

----- Begin Fatal Exception 14-Jun-2023 02:57:09 CEST-----------------------
An exception of category 'Invalid DetId' occurred while
   [0] Calling method for module HGCalBackendLayer1Producer/'l1tHGCalBackEndLayer1Producer'
   [1] Prefetching for EventSetup module HGCalTriggerGeometryESProducer/'l1tHGCalTriggerGeometryESProducer'
   [2] Calling method for EventSetup module HGCalGeometryESProducer/'HFNoseGeometryESProducer'
Exception Message:
Cannot initialize HGCSiliconDetId from 6c8bd800
----- End Fatal Exception -------------------------------------------------

@civanch
Copy link
Contributor

civanch commented Jun 14, 2023

@iarspider , I fully agree that making temporary C-arrays in these classes is not necessary, in general, this PR is valid. However, these classes are used by sub-detectors, which in normal tests are not involved, so validation of results should be done with enough statistics or in the new code you should have another proof that the result is not changed. In a standard WF you likely will not see anything. A safe approach would be to do exactly the same thing as before but without C-arrays.

detectorLevel(aStep, level, copyno, name);
//Find number of levels
const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
int level = (touch) ? ((touch->GetHistoryDepth()) + 1) : 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not think that touch can be undefined.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The check was there in the original code, I can drop it if you think it's safe.

delete[] copyno;
delete[] name;
LogDebug("BHMSim") << "BHMNumberingScheme number of levels= " << level;
if (level > 3) {
Copy link
Contributor

Choose a reason for hiding this comment

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

In previous implementation if(level>3) the fix depth is used not depended on level of 'level'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure what you mean. In previous implementation if level was less than or equal to 3, the arrays filled by ::detectorLevel were not used - unless the calls in that function had side-effects

for (int ich = 0; ich < level; ich++)
LogDebug("BscSim") << " name = " << name[ich] << " copy = " << copyno[ich];

for (int ich = 0; ich < level; ich++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why we need this loop? LogDebug may be moved inside previous loop after line 31

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do

<< " section " << section << " zside " << zside << " layer " << layer << " fiber "
<< fiber << " channel " << channel << "packedIndex =" << intindex
<< " detId raw: " << std::hex << index << std::dec;
for (int ich = 0; ich < level; ich++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This loop is also not needed, LogVerbatim may be moved after the line 45

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do

@iarspider
Copy link
Contributor Author

@iarspider , I fully agree that making temporary C-arrays in these classes is not necessary, in general, this PR is valid. However, these classes are used by sub-detectors, which in normal tests are not involved, so validation of results should be done with enough statistics or in the new code you should have another proof that the result is not changed. In a standard WF you likely will not see anything. A safe approach would be to do exactly the same thing as before but without C-arrays.

@civanch correct me if I'm wrong, but these classes are mostly just packing and unpacking integers. Or the tricky part is to somehow make sure aStep->GetPreStepPoint()->GetTouchable(); iterates over all parts?

@civanch
Copy link
Contributor

civanch commented Jun 15, 2023

@iarspider , any hit should have a correct detector ID, which defined by numbering schema. It is critical in this PR to have exactly the same detID numbers as was before.

@civanch
Copy link
Contributor

civanch commented Jun 15, 2023

@iarspider , to me not clear why testing of this PR face problems while #41979 is working, let us close this.

@iarspider iarspider closed this Jun 16, 2023
@iarspider iarspider deleted the fix-simg4cms-warnings branch June 16, 2023 08:45
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.

3 participants