Skip to content

Commit

Permalink
Merge pull request #45043 from mmusich/mm_fix_44923_in_14_0_X
Browse files Browse the repository at this point in the history
[14.0.X] `PhotonXGBoostEstimator` : set `XGBoost` to use one thread to avoid spawning hundreds of OpenMP threads
  • Loading branch information
cmsbuild authored and smuzaffar committed May 27, 2024
1 parent 77c6c38 commit f40fd9a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions RecoEgamma/PhotonIdentification/src/PhotonXGBoostEstimator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

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

Expand Down

0 comments on commit f40fd9a

Please sign in to comment.