Skip to content

Commit

Permalink
Tell ROOT how many thread to use
Browse files Browse the repository at this point in the history
This is meant to silence a ROOT warning.
  • Loading branch information
Dr15Jones committed Mar 2, 2021
1 parent 9f197f8 commit c8d1782
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 c8d1782

Please sign in to comment.