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

[14_1_X] Fix memory leak in GenParticles2HepMCConverter #46254

Merged

Conversation

hqucms
Copy link
Contributor

@hqucms hqucms commented Oct 4, 2024

PR description:

Backport of #46203.

PR description:

When checking the NANO matrix tests I noticed some MC workflows show very high memory usage (~6GB). This was tracked down to a memory leak due to undeleted raw pointer in GenParticles2HepMCConverter. This PR fixes that by switching to unique_ptr.

PR validation:

Tested with NANO matrix test and see much lower and stable memory usage after the fix.

@hqucms
Copy link
Contributor Author

hqucms commented Oct 4, 2024

enable nano

@hqucms
Copy link
Contributor Author

hqucms commented Oct 4, 2024

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 4, 2024

A new Pull Request was created by @hqucms for CMSSW_14_1_X.

It involves the following packages:

  • GeneratorInterface/RivetInterface (generators)

@bbilin, @lviliani, @menglu21, @mkirsano can you please review it and eventually sign? Thanks.
@alberto-sanchez, @mkirsano this is something you requested to watch as well.
@antoniovilela, @mandrenguyen, @rappoccio, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 4, 2024

cms-bot internal usage

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 4, 2024

+1

Size: This PR adds an extra 16KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-c8b189/41966/summary.html
COMMIT: 8123f05
CMSSW: CMSSW_14_1_X_2024-10-04-1100/el8_amd64_gcc12
Additional Tests: NANO
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/46254/41966/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

NANO Comparison Summary

Summary:

  • You potentially added 1618 lines to the logs
  • ROOTFileChecks: Some differences in event products or their sizes found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 21
  • DQMHistoTests: Total histograms compared: 54921
  • DQMHistoTests: Total failures: 0
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 54921
  • DQMHistoTests: Total skipped: 0
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 20 files compared)
  • Checked 102 log files, 58 edm output root files, 21 DQM output files
  • TriggerResults: no differences found

Nano size comparison Summary:

