Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
7234 Discussions

dsyevd does not return correct value on query

exihea
Beginner
1,168 Views

I have a small piece of code that works fine with old MKL library, but the fails with the new one
-----------------------------------------------------------------------
int lwork = -1;
int liwork = -1;
double* work = (double*)malloc( sizeof(double));
int* iwork = (int*)malloc(sizeof(int));
dsyevd(&jobs, &uplo, &dim, Matrix, &dim, d, work, &lwork, iwork, &liwork, &info);
lwork = (int)(work[0]);
liwork = *iwork;
printf("required lwork=%d, liwork=%d\n", lwork, liwork);
-------------------------------------------------------------------------
For the case of dim =4, the correct result returned from the old MKL:
"required lwork=57, liwork=23"
But with the new MKL
"required lwork=-2147483648, liwork=23"

If I manually set the lwork/liwork value to the correct values and call dsyevd() to solve the problem, it gives error message:
"MKL ERROR: Parameter 8 was incorrect on entry to DSYEVD"

I could not tell exactly which version the new MKL library is, here is the linked libraries for the new one:
-Wl,--start-group -lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread

Any suggestions are welcome.
thanks

0 Kudos
6 Replies
TimP
Honored Contributor III
1,168 Views
You have specified the 64-bit integer ilp64 interface, but you pass 32-bit int scalar references and arrays. I guess your example worked when you specified 32-bit integers (lp64 for the 64-bit libraries, no choice for 32-bit libraries).
0 Kudos
Gennady_F_Intel
Moderator
1,168 Views

For compiling with ilp64 interfaces
ifort -i8 -I/include

How you can find out the version info:
For the standalone package:
please see into the docmklsupport.txt file )
you can find there smth like Package ID: l_mkl_p_10.2.1.017

for the bundled version of mkl ( Intel Compiler Professional Edition ):
see into csupport.txt or fsuppor.txt files ( Documentation folder )

--Gennady
0 Kudos
exihea
Beginner
1,168 Views

For compiling with ilp64 interfaces
ifort -i8 -I/include

How you can find out the version info:
For the standalone package:
please see into the docmklsupport.txt file )
you can find there smth like Package ID: l_mkl_p_10.2.1.017

for the bundled version of mkl ( Intel Compiler Professional Edition ):
see into csupport.txt or fsuppor.txt files ( Documentation folder )

--Gennady

Do I use the same "-i8" for icc?
( my machine is down for the moment otherwise I could just try it)
Thanks for info about how to find the version

0 Kudos
exihea
Beginner
1,168 Views
Quoting - tim18
You have specified the 64-bit integer ilp64 interface, but you pass 32-bit int scalar references and arrays. I guess your example worked when you specified 32-bit integers (lp64 for the 64-bit libraries, no choice for 32-bit libraries).

I thought the 64bit meaned you compile it with -m64 (default).
What library should I link to if I want to use 32 bit integer? I do not see anything like libmkl_intel_ilp32.so

thanks
0 Kudos
exihea
Beginner
1,168 Views
Quoting - exihea

I thought the 64bit meaned you compile it with -m64 (default).
What library should I link to if I want to use 32 bit integer? I do not see anything like libmkl_intel_ilp32.so

thanks

OK, I linked to libmkl_intel_lp64.so and everything works fine now.
Thank you all for help
-Guochun

0 Kudos
Gennady_F_Intel
Moderator
1,168 Views
Quoting - exihea

OK, I linked to libmkl_intel_lp64.so and everything works fine now.
Thank you all for help
-Guochun


Guochun,
for building ilp64 libraries with Intel C++ compiler, please try to use /MKL_ILP64 preprocessor definition.
--Gennady
0 Kudos
Reply