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

Test inter process random state transfers #29384

Merged
merged 6 commits into from Apr 4, 2020

Conversation

Dr15Jones
Copy link
Contributor

PR description:

Adds a test to show how to use a EDProducer in cmsRun to drive a different EDProducer in a stand alone process where random engine state is passed back and forth.

PR validation:

The code compiles and framework unit tests pass.

This is used to allow inter-process communication of the random number state.
This provides a RandomNumberGenerator object that can easily be used with the TestProcessor to drive the random numbers in a test or for a non-cmsRun process.
Created a test that uses SharedMemory package to have a module within cmsRun pass random state to and from another EDProducer run in an external process.
@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2020

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2020

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-29384/14495

  • This PR adds an extra 44KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2020

A new Pull Request was created by @Dr15Jones (Chris Jones) for master.

It involves the following packages:

DataFormats/Common
DataFormats/TestObjects
FWCore/Integration
FWCore/Services

@makortel, @smuzaffar, @cmsbuild, @Dr15Jones can you please review it and eventually sign? Thanks.
@makortel, @rovere, @wddgit this is something you requested to watch as well.
@silviodonato, @dpiparo you are the release manager for this.

cms-bot commands are listed here

@Dr15Jones
Copy link
Contributor Author

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2020

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-run-pr-tests/5511/console Started: 2020/04/02 21:03

RandomNumberGeneratorState& operator=(RandomNumberGeneratorState&&) = default;

std::vector<unsigned long> state_;
long seed_;
Copy link
Contributor

Choose a reason for hiding this comment

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

Would encapsulation of the member data make sense here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This isn't a 'real' data format since it never is put in a Principal. It is really an internal detail of how the processes communicate. I put it here since I needed a ROOT dictionary to be generated and this class will be used by the FWCore test as well as the upcoming generator code. That is why I just used a struct.

FWCore/Integration/bin/interprocess_random.cc Outdated Show resolved Hide resolved
FWCore/Integration/bin/interprocess_random.cc Outdated Show resolved Hide resolved
FWCore/Integration/bin/interprocess_random.cc Outdated Show resolved Hide resolved
FWCore/Integration/test/RandomIntProducer.cc Outdated Show resolved Hide resolved
edm::LuminosityBlockIndex iLumi) {
edm::Service<edm::RandomNumberGenerator> gen;
//NOTE: root serialize requires a `void*` not a `void const*` even though it doesn't modify the object
randSerializer_.serialize(const_cast<edm::RandomNumberGeneratorState&>(iState));
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we change ROOTSerializer to take void const*? (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.

We can. The underlying problem is ROOT's code which uses the 'void*' instead of the 'void const*'.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can. The underlying problem is ROOT's code which uses the 'void*' instead of the 'void const*'.

I guessed that would be the case. At least the const_cast would then be isolated and hidden from the rest...

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2020

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2020

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-29384/14497

  • This PR adds an extra 48KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2020

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

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2020

+1
Tested at: 0646944
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-016e2c/5511/summary.html
CMSSW: CMSSW_11_1_X_2020-04-02-1100
SCRAM_ARCH: slc7_amd64_gcc820

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2020

Comparison job queued.

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 3, 2020

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-016e2c/5511/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 10 differences found in the comparisons
  • DQMHistoTests: Total files compared: 34
  • DQMHistoTests: Total histograms compared: 2692110
  • DQMHistoTests: Total failures: 5
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2691786
  • DQMHistoTests: Total skipped: 319
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 33 files compared)
  • Checked 147 log files, 16 edm output root files, 34 DQM output files

@Dr15Jones
Copy link
Contributor Author

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 3, 2020

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-run-pr-tests/5515/console Started: 2020/04/03 02:31

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 3, 2020

+1
Tested at: 5209e29
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-016e2c/5515/summary.html
CMSSW: CMSSW_11_1_X_2020-04-02-1100
SCRAM_ARCH: slc7_amd64_gcc820

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 3, 2020

Comparison job queued.

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 3, 2020

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-016e2c/5515/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 34
  • DQMHistoTests: Total histograms compared: 2692110
  • DQMHistoTests: Total failures: 3
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2691788
  • DQMHistoTests: Total skipped: 319
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 33 files compared)
  • Checked 147 log files, 16 edm output root files, 34 DQM output files

@makortel
Copy link
Contributor

makortel commented Apr 3, 2020

+1

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 3, 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 (and backports should be raised in the release meeting by the corresponding L2)

@silviodonato
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 08b65d6 into cms-sw:master Apr 4, 2020
@Dr15Jones Dr15Jones deleted the interProcRandom branch April 6, 2020 17:07
colizz added a commit to colizz/cmssw that referenced this pull request Jul 12, 2020
Backport from cms-sw#29384.
Additional changes:
 - FWCore/Integration/bin/interprocess_random.cc: L72,100: disable macro CMS_SA_ALLOW.
 - FWCore/Services/test/BuildFile.xml: L16-20: copy the tag for entire unit test "testFWCoreServicesCatch2".
 - FWCore/Services/test/test_catch2_ExternalRandomNumberGeneratorService.cc: L8: uncomment "#define CATCH_CONFIG_MAIN".
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

4 participants