Sample kb/ev ref kb/ev diff kb/ev ev/s/thd ref ev/s/thd diff rate mem/thd ref mem/thd
2500.001 2.788 2.788 0.000 ( +0.0% ) 3.34 3.29 +1.4% 2.299 6.672
2500.002 2.901 2.901 0.000 ( +0.0% ) 2.97 2.93 +1.5% 2.737 7.025
2500.003 2.848 2.848 0.000 ( +0.0% ) 3.09 3.05 +1.4% 2.721 6.979
2500.011 1.450 1.450 0.000 ( +0.0% ) 5.75 5.62 +2.4% 2.407 2.408
2500.012 1.909 1.909 0.000 ( +0.0% ) 3.13 3.10 +0.9% 2.594 2.598
2500.013 1.765 1.765 0.000 ( +0.0% ) 4.55 4.47 +1.6% 2.506 2.499
2500.021 0.022 0.022 0.000 ( +0.0% ) 0.97 0.95 +1.9% 2.376 2.373
2500.022 0.022 0.022 0.000 ( +0.0% ) 0.92 0.91 +0.7% 2.368 2.373
2500.023 0.022 0.022 0.000 ( +0.0% ) 0.93 0.90 +3.0% 2.249 2.244
2500.024 0.022 0.022 0.000 ( +0.0% ) 0.70 0.68 +3.4% 2.472 2.468
2500.031 0.035 0.035 0.000 ( +0.0% ) 0.88 0.85 +4.5% 2.437 2.436
2500.032 0.036 0.036 0.000 ( +0.0% ) 0.90 0.88 +2.8% 2.407 2.396
2500.033 0.037 0.037 0.000 ( +0.0% ) 0.81 0.78 +3.6% 2.485 2.481
2500.034 0.036 0.036 0.000 ( +0.0% ) 0.82 0.79 +3.2% 2.465 2.460
2500.101 2.649 2.649 0.000 ( +0.0% ) 8.89 8.60 +3.3% 2.492 6.944
2500.111 1.339 1.339 0.000 ( +0.0% ) 19.97 19.61 +1.8% 2.218 2.216
2500.112 1.745 1.745 0.000 ( +0.0% ) 15.63 15.39 +1.6% 2.301 2.305
2500.131 0.747 0.747 0.000 ( +0.0% ) 18.37 17.41 +5.5% 1.497 1.507
2500.201 2.478 2.478 0.000 ( +0.0% ) 7.66 7.48 +2.5% 2.061 6.218
2500.211 1.592 1.592 0.000 ( +0.0% ) 17.97 17.32 +3.8% 2.265 2.265
2500.212 2.033 2.033 0.000 ( +0.0% ) 14.54 13.71 +6.0% 2.349 2.354
2500.221 2.006 2.006 0.000 ( +0.0% ) 7.80 7.52 +3.8% 1.989 2.437
2500.222 3.072 3.072 0.000 ( +0.0% ) 7.66 7.21 +6.3% 2.070 2.521
2500.223 8.888 8.888 0.000 ( +0.0% ) 2.83 2.72 +4.0% 2.093 2.544
2500.224 5.515 5.515 0.000 ( +0.0% ) 1.10 1.07 +3.3% 2.128 2.578
2500.225 5.533 5.533 0.000 ( +0.0% ) 1.02 0.99 +3.4% 2.150 2.605
2500.226 2.973 2.973 0.000 ( +0.0% ) 7.68 7.28 +5.5% 2.067 2.521
2500.227 1.437 1.437 0.000 ( +0.0% ) 11.94 11.48 +4.0% 1.424 1.433
2500.231 1.407 1.407 0.000 ( +0.0% ) 14.13 13.53 +4.5% 2.166 2.165
2500.232 2.145 2.145 0.000 ( +0.0% ) 14.25 13.47 +5.8% 2.266 2.262
2500.233 4.670 4.670 0.000 ( +0.0% ) 4.96 4.75 +4.5% 2.278 2.274
2500.234 3.307 3.307 0.000 ( +0.0% ) 1.51 1.46 +3.3% 2.295 2.290
2500.235 3.317 3.317 0.000 ( +0.0% ) 1.40 1.36 +3.0% 2.321 2.317
2500.236 2.085 2.085 0.000 ( +0.0% ) 13.91 13.60 +2.2% 2.252 2.259
2500.237 1.016 1.016 0.000 ( +0.0% ) 16.89 15.35 +10.0% 1.469 1.476
2500.241 9.404 9.404 0.000 ( +0.0% ) 3.63 3.52 +3.1% 1.942 1.941
2500.242 10.331 10.331 0.000 ( +0.0% ) 0.88 0.84 +5.2% 1.729 1.724
2500.243 2.712 2.712 0.000 ( +0.0% ) 8.78 8.36 +4.9% 1.062 1.065
2500.244 485.976 485.976 0.000 ( +0.0% ) 0.58 0.54 +6.0% 1.676 1.676
2500.245 823.202 823.202 0.000 ( +0.0% ) 0.75 0.72 +3.5% 1.661 1.670
2500.901 1.749 1.749 0.000 ( +0.0% ) 21.29 20.33 +4.7% 1.406 1.830
2500.902 1.598 1.598 0.000 ( +0.0% ) 20.98 19.39 +8.2% 1.310 1.760
2500.911 13.931 13.931 0.000 ( +0.0% ) 2.48 2.48 -0.0% 1.070 1.078
2500.912 0.171 0.240 -0.069 ( -28.7% ) 0.93 1.22 -24.1% 0.970 0.969
2500.913 0.110 0.110 0.000 ( +0.0% ) 1.12 1.18 -5.3% 0.971 0.969

