fix: replace hardcoded kNumThreads with ROOT::EnableImplicitMT()#95
Merged
fix: replace hardcoded kNumThreads with ROOT::EnableImplicitMT()#95
Conversation
common_bench/mt.h defines kNumThreads=8 as a compile-time constant, which ignores $BENCHMARK_N_THREADS from env.sh (default: 10). This is inconsistent with every other analysis script in both benchmark repos, which already use ROOT::EnableImplicitMT() with no argument. Replace ROOT::EnableImplicitMT(kNumThreads) with the no-arg form in: - dvmp/analysis/vm_mass.cxx - dvmp/analysis/vm_invar.cxx - Inclusive/dis/analysis/dis_electrons.cxx ROOT's no-arg EnableImplicitMT() auto-selects the optimal thread count for the available hardware, which is strictly better for CI runners. This also removes the last users of common_bench/mt.h, allowing that header to be deleted from common_bench. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes ROOT implicit multithreading configuration in a few benchmark analyses by removing use of a hardcoded thread-count constant and letting ROOT choose the default thread pool size.
Changes:
- Replace
ROOT::EnableImplicitMT(kNumThreads)withROOT::EnableImplicitMT(). - Remove the now-unneeded
#include "common_bench/mt.h"from the affected analyses.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| benchmarks/Inclusive/dis/analysis/dis_electrons.cxx | Switch to default ROOT implicit MT and drop common_bench/mt.h include. |
| benchmarks/Exclusive-Diffraction-Tagging/dvmp/analysis/vm_mass.cxx | Switch to default ROOT implicit MT and drop common_bench/mt.h include. |
| benchmarks/Exclusive-Diffraction-Tagging/dvmp/analysis/vm_invar.cxx | Switch to default ROOT implicit MT and drop common_bench/mt.h include. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
veprbl
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
common_bench/mt.hdefines a single compile-time constantkNumThreads = 8, which was used in three analysis scripts to limit ROOT's implicit multithreading. This value:$BENCHMARK_N_THREADSfromenv.sh(CI default: 10)detector_benchmarksandphysics_benchmarksalready callsROOT::EnableImplicitMT()with no argumentROOT::EnableImplicitMT()with no argument tells ROOT to use all available hardware threads, which is the correct behavior for CI runners where you want maximum utilization.Changes
In three files, replace
ROOT::EnableImplicitMT(kNumThreads)→ROOT::EnableImplicitMT()and remove#include "common_bench/mt.h":benchmarks/Exclusive-Diffraction-Tagging/dvmp/analysis/vm_mass.cxxbenchmarks/Exclusive-Diffraction-Tagging/dvmp/analysis/vm_invar.cxxbenchmarks/Inclusive/dis/analysis/dis_electrons.cxxRelated
This removes the last users of
common_bench/mt.h, allowing it to be deleted: eic/common_bench#4