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

Change to global module in L1Trigger/L1TGEM #43649

Merged
merged 1 commit into from
Jan 12, 2024

Conversation

Dr15Jones
Copy link
Contributor

PR description:

  • changed to global modules
  • removed need to call Run transition
  • reworked member functions to use 'return value optimization'

PR validation:

Code compiles.

- changed to global modules
- removed need to call Run transition
- reworked member functions to use 'return value optimization'
@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 3, 2024

cms-bot internal usage

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 3, 2024

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43649/38308

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 3, 2024

A new Pull Request was created by @Dr15Jones (Chris Jones) for master.

It involves the following packages:

  • L1Trigger/L1TGEM (l1)

@epalencia, @aloeliger, @cmsbuild can you please review it and eventually sign? Thanks.
@missirol, @JanFSchulte, @Martin-Grunewald this is something you requested to watch as well.
@rappoccio, @sextonkennedy, @antoniovilela you are the release manager for this.

cms-bot commands are listed here

@Dr15Jones
Copy link
Contributor Author

@makortel FYI

@Dr15Jones
Copy link
Contributor Author

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 4, 2024

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-72ad38/36708/summary.html
COMMIT: 5275e27
CMSSW: CMSSW_14_0_X_2024-01-04-1100/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/43649/36708/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

@aloeliger
Copy link
Contributor

Not to slow everything down, but this seems a bit more in depth than the usual technical changes. If only for my edification could I get a quick explanation on what happened here?

@Dr15Jones
Copy link
Contributor Author

If only for my edification could I get a quick explanation on what happened here?

Sometimes while doing these technical changes I come across some code that could use some 'more lovin' :). I had started by removing the member data that was just caching a EventSetup data product and moved the call to produce. This allowed beginRun to be removed. After that, I noticed that all the remaining member data were immutable so I could easily change the module to be a edm::global. (edm::global are preferred over edm::stream modules as only one instance of a edm::global is needed in a job while we must make a copy of each edm::stream per Stream in the job). After the edm::global change, I figured I could also use the new edm::Event::emplace syntax which avoids creating a temporary on the heap for the edm::Event::put call and instead use a stack temporary (less heap churn that way). I did that by changing the member function from having its results value be passed via mutable function argument (which is no longer considered a good solution by the C++ community at large) to have it be the return value of the function. (Modern C++ requires that the compiler now handle returning objects from function using an optimized mechanism).

@aloeliger
Copy link
Contributor

If only for my edification could I get a quick explanation on what happened here?

Sometimes while doing these technical changes I come across some code that could use some 'more lovin' :). I had started by removing the member data that was just caching a EventSetup data product and moved the call to produce. This allowed beginRun to be removed. After that, I noticed that all the remaining member data were immutable so I could easily change the module to be a edm::global. (edm::global are preferred over edm::stream modules as only one instance of a edm::global is needed in a job while we must make a copy of each edm::stream per Stream in the job). After the edm::global change, I figured I could also use the new edm::Event::emplace syntax which avoids creating a temporary on the heap for the edm::Event::put call and instead use a stack temporary (less heap churn that way). I did that by changing the member function from having its results value be passed via mutable function argument (which is no longer considered a good solution by the C++ community at large) to have it be the return value of the function. (Modern C++ requires that the compiler now handle returning objects from function using an optimized mechanism).

Okay, thanks for the explanation, especially for what was happening to buildClusters and selectClusters which caught my eye in the first place.

@aloeliger
Copy link
Contributor

+l1

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 5, 2024

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

@rappoccio
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.

4 participants