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

es get() migration of L1CondDBPayloadWriter and L1CondDBPayloadWriterExt #36383

Merged
merged 3 commits into from Dec 17, 2021

Conversation

tvami
Copy link
Contributor

@tvami tvami commented Dec 7, 2021

PR description:

Part of the migration in #31061

According to the comment #31061 (comment) this is the last DB signature for the es get() functions

PR validation:

Code compiles

if this PR is a backport please specify the original PR and why you need to backport that PR:

N/A

cc @makortel

@cmsbuild cmsbuild added this to the CMSSW_12_3_X milestone Dec 7, 2021
@tvami
Copy link
Contributor Author

tvami commented Dec 7, 2021

@cmsbuild , please test

@tvami
Copy link
Contributor Author

tvami commented Dec 7, 2021

code-checks

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 7, 2021

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36383/27162

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 7, 2021

A new Pull Request was created by @tvami (Tamas Vami) for master.

It involves the following packages:

  • CondTools/L1Trigger (db, l1)
  • CondTools/L1TriggerExt (db)

@malbouis, @rekovic, @ggovi, @francescobrivio, @cecilecaillol, @tvami can you please review it and eventually sign? Thanks.
@mmusich this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@makortel
Copy link
Contributor

makortel commented Dec 7, 2021

Thanks @tvami! But I'm afraid the bodies of L1CondDBPayloadWriter and L1CondDBPayloadWriterExt are not sufficient. The EDModule report
https://cmssdt.cern.ch/SDT/jenkins-artifacts/ib-static-analysis/CMSSW_12_2_X_2021-12-05-0000/slc7_amd64_gcc900/reports/eventsetuprecord-get.yaml
shows call stack of e.g.

  - 'L1CondDBPayloadWriter::analyze(const edm::Event &, const edm::EventSetup &); l1t::DataWriter::writePayload(const edm::EventSetup &, const std::basic_string<char, std::char_traits<char>, std::allocator<char> > &); l1t::WriterProxy::save(const edm::EventSetup &) const; l1t::WriterProxyT<L1CaloEcalScaleRcd, L1CaloEcalScale>::save(const edm::EventSetup &) const; '

pointing to

// load record and type from EventSetup and save them in db
edm::ESHandle<Type> handle;
try {
setup.get<Record>().get(handle);
} catch (l1t::DataAlreadyPresentException& ex) {
return std::string();
}

(what exactly is the try-catch attempting to do?)

@tvami
Copy link
Contributor Author

tvami commented Dec 7, 2021

(what exactly is the try-catch attempting to do?)

Maybe @rekovic could comment? Or @hjkwon260 ?

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 7, 2021

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-d91bad/21035/summary.html
COMMIT: ea84b43
CMSSW: CMSSW_12_2_X_2021-12-06-2300/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/36383/21035/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 42
  • DQMHistoTests: Total histograms compared: 3250608
  • DQMHistoTests: Total failures: 0
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3250586
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 41 files compared)
  • Checked 177 log files, 37 edm output root files, 42 DQM output files
  • TriggerResults: no differences found

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 7, 2021

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36383/27182

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 7, 2021

Pull request #36383 was updated. @malbouis, @cmsbuild, @rekovic, @ggovi, @francescobrivio, @cecilecaillol, @tvami can you please check and sign again.

@tvami
Copy link
Contributor Author

tvami commented Dec 7, 2021

@cmsbuild , please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 7, 2021

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36383/27189

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 7, 2021

Pull request #36383 was updated. @malbouis, @rekovic, @ggovi, @francescobrivio, @cecilecaillol, @tvami can you please check and sign again.

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 7, 2021

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-d91bad/21059/summary.html
COMMIT: 0e1479a
CMSSW: CMSSW_12_3_X_2021-12-06-2300/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/36383/21059/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 42
  • DQMHistoTests: Total histograms compared: 3250608
  • DQMHistoTests: Total failures: 5
  • DQMHistoTests: Total nulls: 1
  • DQMHistoTests: Total successes: 3250580
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: -0.004 KiB( 41 files compared)
  • DQMHistoSizes: changed ( 312.0 ): -0.004 KiB MessageLogger/Warnings
  • Checked 177 log files, 37 edm output root files, 42 DQM output files
  • TriggerResults: no differences found

@tvami
Copy link
Contributor Author

tvami commented Dec 7, 2021

So I can't do more with this PR, any other updates need to come from the L1T team, and so that should happen in a separate PR

