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

MKL part of code is not Parallelized

farzad_b_
Beginner
825 Views

Hi all,

I installed VS 2017 community with parallel_studio_xe_2018_update3_cluster_edition, student.

I use Fortran compiler for my programming. I successfully link MKL with my code and there is no problem in compiling and running. OpenMP part of my code with OpenMP flags is parallelized with no problem. But, my problem is the MKL part of the code which runs in a single thread. I have these options in the "configuration properties" of the project as seen in the attached pictures:

In Capture 3, I added the MKL library and parent compiler library:

 C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018.3.210\windows\mkl\lib\intel64_win and C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018.3.210\windows\compiler\lib\intel64_win

In Capture 4, I have these additional dependencies: 

libiomp5md.lib mkl_intel_lp64.lib mkl_blas95_lp64.lib mkl_core.lib mkl_intel_lp64.lib mkl_lapack95_lp64.lib mkl_intel_thread.lib mkl_tbb_thread.lib

 

I played a lot with these options to see any difference, but it was not successful. I should also mention that I have no problem in MKL parallelization in my Linux machine.

Any help is appreciated.

0 Kudos
5 Replies
TimP
Honored Contributor III
825 Views

If you call MKL in a parallel region, you are subject to the usual rules for nested OpenMP.  Then the default for MKL is 1 thread, on the assumption that you mean to run multiple MKL instances in parallel.

0 Kudos
TimP
Honored Contributor III
825 Views

dup

0 Kudos
farzad_b_
Beginner
825 Views

Tim P. wrote:

If you call MKL in a parallel region, you are subject to the usual rules for nested OpenMP.  Then the default for MKL is 1 thread, on the assumption that you mean to run multiple MKL instances in parallel.

 

Thanks for the response. My MKL part is not in the parallel region. for example,:

program band
  use lapack95
  use blas95
...
 

call heev(H,val,jobz='V')

I call this heev routine from MKL Lapack. But this part runs in a single thread. I have exact the same code runs in my Linux machine in parallel mode. I have the following makefile that I created for complilation in Linux:

OBJECTS = $(SOURCES:.f90=.o
FC = ifort ${FCOPT}
CFLAGS = -qopenmp -I$(MKLROOT)/include/intel64/lp64 -I$(MKLROOT)/include -mkl=parallel 
LDFLAGS = -nowarn $(MKLROOT)/lib/intel64/libmkl_blas95_lp64.a $(MKLROOT)/lib/intel64/libmkl_lapack95_lp64.a
exec: $(EXECUTABLE)

 

I assume changing the options in VS for mkl parallel should do the exact function as -mkl=parallel  flag in my makefile in the Linux system.

0 Kudos
TimP
Honored Contributor III
825 Views
I don't remember how recently mkl heev was parallelized.
0 Kudos
farzad_b_
Beginner
825 Views

Tim P. wrote:

I don't remember how recently mkl heev was parallelized.

 

The problem was the size of my matrix. So there is no problem in MKL parallelization.

Thank you for your time

0 Kudos
Reply