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

Memory Management with MKL

nansal
Beginner
634 Views

Hi there,

I have a serious problem with memory management of MKL. And it is essential for me to overcome to this problem.

In my Fortran language program (in Linux), I have one matrix with dimension of A(TRINATOM,TRINATOM) (TRINATOM=23826); that after running of the program, I have this message:

Fortcom: ERROR: myprog.for, Line 17: A common block or variable may not exceed 2147483647 bytes.

So I try to use memory management with MKL. First of all I introduced the matrix 'A' by POINTER instead of DIMENSION as bellow:

POINTER (A_PTR, A(23826,23826))

But after running, I have the same previous ERROR.

After that, I tried with:

POINTER A(:,:)

ALLOC_SIZE=4*2147483647

A=MKL_MALLOC(ALLOC_SIZE,128)


CALL dgetrf(NRED,NRED,A,TRINATOM,ipiv,info)

CALL MKL_FREEBUFFERS

CALL dgetrs('N',NRED,1,A,TRINATOM,ipiv,FRED,NRED,info)

CALL MKL_FREEBUFFERS

ALLOCATED_BYTES=MKL_MEMSTAT(ALLOCATED_BUFFERS)

But I have this message:

Forrtl: Severe (408): fort (7): Attempt to use pointer A when it is not associated with a target.

I really appreciate your helps.

0 Kudos
3 Replies
TimP
Honored Contributor III
634 Views
OK, some opinions, as I haven't tried anything like this. You will need 64-bit linux and MKL to deal with this. There is an example
http://www.intel.com/software/products/mkl/docs/WebHelp/support/spt_MemExample.html
about using MKL_MALLOC in Fortran, which would show you some of what you missed. The simplest way to go about it might be with an ALLOCATABLE array, not using MKL_MALLOC.
0 Kudos
nansal
Beginner
634 Views
Quoting - tim18
OK, some opinions, as I haven't tried anything like this. You will need 64-bit linux and MKL to deal with this. There is an example
http://www.intel.com/software/products/mkl/docs/WebHelp/support/spt_MemExample.html
about using MKL_MALLOC in Fortran, which would show you some of what you missed. The simplest way to go about it might be with an ALLOCATABLE array, not using MKL_MALLOC.

Hi,

I really appreciate your attention, Tim.

I have already checked my program with this example and think that I have not missed anything.

Also, I have applied the ALLOCATABLE array as bellow:

ALLOCATABLE A(:,:)

ALLOCATE (A(23826,23826))

After running the program at the line of ALLOCATE statement, I had this message

Forrtl: severe (179): cannot allocate array-overflow on array size calculation

Do you have any idea for this problem due to ALLOCATE statement?

Thank you again,

And I am really looking forward to any help.


0 Kudos
TimP
Honored Contributor III
634 Views
Quoting - nansal
Also, I have applied the ALLOCATABLE array as bellow:

ALLOCATABLE A(:,:)

ALLOCATE (A(23826,23826))

After running the program at the line of ALLOCATE statement, I had this message

Forrtl: severe (179): cannot allocate array-overflow on array size calculation


You need 64-bit integers to take advantage of 64-bit OS (23826_8, if you don't care about portability). You should also set up your ALLOCATE to display the ERRMSG when it fails.
0 Kudos
Reply