@malbouis
Copy link
Contributor

malbouis commented Dec 7, 2021

+db

  • esConsume migration. Remaining of migration to be done by L1 team.
  • tests pass.

@tvami
Copy link
Contributor Author

tvami commented Dec 7, 2021

So I can't do more with this PR, any other updates need to come from the L1T team, and so that should happen in a separate PR

Hi @perrotta @qliphy so we have a fully technical PR migrating the last DB signature piece of the esConsumes migration. Please consider merging it w/o the L1T signature. They'll have to follow up about the WriterProxy anyway in another PR....

@tvami
Copy link
Contributor Author

tvami commented Dec 15, 2021

Hi @perrotta @qliphy I know it's funny to say that we should skip a L1T signature for a package that's almost fully under L1T.... but it's been 8 days with no news and this is a technical migration after all... Please let me know what you think!

@perrotta
Copy link
Contributor

@rekovic please have a look and comment and/or sign

@cecilecaillol
Copy link
Contributor

+l1

@cmsbuild
Copy link
Contributor

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

@tvami
Copy link
Contributor Author

tvami commented Dec 17, 2021

Hi @cecilecaillol thanks a lot for signing this! Can you please confirm that you'll take care of WriteProxyT in a follow-up PR? thanks!

@perrotta
Copy link
Contributor

+1

  • @cms-sw/l1-l2 please arrange with @tvami for possible further cleanups of CondTools/L1Trigger/interface/WriterProxy.h, as discussed above

@cmsbuild cmsbuild merged commit 2e12139 into cms-sw:master Dec 17, 2021
@panoskatsoulis
Copy link
Contributor

panoskatsoulis commented Apr 17, 2022

Just to add some details from a private chat with @tvami. A challenge for migrating the helper code (WriteProxyT) is that the WriteProxyT instance (i.e. (record, type) pair) is constructed via a factory based on a string here

std::unique_ptr<WriterProxy> writer(factory->create(recordType + "@Writer"));

The string is passed in in

token = m_writer.writePayload(iSetup, it->first);

and the strings originate from another EventSetup product

L1TriggerKey::RecordToKey::const_iterator it = key->recordToKeyMap().begin();
L1TriggerKey::RecordToKey::const_iterator end = key->recordToKeyMap().end();

key = iSetup.getHandle(l1TriggerKeyToken_);

which makes it impossible to call esConsumes() at the L1CondDBPayloadWriter module construction time.

Would it be feasible to specify these strings in configuration instead of an EventSetup product? @cms-sw/l1-l2

Also, @tvami can you please elaborate better on this issue?
It's not followed up and seems that creates problems on 12_3
Whatever is constructed by the factory, should have its own constructor, not?

@tvami
Copy link
Contributor Author

tvami commented Apr 17, 2022

Hi @panoskatsoulis

  1. about the header question: the header is not removed, it's just simply moved into the cc file, as per the CMS coding rule 6.7
  2. about es get() migration of L1CondDBPayloadWriter and L1CondDBPayloadWriterExt #36383 (comment) : @makortel probably could elaborate more, but I think the problem is that token = m_writer.writePayload(iSetup, it->first); should take the object directly in that code, instead of taking it through the factory. What is really the reason to have writePayload instead of a direct approach in l1conddbpayloadwriter.cc?

@panoskatsoulis
Copy link
Contributor

panoskatsoulis commented Apr 17, 2022

Hi @tvami , I prepared a PR about this #37601
in short the problem was that there was not obvious way to run esConsume in some constructor when the Writer was being created by the Factory.
The main reason is that esConsumes is a method of ESConsumerBase from where every module in the cmssw inherits (but not the WriterProxy)
When I use it base class for WriterProxy (and ProxyT), i was able to use the ESGetToken without problem.

@makortel
Copy link
Contributor

2. about es get() migration of L1CondDBPayloadWriter and L1CondDBPayloadWriterExt #36383 (comment) : @makortel probably could elaborate more, but I think the problem is that token = m_writer.writePayload(iSetup, it->first); should take the object directly in that code, instead of taking it through the factory. What is really the reason to have writePayload instead of a direct approach in l1conddbpayloadwriter.cc?

(mostly for the record here) The framework needs to know at EDModule construction time the EventSetup data products the EDModule consumes. Currently the WriterProxyT constructor is called from L1CondDBPayloadWriter::analyze(), which is too late. I outlined a possible way forward in #37602 (comment).

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.

None yet

7 participants