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

[RFC] Add a mechanism to set the chosen case for SwitchProducer #35510

Closed
wants to merge 3 commits into from

Conversation

makortel
Copy link
Contributor

@makortel makortel commented Oct 2, 2021

PR description:

This PR attempts to resolve to add a mechanism to "force a chosen case" for a SwitchProducer following the idea in #31760 (comment).

Opening now as a RFC, because I'm not fully satisfied with the naming I came up, and I'm not fully convinced of the approach (not that I would have really better ideas).

PR validation:

Framework unit tests run.

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 2, 2021

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-35510/25705

  • This PR adds an extra 48KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 2, 2021

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

It involves the following packages:

  • FWCore/ParameterSet (core)

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

makortel commented Oct 2, 2021

@cmsbuild, please test


The decision can be "forced" with 'foo.setCase_("case1")' and
unset with 'foo.setCase_(None)'. This setting persists through
dumpPython() and picking.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
dumpPython() and picking.
dumpPython() and pickling.

c = cms.int32(2)
)
)
).setCase_('test1')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dumping the "set case" like this looks a bit weird (setCase_() returns self so it should work), but doing it along

foo = SwitchProducerTest(
...
)
foo.setCase_(...)

would require knowing the module label (which is not available here), or extending the functionality of specialImportRegistry (would need to think more what exactly that would imply).

I also considered

SwitchProducerTest(
    test1 = ...,
    test2 = ....,
    setCase_ = cms.untracked.string('test1')
)

but that appeared to require adding special cases for setCase_ in many places complicating the implementation even more. Also given that this setting should(?) be somewhat special case, and that it is not passed on to C++, making it a function call felt better choice than a "real parameter".

@makortel
Copy link
Contributor Author

makortel commented Oct 2, 2021

test parameters:

  • enable_tests = gpu

@makortel
Copy link
Contributor Author

makortel commented Oct 2, 2021

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 2, 2021

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-a9008a/19328/summary.html
COMMIT: e0da71a
CMSSW: CMSSW_12_1_X_2021-10-01-2300/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/35510/19328/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: 40
  • DQMHistoTests: Total histograms compared: 3219394
  • DQMHistoTests: Total failures: 11
  • DQMHistoTests: Total nulls: 1
  • DQMHistoTests: Total successes: 3219360
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.004 KiB( 39 files compared)
  • DQMHistoSizes: changed ( 312.0 ): 0.004 KiB MessageLogger/Warnings
  • Checked 169 log files, 37 edm output root files, 40 DQM output files
  • TriggerResults: no differences found

@makortel
Copy link
Contributor Author

Closing in favor of #36699

@makortel makortel closed this Jan 12, 2022
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

3 participants