OpenMP thread number AND MKL thread number

OpenMP thread number AND MKL thread number


I've run openmp code using 8 cores, and I've compiled with -mkl tag.

My openmp code calculates simultaneously each job.(calculation of each thread contain MKL function - dgemm)

Then, I wonder how MKL thread is generated for openmp job.

For example, I use 8 omp_threads for 8 cores(8 calculation run simultaneously, and 8 MKL function run simultaneously)

  => How MKL thread number is generated?(I know that MKL is based on OpenMP threads.)

Only one mkl thread per each one omp thread? 

(I've checked this using VTUNE, and it's look like mkl is generated only thread each openmp thread in this case.)

4 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

If you call MKL from an OpenMP parallel region, but don't set OMP_NESTED, the MKL functions will not generate additional threads.  You could have used the -mkl sequential link option.

Thank Tim

I've compiled only using -mkl(using parallel studio 2013), and I didn't use OMP_NESTED keyword in my codes.

You mean that my case 

-mkl is equal to mkl=sequential  ??

No, -mkl defaults to threaded.  If you want sequential, you must specify it. 

As I said, the OpenMP library itself should prevent threaded MKL from starting additional threads inside a parallel region unless OMP_NESTED is set.  So it should not make a great deal of difference.

Laisser un commentaire

Veuillez ouvrir une session pour ajouter un commentaire. Pas encore membre ? Rejoignez-nous dès aujourd’hui