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

Indexing an array of size between 2^31 and 2^32-1 with LP64?

Yu_S_
Beginner
625 Views

I am working with spblas. My matrix dimension is about 300k, nnz is between 2^31 and 2^32-1. To keep the memory consumption as small as possible. I would like to use 32bit unsigned integer to index my element. Is it possible to do so with LP64 by defining MKL_INT as uint32_t? I tried it, but my program crashed with a segmentation fault when calling mkl_scsrmv.

0 Kudos
5 Replies
Henrik_A_
Beginner
625 Views

Changing the definition on your end will not change what MKL is expecting with LP64 defined.

0 Kudos
TimP
Honored Contributor III
625 Views

Henrik Arlinghaus wrote:

Changing the definition on your end will not change what MKL is expecting with LP64 defined.

I agree with this.  Simply changing your include file doesn't modify the libraries or change the basic mechanism, which doesn't support unsigned indexing in a useful manner.

0 Kudos
SergeyKostrov
Valued Contributor II
625 Views
>>...To keep the memory consumption as small as possible. I would like to use 32bit unsigned integer to index >>my element... Your input matrix is already big and I don't think that you will be able to save a significant amount of memory. Modern operating systems use Virtual Memory ( VM ) and why wouldn't you increase VM settings ( I mean Initial and Maximum sizes ) instead? It is Not clear on what platform and hardware you're going to do processing and please provide details if it is possible.
0 Kudos
Yu_S_
Beginner
625 Views

TimP (Intel) wrote:

Quote:

Henrik Arlinghauswrote:

Changing the definition on your end will not change what MKL is expecting with LP64 defined.

I agree with this.  Simply changing your include file doesn't modify the libraries or change the basic mechanism, which doesn't support unsigned indexing in a useful manner.

Thanks for the reply! So is there a way to get around this without making the indexing array to be 64bit because it is going to double the size? I tried compiling my program with ilp64 and define MKL_INT as uint32_t, but it did work either.

0 Kudos
Yu_S_
Beginner
625 Views

Sergey Kostrov wrote:

>>...To keep the memory consumption as small as possible. I would like to use 32bit unsigned integer to index
>>my element...

Your input matrix is already big and I don't think that you will be able to save a significant amount of memory. Modern operating systems use Virtual Memory ( VM ) and why wouldn't you increase VM settings ( I mean Initial and Maximum sizes ) instead? It is Not clear on what platform and hardware you're going to do processing and please provide details if it is possible.

Sorry for the confusion. I am working on a Linux 64bit machine. If I make the array element a type of 64bit integer, it will double the memory consumption and exceed my physical memory allowance.

0 Kudos
Reply