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

MKL LAPACK problem - dsygv

physics314
Beginner
1,579 Views

I have a section of Fortran code that calls dsygv to solve a symmetric generalized eigenvalue problem. My code works fine under gfortran, and I have compiled it under the 32-bit version of the Intel Fortran compiler. When I compile it with the 64-bit libraries, I get an error. Here is my linker line:

ifort -openmp -parallel -o energy Energy.o -lmkl_intel_thread -lmkl_lapack -lmkl_core -lmkl_intel_ilp64 -lmkl_sequential -L/opt/intel/mkl/10.2.0.013/lib/em64t

The call to dsygv is
call dsygv(1, 'N', 'L', NumUsed+1, PhiHPhi8, NumTerms, PhiPhi8, NumTerms, Energies, Workspace, 3*NumTerms, Info)

And the error that it gives me is
MKL ERROR: Parameter 1 was incorrect on entry to DSYGV

According to all of the documentation that I have found, including the Intel MKL reference manual, the first parameter, itype, is 1, 2 or 3, based on the system being solved. Since this has worked fine until now, I'm really not sure what the problem is.

Thanks in advance for any help.

0 Kudos
4 Replies
Vladimir_Koldakov__I
New Contributor III
1,579 Views

Hi physics314,

Try to use lp64 version:-lmkl_intel_lp64 instead of -lmkl_intel_ilp64.

Or add -i8 compiler option.

Thanks,

Vladimir

0 Kudos
ArturGuzik
Valued Contributor I
1,579 Views

Hi,

adding to Vladimir's post. The reason you receive error is that you selected ilp64 interface (see your linking line). ILP64 libraries use the 64-bit integer type (necessary for indexing huge arrays). The default for your compiler is probably 32-bit integers, so that's why they conflict. The LP64 libraries index arrays with the 32-bit integer type, and that's why Vladimir's suggestion probably will solve the problem (of linking).

You have couple of scenarios to use:

(1) follow Vladimir's suggestion to replace lib interface

(2) follow Vladimir's suggestion to change your default for compiler (for x64 architecture)

(3) make local integer*8 variable and pass it. This however, will make the code not "architecture blind". To resolve this you can also try compiler directives, though.

A.

0 Kudos
physics314
Beginner
1,579 Views
Thanks, using -lmkl_intel_lp64 instead fixed it. Also, thanks to both of you for the remarkably quick answers.
0 Kudos
IDZ_A_Intel
Employee
1,579 Views
Hi,
I am trying to call magma_dsygvd from a fortran code and when I link to the MKL library I get the foll errors for different runs:
[krajag1@kid034 MAGMA]$ ./magmatest3
DSYGVD Example Program Results
4
LIWORK = 53
LWORK = 901
LDA = 10
LDB = 10
MKL ERROR: Parameter 1 was incorrect on entry to magma_dsygvd
[krajag1@kid034 MAGMA]$ ./magmatest3
DSYGVD Example Program Results
4
LIWORK = 53
LWORK = 901
LDA = 10
LDB = 10
MKL ERROR: Parameter 11 was incorrect on entry to magma_dsygvd
Optimum workspace required = ****
Workspace provided = 901
Note: I have passed an integer*8 variable for parameter 1.
Please find enclosed my code and makefile for reference.
Thanks,
Kaushik
0 Kudos
Reply