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

Refactor parts of the thinning code #30906

Merged
merged 11 commits into from Aug 7, 2020
Merged

Conversation

makortel
Copy link
Contributor

PR description:

This PR is a preparatory step to introduce (constrained) support for slimming objects when performing thinning of collections, as outlined in the discussion of #30544. More specifically, this PR

  • Renames ThinningProducer::fillDescription() to ThinningProducer::fillPSetDescription() to follow a naming convention established elsewhere, and calls ConfigurationDescriptions::addWithDefaultLabel() to also generate the cfi (by @bendavid)
  • Changes ThinnedAssociationsHelper::vThinnedAssociationBranches_` to be always sorted instead of sorting once at the end
    • When introducing the support for slimming, I'm planning to check after each insertion if the constraints for slimmed collections are still met in the hope of being able to provide easier-to-interpret error messages. This check will be more efficient if vThinnedAssociationBranches_ is always sorted.
    • The overall worst-case complexity of the insertions+sort does increase from O(n log n) to O(n^2)
  • Add class version for ThinnedAssociationBranches
    • Will add a new member in a subsequent PR
  • Abstract the implementations of getThinnedProduct() and getThinnedProducts() in EventPrincipal, DataGetterHelper, and BareRootProductGetter into single functions
    • Having only one implementation for each will simplify the slimming development
  • Change the interface of getThinnedProduct() to return WrapperBase const* and the key to thinned collection via std::optional instead of the mixture of return value and output argument in the hope of making the calling code easier to understand
    • makes it clear by reading the code alone when the key to thinned collection is used and when not

PR validation:

Framework unit tests pass.

bendavid and others added 3 commits July 24, 2020 15:41
…parate sort

I will rely on that when checking the constraints for slimming, in the
hope of being able to provide more helpful error messages.
@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-30906/17300

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

DataFormats/Common
DataFormats/FWLite
DataFormats/Provenance
FWCore/FWLite
FWCore/Framework
FWCore/Integration
IOPool/Streamer

@makortel, @smuzaffar, @cmsbuild, @Dr15Jones can you please review it and eventually sign? Thanks.
@rovere, @wddgit 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

@Dr15Jones @wddgit Please review

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 24, 2020

The tests are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

-1

Tested at: ed0cbd1

CMSSW: CMSSW_11_2_X_2020-07-24-1400
SCRAM_ARCH: slc7_amd64_gcc820
You can see the results of the tests here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-82657f/8281/summary.html

I found follow errors while testing this PR

Failed tests: Build HeaderConsistency

  • Build:

I found compilation error when building:

>> Building LCG reflex dict from header file src/DataFormats/Candidate/src/classes.h
In file included from input_line_8:54:
In file included from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_11_2_X_2020-07-24-1400/src/DataFormats/Candidate/interface/Candidate.h:12:
In file included from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_11_2_X_2020-07-24-1400/src/DataFormats/Candidate/interface/const_iterator.h:9:
In file included from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_11_2_X_2020-07-24-1400/src/DataFormats/Candidate/interface/CandidateFwd.h:10:
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_11_2_X_2020-07-24-1400/src/DataFormats/Common/interface/Ptr.h:193:32: error: no viable overloaded '='
          std::tie(prod, iKey) = *optProd;
          ~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_11_2_X_2020-07-24-1400/src/DataFormats/Common/interface/Ptr.h:218:5: note: in instantiation of member function 'edm::Ptr::getData_' requested here
    getData_();
    ^


@cmsbuild
Copy link
Contributor

Comparison not run due to Build errors (RelVals and Igprof tests were also skipped)

@makortel
Copy link
Contributor Author

@smuzaffar @mrodozov , the build log has at the end

Traceback (most recent call last):
  File "/data/cmsbld/jenkins/workspace/ib-run-pr-tests/cms-bot/buildLogAnalyzer.py", line 527, in <module>
    sys.exit(main(sys.argv))
  File "/data/cmsbld/jenkins/workspace/ib-run-pr-tests/cms-bot/buildLogAnalyzer.py", line 518, in main
    lfa.report()
  File "/data/cmsbld/jenkins/workspace/ib-run-pr-tests/cms-bot/buildLogAnalyzer.py", line 196, in report
    self.makeHTMLSummaryPage()
  File "/data/cmsbld/jenkins/workspace/ib-run-pr-tests/cms-bot/buildLogAnalyzer.py", line 293, in makeHTMLSummaryPage
    link = ' <a href="'+topLogString+pkg.name()+'/log.html">'+pkg.name()+'   '+self.tagList[pkg.name()]+'</a> '
KeyError: 'BigProducts/Simulation'

Is this something that should be addressed?

(there are also real build errors there)

@makortel
Copy link
Contributor Author

About

/data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_11_2_X_2020-07-24-1400/src/DataFormats/Common/interface/Ptr.h:193:32: error: no viable overloaded '='
          std::tie(prod, iKey) = *optProd;
          ~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~
...
/cvmfs/cms-ib.cern.ch/nweek-02638/slc7_amd64_gcc820/external/gcc/8.2.0-bcolbf/bin/../lib/gcc/x86_64-unknown-linux-gnu/8.4.0/../../../../include/c++/8.4.0/tuple:1209:7: note: candidate function not viable: no known conversion from 'std::optional<std::tuple<const edm::WrapperBase *, unsigned int> >' to 'const std::tuple<const edm::WrapperBase *&, unsigned int &>' for 1st argument
      operator=(const tuple& __in)
...
Error: rootcling: compilation failure (tmp/slc7_amd64_gcc820/src/DataFormats/Candidate/src/DataFormatsCandidate/a/DataFormatsCandidate_xre109de4e71_dictUmbrella.h)

does

$ rootcling --version
  LLVM version 5.0.0 

mean that (our) rootcling is based on LLVM/clang 5? I can reproduce the failure with clang 5 in https://godbolt.org/z/PEqeW4, while it builds fine with clang >= 6.

Further inspection shows that with std::optional foo = something_returning_optional indeed creates std::optional<std::optional<T>> in clang 5 (and just std::optional<T> in clang >= 6).

I can work around the failure, but I'm wondering if we're "stuck" with clang 5 in rootcling.

This makes the calling code easier to read, because of not having to
understand when exactly the earlier output-argument is changed and
when not.
@cmsbuild
Copy link
Contributor

cmsbuild commented Aug 5, 2020

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

cmsbuild commented Aug 5, 2020

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-30906/17580

@cmsbuild
Copy link
Contributor

cmsbuild commented Aug 5, 2020

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

@makortel
Copy link
Contributor Author

makortel commented Aug 5, 2020

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Aug 5, 2020

The tests are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

cmsbuild commented Aug 5, 2020

+1
Tested at: 9632de8
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-82657f/8590/summary.html
CMSSW: CMSSW_11_2_X_2020-08-04-2300
SCRAM_ARCH: slc7_amd64_gcc820

@cmsbuild
Copy link
Contributor

cmsbuild commented Aug 5, 2020

Comparison job queued.

@cmsbuild
Copy link
Contributor

cmsbuild commented Aug 5, 2020

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-82657f/8590/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: 2612401
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2612352
  • DQMHistoTests: Total skipped: 48
  • 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

@makortel
Copy link
Contributor Author

makortel commented Aug 6, 2020

+1

@cmsbuild
Copy link
Contributor

cmsbuild commented Aug 6, 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 670fb4d into cms-sw:master Aug 7, 2020
@makortel makortel deleted the refactorThinning branch August 7, 2020 12:16
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

8 participants