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

Made FFTJetCorrector thread safe #7682

Merged

Conversation

Dr15Jones
Copy link
Contributor

The FFTJetCorrector is accessible via the EventSetup and therefore
all its const methods must be thread safe. Previously, the const
method 'correct' was using a member data for a temporary buffer
which was being changes on each call to 'correct'. To make the
routine thread safe we now use a buffer on the stack if only a small
buffer is needed and use a std::vector if a larger buffer is needed.

This problem was caught by the static analyzer.

The FFTJetCorrector is accessible via the EventSetup and therefore
all its const methods must be thread safe. Previously, the const
method 'correct' was using a member data for a temporary buffer
which was being changes on each call to 'correct'. To make the
routine thread safe we now use a buffer on the stack if only a small
buffer is needed and use a std::vector if a larger buffer is needed.

This problem was caught by the static analyzer.
@Dr15Jones
Copy link
Contributor Author

It would be great if someone who knew how the FFTJetCorrectors are initialized could look to see what would be an optimal size for the stack based buffer.

@cmsbuild
Copy link
Contributor

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

Made FFTJetCorrector thread safe

It involves the following packages:

JetMETCorrections/FFTJetModules
JetMETCorrections/FFTJetObjects

@cmsbuild, @vadler, @nclopezo, @monttj can you please review it and eventually sign? Thanks.
@rappoccio, @ahinzmann, @mmarionncern, @nhanvtran, @schoef, @mariadalfonso, @TaiSakuma 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.
If you are a L2 or a release manager you can ask for tests by saying 'please test' in the first line of a comment.
@Degano 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

please test

@cmsbuild
Copy link
Contributor

The tests are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

@monttj
Copy link
Contributor

monttj commented Feb 13, 2015

I am not sure who is using "FFTJetCorrectors"?

@Dr15Jones
Copy link
Contributor Author

The best way to make code thread safe is to remove it entirely :).

@Dr15Jones
Copy link
Contributor Author

@davidlange6 @vadler @monttj ping

davidlange6 added a commit that referenced this pull request Mar 4, 2015
@davidlange6 davidlange6 merged commit 1fa1a4c into cms-sw:CMSSW_7_4_X Mar 4, 2015
@Dr15Jones Dr15Jones deleted the threadSafeFFTJetCorrector branch April 7, 2015 20:01
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