Add TBB-based counter for global read-write lock#7260
Add TBB-based counter for global read-write lock#7260pcanal merged 5 commits intoroot-project:masterfrom
Conversation
|
Can one of the admins verify this patch? |
|
@phsft-bot build! |
|
Starting build on |
|
Build failed on ROOT-performance-centos8-multicore/default. Failing tests: |
|
Build failed on ROOT-fedora30/cxx14. Failing tests: |
|
Build failed on ROOT-ubuntu16/nortcxxmod. Failing tests: |
|
Build failed on mac1014/python3. Failing tests: |
|
Build failed on ROOT-fedora31/noimt. Failing tests: |
|
Build failed on mac11.0/cxx17. Failing tests: |
|
Build failed on windows10/cxx14. |
|
|
Currently the usage of TBB in core/thread is triggered by the availability of tbb in the build (standalone or builtin). Should the criteria be something different/more selective? (or is there some other switch which needs to be triggered in the windows build for this case?) |
|
Alternatively this could be steered by whether the build is done with implicit multithreading enabled, rather than directly checking the availability of TBB (since this seems to not be sufficient in the windows case) Thoughts? |
|
I suspect that instead we should still rely on detecting the availability of TBB but disable this feature on Windows, at least for now. (I.e. the condition is "has a TBB and not on Windows"). |
|
Alright, done. |
core/thread/test/CMakeLists.txt
Outdated
| ROOT_ADD_UNITTEST_DIR(Core Thread Hist ${TBB_LIBRARIES}) | ||
|
|
||
| ROOT_ADD_GTEST(testTThreadedObject testTThreadedObject.cxx LIBRARIES Hist) | ||
| ROOT_ADD_GTEST(testTThreadedObject testTThreadedObject.cxx LIBRARIES Hist ${TBB_LIBRARIES}) |
There was a problem hiding this comment.
Why is this needed? Isn't tbb already linked through libThread (and/or libImt)?
There was a problem hiding this comment.
Yes I think you're right, will remove it.
|
@phsft-bot build with flags -DCTEST_TEST_EXCLUDE_NONE=On |
|
Starting build on |
|
Build failed on ROOT-ubuntu16/nortcxxmod. Failing tests: |
|
Build failed on ROOT-debian10-i386/cxx14. Failing tests: |
|
Build failed on windows10/cxx14. Failing tests: |
bc19562 to
da2cf1b
Compare
|
Updated to remove the unnecessary bits from the CMakeLists for the tests. |
|
@bendavid I think this is good to go except for adding some trace in the repository (either commit or, probably better, in the release notes) of the performance improvement. |
|
Thanks, I propose to add the relevant information to the release notes in a separate PR (mainly to avoid an otherwise unnecessary rebase before merging) |
|
Fair enough :) |
|
In the subsequent PR, consider also applying the formatting recommendation at: https://travis-ci.org/github/root-project/root/jobs/763450064 |
This covers the changes in root-project#6857 root-project#7105 root-project#7260
This covers the changes in root-project#6857 root-project#7105 root-project#7260
This covers the changes in root-project#6857 root-project#7105 root-project#7260
A long time ago, ROOT had a `tbb` build option, but it was removed in the ROOT 6.08 development cycle in dd899a5 from 2015, by @peremato. However, some build configurations still use it, like CMSSW and Conda: * https://github.com/cms-sw/cmsdist/blob/IB/CMSSW_15_1_X/master/root.spec#L78 * https://github.com/conda-forge/root-feedstock/blob/main/recipe/build_root.sh#L342 That would not be a problem per se, but then, in 2021, @bendavid introduced a new optimization that is enabled only with the long-time removed `tbb` flag (or `builtin_tbb`), in 6c8b77d: * root-project#7260 So we ended up with a secret `tbb=ON` configuration that our CI doesn't test, and a CMake configuration option that has a pretty fundamental effect but is not documented. In the discussions in root-project#19798 with @bendavid, we concluded that it would not be a problem to enable the optimized locks with TBB always when TBB is available during the ROOT build. See: root-project#19798 (comment) Closes root-project#19798.
A long time ago, ROOT had a `tbb` build option, but it was removed in the ROOT 6.08 development cycle in dd899a5 from 2015, by @peremato. However, some build configurations still use it, like CMSSW and Conda: * https://github.com/cms-sw/cmsdist/blob/IB/CMSSW_15_1_X/master/root.spec#L78 * https://github.com/conda-forge/root-feedstock/blob/main/recipe/build_root.sh#L342 That would not be a problem per se, but then, in 2021, @bendavid introduced a new optimization that is enabled only with the long-time removed `tbb` flag (or `builtin_tbb`), in 6c8b77d: * #7260 So we ended up with a secret `tbb=ON` configuration that our CI doesn't test, and a CMake configuration option that has a pretty fundamental effect but is not documented. In the discussions in #19798 with @bendavid, we concluded that it would not be a problem to enable the optimized locks with TBB always when TBB is available during the ROOT build. See: #19798 (comment) Closes #19798.
Adds TBB-based counter types for global read-write locks and use one by default when TBB is available.
This gives a 7% speedup in a medium sized test filling histograms from CMS NanoAOD with RDF and 256 threads.
This implements the last part of the improvements originally discussed in #6919