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

Lapack or Scalapack on Windows using Visual Studio and Intel Quad processor

krabica
Beginner
882 Views
My program written in Fortran77 is serial, but I would like to use parallel routines either from Lapack/blas or ScaLapack to diagonalize real symmetric matrices in packed storage.

How shoul I set up proper options in MS Visual Studio with installed Intel Visual Fortan and Intel Math Kernel library in order to use all 4 processor on Intel Quad processor to solve eigenvalues problem?

I am very thankfull for any help.
0 Kudos
4 Replies
Todd_R_Intel
Employee
882 Views
The User Guide has a list of the routines in MKL that have been parallelized. I see ?sptrd has been threaded so you might start there. The reference manual will be off help, but also the LAPACK user's guide on netlib.org. Links to these can be found on our documentation site. The MKL User Guide also has information on using MS Visual Studio to link your program to MKL. Note that with version 10 of MKL you can use the MKL_NUM_THREADS environment variable or mkl_set_num_threads() function to explicitly set the number of threads. In formation on controlling parallelism is also in the User Guide.

-Todd

0 Kudos
krabica
Beginner
882 Views
Thank you for your general help.
I have had set in MS Windows through Control panel these:
MKL_NUM_THREADS=4
MKL_DOMAIN_NUM_THREADS="MKL_ALL=1, MKL_BLAS=4"

and compiled program which calls LAPACK eigenvalue subroutines (DSPEV or ZHPEV) using:
ifort /nologo /O3 /QaxT /Qparallel /assume:buffered_io /module:&quotRelease" /object:&quotRelease" /libs:static /threads /c /extfor:f /Qvc8 /Qlocation,link,&quotC:Program Files (x86)Microsoft Visual Studio 8VCin" 

and linked
Linking...
Link /OUT:&quotReleasemagnet2.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:&quotc:Program FilesIntelMKL10.0.3.021ia32lib" /MANIFEST /MANIFESTFILE:&quotC:UsersRadovanDocumentsVisual Studio 2005Projectsmagnet2 eleasemagnet2.exe.intermediate.manifest" /SUBSYSTEM:CONSOLE /IMPLIB:&quotC:UsersRadovanDocumentsVisual Studio 2005Projectsmagnet2 eleasemagnet2.lib" mkl_c.lib libguide.lib mkl_lapack.lib mkl_intel_thread.lib mkl_blacs_intelmpi.lib &quotRelease spall.obj" &quotReleasemag06terms.obj"

As a result, the diagonalization of matrices runs ONLY using one processor.
What is wrong?

0 Kudos
Todd_R_Intel
Employee
882 Views
Looks like you have threading controls set, and the libraries you have on the link line look okay. You could clean the link line up a little by removing mkl_c.lib and mkl_lapack (which are compatibility libs, or cues for the linker really) and adding mkl_intel_c.lib and mkl_core.lib.

The remaining things I could think of is that possibly the case for your problem hasn't actually been threaded, or your problem size is not big enough to be worth trying multiple threads, or maybe there's a bug. Submitting an issue with source code that reproduces your problem would give us the details need to track this down.
0 Kudos
Michael_C_Intel4
Employee
882 Views

I would add that only some parts of DSPEVare actually threaded, so a lack of scaling could be observed.

Also, you may set only MKL_NUM_THREADS=4 - it would be enough.

If you have enough memory you may try to unpack matrix and use DSYEV instead, it should be faster.

0 Kudos
Reply