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

Initialize BranchDescription from Dictionary only if the branch is present #38806

Merged
merged 1 commit into from Aug 17, 2022

Conversation

makortel
Copy link
Contributor

PR description:

This PR limits the BranchDescription's ROOT dicrionary part be initialized only if the branch is present. This change allows a job to process a file that contains products whose parent product (that is not in the file, was either transient or dropped) dictionary does not exist anymore in the job. Resolves #38781.

I'm uncertain about the usefulness of the test added in this PR. It is sufficient to demonstrate that the changes of this PR work as intended, but it has some serious flaws for longer term.

PR validation:

Problematic job runs, framework unit tests pass.

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38806/31164

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38806/31165

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

  • DataFormats/Common (core)
  • DataFormats/Provenance (core)
  • DataFormats/TestObjects (core)
  • FWCore/Framework (core)
  • IOPool/Input (core)

@cmsbuild, @smuzaffar, @Dr15Jones, @makortel can you please review it and eventually sign? Thanks.
@wddgit, @rovere this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy, @rappoccio 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

@Dr15Jones @wddgit Can you think of any ill side effects that might not be covered by our unit tests?

@wddgit
Copy link
Contributor

wddgit commented Jul 20, 2022

I'll take a look at it.

# Copy DataFormats/TestObjects from local/release
# Plus minimal set of packages to run the test for the first time
# TODO: this test doesn't really work on PRs that have code outside of
# these packages that would break the functionality
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any ideas to improve this test are welcome. I tried to to symlink all files (except those matching to DataFormatsTestObjects) from ${OLD_CMSSW_BASE}/lib/${SCRAM_ARCH} into ${CMSSW_BASE}/lib/${SCRAM_ARCH} but that alone was not sufficient (the step2 job below failed as the code changes were not propagated).

Maybe this test could be sufficient until @smuzaffar gets back.

Copy link
Contributor

Choose a reason for hiding this comment

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

How about just manipulating what the PluginManager reads instead of having to do another compilation?

  1. Put the dictionary generation of TransientIntParentT<1> and TransientIntParentT<2> into two different classes_def files so they are in different plugins
  2. Write using TransientIntParentT<1> as you did
  3. manipulate LD_LIBRARY_PATH to add a new directory to the beginning which has a .edmplugincache which lies about where to get TransientIntParentT<1> (points to a file that doesn't contain that dictionary)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure I understood properly. The dictionaries end up in libraries, not plugins (right?). I can't quickly think of a way to play tricks with libraries and LD_LIBRARY_PATH without a second compilation, but maybe adjusting LD_LIBRARY_PATH with the second compilation would at least help to overcome the main deficiency of the current test.

Copy link
Contributor

Choose a reason for hiding this comment

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

Arg, I was thinking about ancient days where plugin manager provided the dictionaries. Still, the same idea might work if one manipulated a .rootmap file and LD_LIBRARY_PATH.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I finally figured out one way to improve the test such that it should work now in any PR/IB, fails in the IB without this PR, and does not require scram b.

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-384df2/26357/summary.html
COMMIT: fa0f541
CMSSW: CMSSW_12_5_X_2022-07-20-1100/el8_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/38806/26357/install.sh to create a dev area with all the needed externals and cmssw changes.

CMS deprecated warnings: 9 CMS deprecated warnings found, see summary page for details.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 50
  • DQMHistoTests: Total histograms compared: 3662417
  • DQMHistoTests: Total failures: 17
  • DQMHistoTests: Total nulls: 1
  • DQMHistoTests: Total successes: 3662377
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: -0.004 KiB( 49 files compared)
  • DQMHistoSizes: changed ( 312.0 ): -0.004 KiB MessageLogger/Warnings
  • Checked 208 log files, 45 edm output root files, 50 DQM output files
  • TriggerResults: no differences found

@@ -158,9 +158,11 @@ namespace edm {
BranchID switchAliasForBranchID_;

// A TypeWithDict object for the wrapped object
// This is set if and only if the dropped_ is false
Copy link
Contributor

Choose a reason for hiding this comment

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

Would we do away with the use of TypeWithDict here for a later PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would do that in a later PR.

@@ -17,7 +17,8 @@ namespace edm {
// data member can only be true for run or lumi products.
// It defaults to false. Also if it is true that means it
// was already set.
if (desc.branchType() == InRun || desc.branchType() == InLumi) {
// Set it only for branches that are present
if (desc.present() and (desc.branchType() == InRun or desc.branchType() == InLumi)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would we try to remove the concept of mergeable from BranchDescription in a later PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would do that in a later PR.

# Copy DataFormats/TestObjects from local/release
# Plus minimal set of packages to run the test for the first time
# TODO: this test doesn't really work on PRs that have code outside of
# these packages that would break the functionality
Copy link
Contributor

Choose a reason for hiding this comment

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

How about just manipulating what the PluginManager reads instead of having to do another compilation?

  1. Put the dictionary generation of TransientIntParentT<1> and TransientIntParentT<2> into two different classes_def files so they are in different plugins
  2. Write using TransientIntParentT<1> as you did
  3. manipulate LD_LIBRARY_PATH to add a new directory to the beginning which has a .edmplugincache which lies about where to get TransientIntParentT<1> (points to a file that doesn't contain that dictionary)

@wddgit
Copy link
Contributor

wddgit commented Jul 21, 2022

We already discussed that we keep BranchDescriptions for kept products and their ancestors. There is one other case where we also keep the BranchDescription. If there is a BranchAlias and we keep the alias BranchDescription, then we also keep the original BranchDescription. I'm not sure that this affects anything... Just mentioning it because we didn't include that when we were discussing it earlier.

@wddgit
Copy link
Contributor

wddgit commented Jul 21, 2022

Is there anything that inhibits callWhenNewProductsRegistered from being called on BranchDescriptions not present? Code like this would fail in that case.

https://cmssdt.cern.ch/dxr/CMSSW/source/RecoMuon/L3MuonProducer/src/L3TkMuonProducer.cc#38

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38806/31595

@cmsbuild
Copy link
Contributor

Pull request #38806 was updated. @cmsbuild, @smuzaffar, @Dr15Jones, @makortel can you please check and sign again.

@makortel
Copy link
Contributor Author

@cmsbuild, please test

Last test after squashing the commits together

@cmsbuild
Copy link
Contributor

-1

Failed Tests: UnitTests
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-384df2/26863/summary.html
COMMIT: a6ad1db
CMSSW: CMSSW_12_5_X_2022-08-16-2300/el8_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/38806/26863/install.sh to create a dev area with all the needed externals and cmssw changes.

CMS deprecated warnings: 9 CMS deprecated warnings found, see summary page for details.

Unit Tests

I found errors in the following unit tests:

---> test testTauEmbeddingProducers had ERRORS

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 2 differences found in the comparisons
  • DQMHistoTests: Total files compared: 51
  • DQMHistoTests: Total histograms compared: 3692500
  • DQMHistoTests: Total failures: 8
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3692470
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 50 files compared)
  • Checked 212 log files, 49 edm output root files, 51 DQM output files
  • TriggerResults: no differences found

@makortel
Copy link
Contributor Author

+1

The unit test fails already in the IBs and is not related to this PR.

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (but tests are reportedly failing). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy, @rappoccio (and backports should be raised in the release meeting by the corresponding L2)

@perrotta
Copy link
Contributor

+1

@perrotta
Copy link
Contributor

merge

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.

ROOT Dictionary Error For CUDADataFormats
7 participants