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

Fixed thread-safety problems with JetCorrectors #3092

Merged
merged 3 commits into from
Apr 1, 2014

Conversation

Dr15Jones
Copy link
Contributor

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.

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.
@Dr15Jones
Copy link
Contributor Author

This fix is needed to avoid the failures in the CMSSW_7_1_THREADED_X IB RelVals.

@cmsbuild
Copy link
Contributor

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

Fixed thread-safety problems with JetCorrectors

It involves the following packages:

CondFormats/JetMETObjects
JetMETCorrections/Algorithms

@apfeiffer1, @nclopezo, @monttj, @cmsbuild, @ggovi, @vadler, @Degano can you please review it and eventually sign? Thanks.
@TaiSakuma, @nhanvtran this is something you requested to watch as well.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
@nclopezo, @ktf you are the release manager for this.
You can merge this pull request by typing 'merge' in the first line of your comment.

@Dr15Jones
Copy link
Contributor Author

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.

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

@vadler
Copy link

vadler commented Mar 31, 2014

+1

@apfeiffer1
Copy link
Contributor

+1

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_1_X IBs unless changes (tests are also fine). @nclopezo, @ktf can you please take care of it?

nclopezo added a commit that referenced this pull request Apr 1, 2014
JetCorrector -- Fixed thread-safety problems with JetCorrectors
@nclopezo nclopezo merged commit ed68e6f into cms-sw:CMSSW_7_1_X Apr 1, 2014
@Dr15Jones Dr15Jones deleted the makeJetCorrectorThreadSafe branch April 4, 2014 04:44
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.

5 participants