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

Workaround for ROOT6 limitation #1842

Closed

Conversation

wmtan
Copy link
Contributor

@wmtan wmtan commented Dec 17, 2013

ROOT6 uses a version of the llvm just in time compiler that cannot handle embedded assembler code.
boost/shared_ptr.hpp contains (indirectly) two headers that contain assembler. This breaks many framework unit tests.
This workaround sets preprocessor variables recognized by boost that are used if and only if ROOTCLING is defined. These preprocessor definitions cause the assembler code to not be included. This fixes the unit test errors.
The final fix for this problem should be either that ROOT6 is fixed to handle assembler, OR that CMSSW replaces with std::shared_ptr those uses of boost::shared_ptr that cause problems

@cmsbuild
Copy link
Contributor

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

Workaround for ROOT6 limitation

It involves the following packages:

DataFormats/Common
DataFormats/FWLite
DataFormats/Provenance
DataFormats/Streamer
DataFormats/TestObjects
DataFormats/WrappedStdDictionaries
FWCore/Common
FWCore/MessageLogger
FWCore/TFWLiteSelector
FWCore/TFWLiteSelectorTest
FWCore/Utilities

@cmsbuild, @Dr15Jones, @ktf, @nclopezo can you please review it and eventually sign? Thanks.
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.

@davidlt
Copy link
Contributor

davidlt commented Dec 17, 2013

I thought I fixed it [1] by forcing boost to use spinlocks instead of self-implemented atomics.

As I recall this limitation for inline assembly should be gone before the final ROOT6 release and we should look into refactoring code to use std::shared_ptr as we already have discussed (Maybe CMSSW_7_1_X?)

[1] https://github.com/cms-sw/cmsdist/blob/IB/CMSSW_7_0_X/root6/boost-1.51.0-define-BOOST_SP_USE_SPINLOCK.patch

@wmtan
Copy link
Contributor Author

wmtan commented Dec 17, 2013

Unfortunately, contrary to what the ROOT team says, using BOOST_SP_USE_SPINLOCK does not fix the problem, for two separate reasons: 1) the headers pulled in by spinlock also contain assembler, AND 2) boost/shared_ptr contains (indirectly) a second header that includes assembler that is unaffected by spinlock.
A separate #defe
Refactoring the code to use std::shared ptr is a good idea but far from easy, because the framework uses many other boost constructs that require boost::shared_ptr.

@wmtan wmtan closed this Dec 17, 2013
@wmtan
Copy link
Contributor Author

wmtan commented Dec 17, 2013

Help! I closed this accidentally! Please reopen!!!

@davidlt
Copy link
Contributor

davidlt commented Dec 17, 2013

Usually there should "reopen" button.

@wmtan
Copy link
Contributor Author

wmtan commented Dec 17, 2013

I've been through this before. I don't have the authority for a reopen button. None on my screen/
Anyway, I opened 1843 as a duplicate. Close one and merge the other.

@wmtan
Copy link
Contributor Author

wmtan commented Dec 17, 2013

The forcing of boost to use spinlocks should now be removed. It could cause other problems.

@davidlt
Copy link
Contributor

davidlt commented Dec 17, 2013

I only noticed performance regressions with spinlocks, which is fully expected for my eyes. Once we have the IB we could re-test if it fixes all boost related inline assembly cases.

@wmtan wmtan deleted the WorkaroundForROOT6Limitation branch December 18, 2013 20:00
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

3 participants