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

Migrate Geometry from setConsumes() to type-deducing consumes() #31289

Merged
merged 1 commit into from
Sep 3, 2020

Conversation

makortel
Copy link
Contributor

PR description:

To try out the simpler consumes from #31223.

PR validation:

Code compiles.

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-31289/18005

  • This PR adds an extra 20KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @makortel (Matti Kortelainen) for master.

It involves the following packages:

Geometry/CSCGeometryBuilder
Geometry/GEMGeometryBuilder
Geometry/MuonNumbering
Geometry/RPCGeometryBuilder
Geometry/TrackerGeometryBuilder

@civanch, @Dr15Jones, @makortel, @cvuosalo, @ianna, @mdhildreth, @cmsbuild, @kpedro88 can you please review it and eventually sign? Thanks.
@JanFSchulte, @watson-ij, @VinInn, @jshlee, @ptcox, @dildick, @ebrondol, @mtosi, @fabiocos, @slomeo, @venturia this is something you requested to watch as well.
@silviodonato, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@makortel
Copy link
Contributor Author

@cmsbuild, please test

@makortel
Copy link
Contributor Author

FYI @Dr15Jones

@cmsbuild
Copy link
Contributor

The tests are being triggered in jenkins.

@makortel
Copy link
Contributor Author

please abort

@cmsbuild
Copy link
Contributor

Jenkins tests are aborted.

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-31289/18006

  • This PR adds an extra 20KB to repository

@cmsbuild
Copy link
Contributor

Pull request #31289 was updated. @civanch, @Dr15Jones, @makortel, @cvuosalo, @ianna, @mdhildreth, @cmsbuild, @kpedro88 can you please check and sign again.

@makortel
Copy link
Contributor Author

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Aug 29, 2020

The tests are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-96cd61/8998/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 35
  • DQMHistoTests: Total histograms compared: 2609667
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2609644
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 34 files compared)
  • Checked 149 log files, 22 edm output root files, 35 DQM output files

setWhatProduced(this).setConsumes(geomToken_);
}
MuonNumberingInitialization::MuonNumberingInitialization(const edm::ParameterSet&)
: geomToken_{setWhatProduced(this).consumes()} {}
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe

Suggested change
: geomToken_{setWhatProduced(this).consumes()} {}
: geomToken_{setWhatProduced(this)} {}

also works. Not sure I like it or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually it doesn't work. I tested and it leads to compilation errors

In file included from .../src/FWCore/Framework/interface/es_impl/MayConsumeChooser.h:28,
                 from .../src/FWCore/Framework/interface/ESConsumesCollector.h:33,
                 from .../src/FWCore/Framework/interface/ESProducer.h:77,
                 from .../Geometry/MuonNumbering/plugins/MuonNumberingInitialization.cc:22:
.../FWCore/Utilities/interface/ESGetToken.h: In instantiation of 'constexpr edm::ESGetToken<ESProduct, ESRecord>::ESGetToken(ADAPTER&&) [with ADAPTER = edm::ESConsumesCollectorT<Mu
onNumberingRecord>; ESProduct = DDCompactView; ESRecord = IdealGeometryRecord]':
.../Geometry/MuonNumbering/plugins/MuonNumberingInitialization.cc:41:39:   required from here
.../FWCore/Utilities/interface/ESGetToken.h:52:117: error: no matching function for call to 'edm::ESConsumesCollectorT<MuonNumberingRecord>::consumes<DDCompactView, IdealGeometryRe
cord>()'
     constexpr explicit ESGetToken(ADAPTER&& iAdapter) : ESGetToken(iAdapter.template consumes<ESProduct, ESRecord>()) {}

In file included from .../FWCore/Framework/interface/es_impl/MayConsumeChooser.h:28,
                 from .../FWCore/Framework/interface/ESConsumesCollector.h:33,
                 from .../FWCore/Framework/interface/ESProducer.h:77,
                 from .../Geometry/MuonNumbering/plugins/MuonNumberingInitialization.cc:22:
.../FWCore/Utilities/interface/ESGetToken.h: In instantiation of 'constexpr edm::ESGetToken<ESProduct, ESRecord>::ESGetToken(ADAPTER&&) [with ADAPTER = edm::ESConsumesCollectorT<Mu
onNumberingRecord>; ESProduct = DDCompactView; ESRecord = IdealGeometryRecord]':
.../Geometry/MuonNumbering/plugins/MuonNumberingInitialization.cc:41:39:   required from here
.../FWCore/Utilities/interface/ESGetToken.h:52:117: error: no matching function for call to 'edm::ESConsumesCollectorT<MuonNumberingRecord>::consumes<DDCompactView, IdealGeometryRe
cord>()'
     constexpr explicit ESGetToken(ADAPTER&& iAdapter) : ESGetToken(iAdapter.template consumes<ESProduct, ESRecord>()) {}

I think this happens because setWhatConsumes() returns ESConsumesCollector<T>, whose consumes() takes only one template argument, while the ESGetToken constructor calls consumes() with two template arguments.

Anyway, I think the explicit call to consumes() makes the call slightly easier to understand.

@cvuosalo
Copy link
Contributor

+1

@kpedro88
Copy link
Contributor

kpedro88 commented Sep 3, 2020

+upgrade

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 3, 2020

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

@silviodonato
Copy link
Contributor

assign core
do you actually want to migrate to the type-deducing consumes()?
My understanding after the Core software meeting was that there is a slight preference to avoid migrating to the new consumes(). In this way we avoid to complicate (a little bit) the possible future backports.
I'm asking just for a clarification, I don't have a strong opinion about this.

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 3, 2020

New categories assigned: core

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

@makortel
Copy link
Contributor Author

makortel commented Sep 3, 2020

do you actually want to migrate to the type-deducing consumes()?

From setConsumes() yes. I'd like to avoid maintaining two type-deducing APIs for consumes (in ESProducers).

My understanding after the Core software meeting was that there is a slight preference to avoid migrating to the new consumes(). In this way we avoid to complicate (a little bit) the possible future backports.

Correct, but in that discussion I meant from the consumes()/esConsumes() with the types specified explicitly. I think I mentioned my plan to migrate all setConsumes() to type-deducing consumes().

@makortel
Copy link
Contributor Author

makortel commented Sep 3, 2020

+core

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 3, 2020

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

@silviodonato
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit af81ead into cms-sw:master Sep 3, 2020
@makortel makortel deleted the consumesGeometry branch September 4, 2020 01: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.

6 participants