-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fixed thread-safety problems with JetCorrectors #3092
Fixed thread-safety problems with JetCorrectors #3092
Conversation
Dr15Jones
commented
Mar 29, 2014
Previously SImpleJetCorrector was changing the values held by the TFormula it owned. This was a problem for threading since this class is indirectly accessible from the EventSetup. Now the code modifies a copy of the TFormula. The member data were reordered to avoid unnecessary padding by the compiler.
Refactored the internals of FactorizedJetCorrector into two seperate classes, one which does the calculation and another which olds the list of variable values. This was needed since FactorizedJetCorrector was being used by JetCorrectors in the EventSetup and the changing of member data is a threading problem. Now the JetCorrectors only hold onto the FactorizedJetCorrectorCalculator and create the temporary variable value holders as needed.
Previously the JetCorrectors used the thread-unsafe class FactorizedJetCorrector to do the work. After refactoring the JetCorrectors now use the thread-safe class FactorizedJetCorrectorCalculator and its helper VariableValues class. The functionality is identical but the temporary variables now only exist on the stack.
This fix is needed to avoid the failures in the CMSSW_7_1_THREADED_X IB RelVals. |
A new Pull Request was created by @Dr15Jones (Chris Jones) for CMSSW_7_1_X.
It involves the following packages: CondFormats/JetMETObjects @apfeiffer1, @nclopezo, @monttj, @cmsbuild, @ggovi, @vadler, @Degano can you please review it and eventually sign? Thanks. |
Although this solves the thread-safety issues, I'm afraid since the JetCorrectors are doing 'edm::Event::getBy*' themselves, it means the modules which use the JetCorrectors are most likely not get their 'consumes' calls made. My suggestion is to move the JetCorrectors our of the EventSetup and make then transient Event products instead. |
+1 |
+1 |
JetCorrector -- Fixed thread-safety problems with JetCorrectors