azai91 commented on a change in pull request #12380: Manually track num_max_thread URL: https://github.com/apache/incubator-mxnet/pull/12380#discussion_r214099365
########## File path: src/engine/openmp.cc ########## @@ -74,17 +74,17 @@ void OpenMP::set_reserve_cores(int cores) { reserve_cores_ = cores; #ifdef _OPENMP if (reserve_cores_ >= omp_thread_max_) { - omp_set_num_threads(1); + omp_thread_max_ = 1; } else { - omp_set_num_threads(omp_thread_max_ - reserve_cores_); + omp_thread_max_ -= reserve_cores_; Review comment: isn't this atomic? ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services