Closed abhinavagarwal07 closed 6 years ago
See https://eigen.tuxfamily.org/dox/TopicMultiThreading.html
If you are calling from C++, it might work to use the setNbThreads
from Eigen. Let me know if it doesn't.
Default is using all threads.
Bit late to the party here, but in C++ you can use
omp_set_num_threads(int nThreads)
omp_set_dynamic(false)
The former will set the maximum number of threads that OMP will use. The latter says that OMP will always use the maximum number of threads. OMP will try to 'smartly' distribute the load without this set, meaning it may only use 3 or 4 threads out of a maximum of 8 (for example). I've found it to be a bit unpredictable with expensive objective functions, so I set it to false.
How to limit maximum number of threads running concurrently?