You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/12/03 21:21:31 UTC

[GitHub] anirudh2290 commented on a change in pull request #13501: Revert "Manually track num_max_thread (#12380)"

anirudh2290 commented on a change in pull request #13501: Revert "Manually track num_max_thread (#12380)"
URL: https://github.com/apache/incubator-mxnet/pull/13501#discussion_r238441851
 
 

 ##########
 File path: src/engine/openmp.cc
 ##########
 @@ -73,14 +73,18 @@ void OpenMP::set_reserve_cores(int cores) {
   CHECK_GE(cores, 0);
   reserve_cores_ = cores;
 #ifdef _OPENMP
-  omp_thread_max_ = std::max(omp_thread_max_ - reserve_cores_, 1);
+  if (reserve_cores_ >= omp_thread_max_) {
+    omp_set_num_threads(1);
+  } else {
+    omp_set_num_threads(omp_thread_max_ - reserve_cores_);
 
 Review comment:
   this shouldnt cause a problem since omp_thread_max_ doesnt change. For example, for a 16 core machine, and eight GPU workers , the num threads for all of them will be set to 14. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services