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

Update FitWithRooFit in Alignment/OfflineValidation to fix memory leaks #42900

Merged
merged 1 commit into from
Oct 4, 2023
Merged

Update FitWithRooFit in Alignment/OfflineValidation to fix memory leaks #42900

merged 1 commit into from
Oct 4, 2023

Conversation

guitargeek
Copy link
Contributor

PR description:

  • Avoid memory leak of RooDataHist by wrapping it in unique_ptr

  • Avoid memory leaks of RooRealVars also by wrapping in unique_ptr

  • Avoid leaking RooAbsPdf models also with unique_ptr

  • Avoid memory leak of model components by passing ownership to the top-level pdf via RooAbsArg::addOwnedComponents()

  • Use double instead of const double& for function parameters

  • Avoid a leaking fit result because of the Save() command argument to fitTo() (if one uses Save(), the fitting routine returns a RooFitResult * that needs to be deleted)

PR validation:

I could do no validation of this refactoring and memory leak fixing work. It should not change any code behavior, but it would be nice if an alignment expert could validate it.

If this PR is a backport please specify the original PR and why you need to backport that PR. If this PR will be backported please specify to which release cycle the backport is meant for:

No backport intended.

  * Avoid memory leak of RooDataHist by wrapping it in `unique_ptr`

  * Avoid memory leaks of RooRealVars also by wrapping in `unique_ptr`

  * Avoid leaking RooAbsPdf models also with `unique_ptr`

  * Avoid memory leak of model components by passing ownership to the top-level pdf via
    `RooAbsArg::addOwnedComponents()`

  * Use `double` instead of `const double&` for function parameters

  * Avoid a leaking fit result because of the `Save()` command argument to `fitTo()`
    (if one uses `Save()`, the fitting routine returns a `RooFitResult *`
    that needs to be deleted)
@cmsbuild cmsbuild added this to the CMSSW_13_3_X milestone Sep 28, 2023
@guitargeek guitargeek changed the title Update FitWithRooFit in Alignment/OfflineValidation Update FitWithRooFit in Alignment/OfflineValidation to fix memory leaks Sep 28, 2023
@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-42900/37047

  • This PR adds an extra 16KB to repository

  • There are other open Pull requests which might conflict with changes you have proposed:

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @guitargeek (Jonas Rembser) for master.

It involves the following packages:

  • Alignment/OfflineValidation (alca)

@consuegs, @saumyaphor4252, @cmsbuild, @perrotta can you please review it and eventually sign? Thanks.
@tocheng, @tlampen, @mmusich, @adewit 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

@perrotta
Copy link
Contributor

please test

@mmusich
Copy link
Contributor

mmusich commented Sep 28, 2023

but it would be nice if an alignment expert could validate it

I checked this with the (limited) testing capability of the unit tests in DQMOffline/Alignment

cmsRun ${SCRAM_TEST_PATH}/DiMuonTkAlDQMValidator_cfg.py resonance=Z || die "Failure using DiMuonTkAlDQMValidator_cfg.py resonance=Z" $?
cmsRun ${SCRAM_TEST_PATH}/DiMuonTkAlDQMHarvester_cfg.py resonance=Z || die "Failure using DiMuonTkAlDQMHarvester_cfg.py resonance=Z" $?

I put the results here. I don't see anomalies.

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-8e42f5/34966/summary.html
COMMIT: c3476eb
CMSSW: CMSSW_13_3_X_2023-09-28-1100/el8_amd64_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/42900/34966/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially removed 1 lines from the logs
  • Reco comparison results: 8 differences found in the comparisons
  • DQMHistoTests: Total files compared: 50
  • DQMHistoTests: Total histograms compared: 3358320
  • DQMHistoTests: Total failures: 6
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3358292
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 49 files compared)
  • Checked 214 log files, 167 edm output root files, 50 DQM output files
  • TriggerResults: no differences found

@perrotta
Copy link
Contributor

perrotta commented Oct 3, 2023

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 3, 2023

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. @antoniovilela, @sextonkennedy, @rappoccio (and backports should be raised in the release meeting by the corresponding L2)

@antoniovilela
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit fa05789 into cms-sw:master Oct 4, 2023
@guitargeek guitargeek deleted the fit_with_roofit branch October 4, 2023 10:37
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