@hqucms hqucms force-pushed the pr/fix-mem-leak-hepmc-converter-14_1_X branch from 8123f05 to 59538a3 Compare October 14, 2024 19:14
@cmsbuild
Copy link
Contributor

Pull request #46254 was updated. @bbilin, @cmsbuild, @lviliani, @menglu21, @mkirsano can you please check and sign again.

@hqucms
Copy link
Contributor Author

hqucms commented Oct 14, 2024

please test

@hqucms
Copy link
Contributor Author

hqucms commented Oct 14, 2024

assign xpog

@cmsbuild
Copy link
Contributor

New categories assigned: xpog

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

@cmsbuild
Copy link
Contributor

+1

Size: This PR adds an extra 20KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-c8b189/42177/summary.html
COMMIT: 59538a3
CMSSW: CMSSW_14_1_X_2024-10-14-1100/el8_amd64_gcc12
Additional Tests: NANO
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/46254/42177/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

NANO Comparison Summary

Summary:

  • You potentially added 869 lines to the logs
  • ROOTFileChecks: Some differences in event products or their sizes found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 21
  • DQMHistoTests: Total histograms compared: 54921
  • DQMHistoTests: Total failures: 0
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 54921
  • DQMHistoTests: Total skipped: 0
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 20 files compared)
  • Checked 102 log files, 58 edm output root files, 21 DQM output files
  • TriggerResults: no differences found

Nano size comparison Summary:

