Skip to content

Commit

Permalink
Use omp_get_max_threads() when OMP_NUM_THREADS environment variable i…
Browse files Browse the repository at this point in the history
…s set (apache#8379)
  • Loading branch information
cjolivier01 authored and crazy-cat committed Oct 26, 2017
1 parent 790e6fc commit 2455b4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/engine/threaded_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ class ThreadedEngine : public Engine {
// Otherwise, return the number of processors, not counting hyperthreading.
// Test for set OMP_NUM_THREADS by checking against some nonsensical value
const int max_threads = dmlc::GetEnv("OMP_NUM_THREADS", INT_MIN) == INT_MIN ?
omp_get_num_procs() : omp_get_num_threads();
omp_get_num_procs() : omp_get_max_threads();
return max_threads;
#else
return 1;
Expand Down

0 comments on commit 2455b4f

Please sign in to comment.