Skip to content

Commit a50a5d7

Browse files
authored
Merge pull request #45042 from mmusich/mm_fix_44923
`PhotonXGBoostEstimator` : set `XGBoost` to use one thread to avoid spawning hundreds of OpenMP threads
2 parents 1234e95 + 23a0326 commit a50a5d7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

RecoEgamma/PhotonIdentification/src/PhotonXGBoostEstimator.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
PhotonXGBoostEstimator::PhotonXGBoostEstimator(const edm::FileInPath& weightsFile, int best_ntree_limit) {
55
XGBoosterCreate(NULL, 0, &booster_);
6+
// Set number of threads to 1, to avoid spawning hundreds of OpenMP threads
7+
// See https://github.com/cms-sw/cmssw/issues/44923 for details
8+
XGBoosterSetParam(booster_, "nthread", "1");
69
XGBoosterLoadModel(booster_, weightsFile.fullPath().c_str());
710
best_ntree_limit_ = best_ntree_limit;
811

0 commit comments

Comments
 (0)