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

mkl_ddnscsr I/LP64 behavior [solved]

Nicholas_K_2
Beginner
800 Views

In MKL 10.3.6, when linking with LP64, the routine mkl_ddnscsr segfaults when attempting to write a dense matrix (job[0]=1) with more than about 231 (i.e. INT_MAX) entries. When linking with ILP64, there is no error. I did not see this behavior mentioned in the documentation, is it expected? ANSWER: YES (see MKL User's Guide)

The attached test code attempts to create the dense matrix eN * eNT (i.e. an N-by-N zero matrix with a 1 in the lower right corner) from its CSR representation.

Platform: 64-bit Linux, Composer XE 2011 (sp1.6.233), MKL 10.3.6, 4x10 Westmere-EX with 128GB RAM

To build, do

$ source compilervars.sh intel64

then after downloading the two files, type

$ mv Makefile.txt Makefile; make

Running 

$ ./test_lp64 46341

succeeds, while

$ ./test_lp64 46342

 produces a segfault on my platform; the ILP64 version

$ ./test_ilp64 46342

succeeds. Note that N = 46341 ~= (231)1/2 ~= (INT_MAX)1/2, which seems to be related.

I notice that there was a bug fix in the more recent version 10.3.12 (DPD200292943) concerning mkl_?dnscsr, when working with an upper triangular matrix. I am working with a full matrix so I assume this is unrelated.

Thanks!

0 Kudos
1 Solution
Gennady_F_Intel
Moderator
800 Views
" I did not see this behavior mentioned in the documentation..." - that's not correct, please refer to the mkl User's Guide - Using the ILP64 Interface vs. LP64 Interface

View solution in original post

0 Kudos
2 Replies
mecej4
Honored Contributor III
800 Views
"... the routine mkl_ddnscsr segfaults when attempting to write a dense matrix with more than about 2^31 (i.e. INT_MAX) entries I did not see this behavior mentioned in the documentation, is it expected?" The LP64 library routines would have been compiled with 4-byte integers for array indices and integer variables used as loop counters. Failures in the routines should be expected when 4-byte integers are no longer sufficient for the current problem size.
0 Kudos
Gennady_F_Intel
Moderator
801 Views
" I did not see this behavior mentioned in the documentation..." - that's not correct, please refer to the mkl User's Guide - Using the ILP64 Interface vs. LP64 Interface
0 Kudos
Reply