Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
omp_thread_max_ updated in one line
Browse files Browse the repository at this point in the history
  • Loading branch information
azai91 committed Oct 19, 2018
1 parent 49690ff commit 9a2b8d6
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/engine/openmp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,7 @@ void OpenMP::set_reserve_cores(int cores) {
CHECK_GE(cores, 0);
reserve_cores_ = cores;
#ifdef _OPENMP
if (reserve_cores_ >= omp_thread_max_) {
omp_thread_max_ = 1;
} else {
omp_thread_max_ -= reserve_cores_;
}
omp_thread_max_ = std::max(omp_thread_max_ - reserve_cores_, 1);
#endif
}

Expand Down

0 comments on commit 9a2b8d6

Please sign in to comment.