larroy commented on a change in pull request #16999: Prevent after-fork number 
of OMP threads being bigger than 1.
URL: https://github.com/apache/incubator-mxnet/pull/16999#discussion_r355861734
 
 

 ##########
 File path: src/engine/openmp.cc
 ##########
 @@ -83,10 +83,10 @@ void OpenMP::set_reserve_cores(int cores) {
 
 int OpenMP::GetRecommendedOMPThreadCount(bool exclude_reserved) const {
 #ifdef _OPENMP
-  if (omp_num_threads_set_in_environment_) {
-    return omp_get_max_threads();
-  }
   if (enabled_) {
+    if (omp_num_threads_set_in_environment_) {
+      return omp_get_max_threads();
+    }
 
 Review comment:
   looks that's implementation dependent. We should test more, but I think 
let's get this done first.

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


With regards,
Apache Git Services

Reply via email to