-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Run G4 workers on their own dedicated threads #34899
Conversation
OscarMTProducer now guarantees the class methods are run on their own dedicated thread.
@makortel FYI |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-34899/24707
|
A new Pull Request was created by @Dr15Jones (Chris Jones) for master. It involves the following packages:
@cmsbuild, @civanch, @mdhildreth can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-99abab/17811/summary.html Comparison SummarySummary:
|
@Dr15Jones , I would expect regression for this change or we change random seed? |
Given the tests run single threaded, I would have expected exact comparisons. I'm making a change now where I properly propagate the random number seed to the new threads. Let's see if that avoids the differences. |
@Dr15Jones , there is a simple method fully control random seeds. I would suggest to use it in the first place. For that, in OscarMTProducer uncomment line 217 and make line 216 and 217 edm::LogWarning. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-34899/24723
|
Pull request #34899 was updated. @cmsbuild, @civanch, @mdhildreth can you please check and sign again. |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-99abab/17829/summary.html Comparison SummarySummary:
|
The DQM histogram differences are all from the MessageLogger and the reco differences are a known reproducibility problem caused by an uninitialized variable. |
@@ -165,7 +177,13 @@ OscarMTProducer::OscarMTProducer(edm::ParameterSet const& p, const OscarMTMaster | |||
edm::LogVerbatim("SimG4CoreApplication") << "OscarMTProducer is constructed"; | |||
} | |||
|
|||
OscarMTProducer::~OscarMTProducer() {} | |||
OscarMTProducer::~OscarMTProducer() { | |||
auto token = edm::ServiceRegistry::instance().presentToken(); |
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.
@Dr15Jones , is it safe calling edm::ServiceRegistry::instance() in a destructor? May be better keeping the pointer as a class member?
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.
The framework guarantees that it is safe to use the Service system in module destructors.
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.
+1
If the framework guarantee the order of destruction, it is fine.
@civanch if you intended to approve the whole pull request (and not just the one comment) you have to do the + and 1 as a top level comment. |
+1 |
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. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
PR description:
Each G4 worker now runs on its own thread. Each stream has its own thread and when the stream needs to do work it blocks the TBB thread and starts up its dedicated thread.
This should allow SimWatchers to be modified to call esConsumes.
PR validation:
Code compiles and a simple workflow runs.