Skip to content

Commit

Permalink
Merge pull request #33038 from Dr15Jones/silenceRootThreadWarning
Browse files Browse the repository at this point in the history
Tell ROOT how many thread to use
  • Loading branch information
cmsbuild committed Mar 3, 2021
2 parents 31994b9 + c8d1782 commit 0303e2c
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit 0303e2c

Please sign in to comment.