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

using dlasrt2 with (4byte) integer keys on ILP64

seyedalireza_y_
Beginner
398 Views

Hi, I've been using dlasrt2 with the API

void dlasrt2 (char *id , MKL_INT *n , double *d , MKL_INT *key , MKL_INT *info );

however i wonder if we can link directly to fortran counterpart to have int keys or if there is a way to feed (4byte) integer variables to this function as keys, the issue is that right now MKL_INT is a (long long) which takes huge amount of memory for the case i'm running where n=1e10. However i need MKL_INT to be ilp64 because of other calls (dgemm with huge matrix size).

 

Thanks,

Alireza

0 Kudos
2 Replies
Zhen_Z_Intel
Employee
398 Views

Hi,

The problem is, if you write these two functions into one source code, even you redefine MKL_INT to size_t that use int for ?lasrt, and use long long for ?gemm, you must link lp64 or ilp64 translating source code as binary to execute. How could you set some part to use 32bits but the other part to use 64bits within one binary file? Once you compile with 64bits, the INT type will be actually translated into int64, and it could not support for 32bit compiling & translation.

You could only separate these two function into two source files, one is compiled with lp64 to generate 32bit binary & the other one is compiled with ilp64 to generate 64bit binary. And execute two binary files.

Best regards,
Fiona

0 Kudos
seyedalireza_y_
Beginner
398 Views

Thanks for your thorough explanation. In the 64bit program I was hoping to just use regular int variable which is still 4bytes in the 64bit code and link to scalapack with lp64 for the ?lasrt2 ,  and for ?gemm use long long and link to mkl_intel_ilp64, as i thought the difference would be just how the mkl (lp64) interprets integer argument it won't be an issue because those arguments would already be defined using 4byte integers.

0 Kudos
Reply