Sample kb/ev ref kb/ev diff kb/ev ev/s/thd ref ev/s/thd diff rate mem/thd ref mem/thd
2500.001 2.788 2.788 0.000 ( +0.0% ) 3.37 3.31 +2.0% 2.310 6.038
2500.002 2.901 2.901 0.000 ( +0.0% ) 3.01 2.95 +2.2% 2.744 6.413
2500.003 2.848 2.848 0.000 ( +0.0% ) 3.11 3.06 +1.7% 2.732 6.362
2500.011 1.450 1.450 0.000 ( +0.0% ) 5.79 5.66 +2.2% 2.409 2.420
2500.012 1.909 1.909 0.000 ( +0.0% ) 3.16 3.12 +1.3% 2.603 2.594
2500.013 1.765 1.765 0.000 ( +0.0% ) 4.61 4.53 +1.8% 2.504 2.503
2500.021 0.022 0.022 0.000 ( +0.0% ) 1.02 0.98 +3.4% 2.387 2.382
2500.022 0.022 0.022 0.000 ( +0.0% ) 0.96 0.93 +3.2% 2.374 2.377
2500.023 0.022 0.022 0.000 ( +0.0% ) 0.95 0.94 +1.0% 2.250 2.243
2500.024 0.022 0.022 0.000 ( +0.0% ) 0.73 0.71 +3.4% 2.476 2.469
2500.031 0.035 0.035 0.000 ( +0.0% ) 0.91 0.88 +3.8% 2.441 2.430
2500.032 0.036 0.036 0.000 ( +0.0% ) 0.92 0.90 +2.2% 2.400 2.404
2500.033 0.037 0.037 0.000 ( +0.0% ) 0.82 0.79 +3.8% 2.496 2.486
2500.034 0.036 0.036 0.000 ( +0.0% ) 0.84 0.82 +2.7% 2.467 2.470
2500.101 2.649 2.649 0.000 ( +0.0% ) 9.10 8.81 +3.3% 2.495 6.943
2500.111 1.339 1.339 0.000 ( +0.0% ) 20.60 19.78 +4.2% 2.195 2.199
2500.112 1.745 1.745 0.000 ( +0.0% ) 16.41 14.19 +15.6% 2.280 2.282
2500.131 0.747 0.747 0.000 ( +0.0% ) 18.74 18.08 +3.7% 1.500 1.509
2500.201 2.478 2.478 0.000 ( +0.0% ) 7.81 7.46 +4.7% 2.063 6.227
2500.211 1.592 1.592 0.000 ( +0.0% ) 18.58 17.73 +4.8% 2.263 2.266
2500.212 2.033 2.033 0.000 ( +0.0% ) 14.62 13.96 +4.8% 2.359 2.351
2500.221 2.006 2.006 0.000 ( +0.0% ) 7.90 7.72 +2.3% 1.978 2.435
2500.222 3.072 3.072 0.000 ( +0.0% ) 7.77 7.56 +2.7% 2.071 2.526
2500.223 8.888 8.888 0.000 ( +0.0% ) 2.86 2.78 +2.9% 2.093 2.548
2500.224 5.515 5.515 0.000 ( +0.0% ) 1.11 1.09 +1.9% 2.091 2.579
2500.225 5.533 5.533 0.000 ( +0.0% ) 1.04 1.01 +2.7% 2.104 2.611
2500.226 2.973 2.973 0.000 ( +0.0% ) 7.58 7.36 +3.0% 2.066 2.522
2500.227 1.437 1.437 0.000 ( +0.0% ) 12.07 11.68 +3.3% 1.432 1.420
2500.231 1.407 1.407 0.000 ( +0.0% ) 14.02 14.05 -0.2% 2.170 2.171
2500.232 2.145 2.145 0.000 ( +0.0% ) 14.62 14.03 +4.2% 2.265 2.250
2500.233 4.670 4.670 0.000 ( +0.0% ) 4.99 4.89 +2.0% 2.282 2.281
2500.234 3.307 3.307 0.000 ( +0.0% ) 1.54 1.48 +3.7% 2.062 2.298
2500.235 3.317 3.317 0.000 ( +0.0% ) 1.43 1.40 +2.1% 2.078 2.319
2500.236 2.085 2.085 0.000 ( +0.0% ) 14.45 13.88 +4.1% 2.262 2.255
2500.237 1.016 1.016 0.000 ( +0.0% ) 17.57 17.23 +1.9% 1.408 1.467
2500.241 9.404 9.404 0.000 ( +0.0% ) 3.77 3.62 +4.0% 1.921 1.918
2500.242 10.331 10.331 0.000 ( +0.0% ) 0.90 0.88 +2.0% 1.699 1.699
2500.243 2.712 2.712 0.000 ( +0.0% ) 8.69 7.96 +9.2% 1.066 1.066
2500.244 485.976 485.976 0.000 ( +0.0% ) 0.57 0.56 +3.0% 1.676 1.674
2500.245 823.202 823.202 0.000 ( +0.0% ) 0.76 0.73 +3.7% 1.654 1.668
2500.901 1.749 1.749 0.000 ( +0.0% ) 21.88 21.41 +2.2% 1.403 1.834
2500.902 1.598 1.598 0.000 ( +0.0% ) 21.98 19.93 +10.3% 1.313 1.759
2500.911 13.931 13.931 0.000 ( +0.0% ) 3.06 2.01 +52.6% 1.070 1.078
2500.912 0.240 0.199 0.041 ( +20.3% ) 1.17 1.64 -28.7% 0.969 0.967
2500.913 0.110 0.110 0.000 ( +0.0% ) 1.19 1.16 +2.6% 0.969 0.971

@hqucms
Copy link
Contributor Author

hqucms commented Oct 15, 2024

+1

@hqucms
Copy link
Contributor Author

hqucms commented Oct 17, 2024

ping @cms-sw/generators-l2

@hqucms
Copy link
Contributor Author

hqucms commented Oct 17, 2024

type bugfix

@bbilin
Copy link
Contributor

bbilin commented Oct 23, 2024

+1

@cmsbuild
Copy link
Contributor

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

@antoniovilela
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 973f3c8 into cms-sw:CMSSW_14_1_X Nov 12, 2024
11 checks passed
@hqucms hqucms deleted the pr/fix-mem-leak-hepmc-converter-14_1_X branch December 17, 2024 07:27
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.

5 participants