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
Conversation
-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)
|
38cce2e
to
fa0f541
Compare
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38806/31165
|
A new Pull Request was created by @makortel (Matti Kortelainen) for master. It involves the following packages:
@cmsbuild, @smuzaffar, @Dr15Jones, @makortel can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@cmsbuild, please test |
@Dr15Jones @wddgit Can you think of any ill side effects that might not be covered by our unit tests? |
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
- Put the dictionary generation of TransientIntParentT<1> and TransientIntParentT<2> into two different classes_def files so they are in different plugins
- Write using TransientIntParentT<1> as you did
- 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)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-384df2/26357/summary.html CMS deprecated warnings: 9 CMS deprecated warnings found, see summary page for details. Comparison SummarySummary:
|
@@ -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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
- Put the dictionary generation of TransientIntParentT<1> and TransientIntParentT<2> into two different classes_def files so they are in different plugins
- Write using TransientIntParentT<1> as you did
- 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)
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. |
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 |
d629b72
to
a6ad1db
Compare
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38806/31595
|
Pull request #38806 was updated. @cmsbuild, @smuzaffar, @Dr15Jones, @makortel can you please check and sign again. |
@cmsbuild, please test Last test after squashing the commits together |
-1 Failed Tests: UnitTests CMS deprecated warnings: 9 CMS deprecated warnings found, see summary page for details. Unit TestsI found errors in the following unit tests: ---> test testTauEmbeddingProducers had ERRORS Comparison SummarySummary:
|
+1 The unit test fails already in the IBs and is not related to this PR. |
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) |
+1
|
merge |
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.