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

Tell ROOT how many thread to use #33038

Merged
merged 1 commit into from Mar 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion FWCore/Services/plugins/InitRootHandlers.cc
Expand Up @@ -21,6 +21,7 @@
#include "tbb/concurrent_unordered_set.h"
#include "tbb/task.h"
#include "tbb/task_scheduler_observer.h"
#include "tbb/global_control.h"
#include <memory>

#include <thread>
Expand Down Expand Up @@ -830,7 +831,9 @@ namespace edm {
// Enable Root implicit multi-threading
bool imt = pset.getUntrackedParameter<bool>("EnableIMT");
if (imt && not ROOT::IsImplicitMTEnabled()) {
ROOT::EnableImplicitMT();
//cmsRun uses global_control to set the number of allowed threads to use
// we need to tell ROOT the same value in order to avoid unnecessary warnings
ROOT::EnableImplicitMT(tbb::global_control::active_value(tbb::global_control::max_allowed_parallelism));
}
}

Expand Down