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

Avoid unnecessary locks in ROOT function GetBaseClassOffset() #11441

Merged
merged 3 commits into from
Sep 26, 2015

Conversation

wmtan
Copy link
Contributor

@wmtan wmtan commented Sep 23, 2015

The ROOT function GetBaseClassOffset() does locking that seriously hurts threading efficiency, especially in analysis jobs using pat::. In the vast majority of the cases (in fact in all cases so far observed), the actual offset to the base class object from the derived class object was 0.
This PR replaces GetBaseClassOffset() with a call to a function of a class template that returns 0 by default. In cases where the actual offset is non-zero, the class can be specialized to return the proper value. In cases where the true offset is non-zero, and the class has not been properly specialized, a segfault should result, which will be noticed.

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @wmtan for CMSSW_7_6_X.

Avoid unnecessary locks in ROOT function GetBaseClassOffset()

It involves the following packages:

DataFormats/Common
DataFormats/PatCandidates
FWCore/Utilities
PhysicsTools/HepMCCandAlgos

@cmsbuild, @smuzaffar, @Dr15Jones, @monttj, @vadler can you please review it and eventually sign? Thanks.
@makortel, @Martin-Grunewald, @gpetruc, @wddgit 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.

@wmtan
Copy link
Contributor Author

wmtan commented Sep 23, 2015

@davidlange6 The changes to analysis code consist entirely of adding two missing std includes that were made visible by removing unnecessary includes in the framework. So, this PR should not be held up by a late analysis signature.

@@ -2,6 +2,7 @@
#include <algorithm>
#include <iterator>
#include <iostream>
#include <string.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the C header? Wouldn't <cstring> be better?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, cstring is better.

@wmtan wmtan force-pushed the AvoidUnnecessaryLocks branch from 91c739a to 7b60ff6 Compare September 23, 2015 20:03
@cmsbuild
Copy link
Contributor

Pull request #11441 was updated. @cmsbuild, @smuzaffar, @Dr15Jones, @monttj, @vadler can you please check and sign again.

@wmtan
Copy link
Contributor Author

wmtan commented Sep 23, 2015

@cmsbuild please test

@cmsbuild
Copy link
Contributor

The tests are being triggered in jenkins.

@Dr15Jones
Copy link
Contributor

+1

@Dr15Jones
Copy link
Contributor

@smuzaffar is this test still running?

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

davidlange6 added a commit that referenced this pull request Sep 26, 2015
Avoid unnecessary locks in ROOT function GetBaseClassOffset()
@davidlange6 davidlange6 merged commit 3ad48c0 into cms-sw:CMSSW_7_6_X Sep 26, 2015
@wmtan wmtan deleted the AvoidUnnecessaryLocks branch September 26, 2015 19:06
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.

4 participants