I'm trying to control the number of threads used by the fast poisson solver *_Helmholtz_3D. The code is compiled with -tbb and -mkl, and I'm using tbb::task_scheduler_init() function to control the thread count. However, this solver seem to be multithreaded regardless of the number of threads I tell tbb to use. How can I control this?
MKL Version 11.3.2
ICPC Version 2016.2.062
As I understand, in your case -tbb and -mkl, there are two kind of thread methods:
OpenMP (-mkl, by default mkl routine will use OpenMP thread)
tbb::task_scheduler_init() function to control the thread count. but it can't control the thread within MKL routine.
How about you to try
>export KMP_AFFINITY= verbose
>export OMP_NUM_THREADS=1 (Linux)
or set OMP_NUM_THREADS=1 (windows)
and see if there is any change.