Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

OMP_NUM_THREADS and MKL

valera_veryazov
Beginner
378 Views
Hi,
being a novice with MKL usage on DualCore machine, I am completely confused...

I have a FORTRAN code, which is dominated by BLAS/LAPACK calls, no OMP pragmas.
The code is compiled by ifort with -openmp, and linked to MKL library.
Running this code with no OMP_NUM_THREADS set, or with =1, I got faster time comparing with run with OMP_NUM_THREADS=2.

I thought that I will see an improvement, by allowing MKL to use 2 cores, but the result is oposite.
What can be wrong??


0 Kudos
2 Replies
izryu
Beginner
378 Views

Hi,

May be the problem is with your method of measuring running time. If you are using cpu_time(), then take into account that this function returns total time consumed on both CPU's, e.g. if your program ran for 1 minute with total load of both processors, this function will return 2 minutes (1 min for one CPU +1 min for another one), which would compare unfavorably to the running time on 1 CPU due to some overhead.

0 Kudos
valera_veryazov
Beginner
378 Views
Thanks! It was indeed my stupidity - to look at CPU time :(
0 Kudos
Reply