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

How to avoid out of memory problem about the mkl syevd?

wang__ningning
Beginner
1,503 Views

When I use the syevd function in mkl of fortran to calculate the eigenvalues and eigenvectors in my linux system, there are some troubles. Sometimes, the system will send message "Intel MKL INTERNAL ERROR: Insufficient workspace available in function SYEVD" or rerurn info=-1000, then the eigenvalues are all zeros. Those show that the computer is running out of memory. But the memory of my linux system is 125G and there are no other processes that take up memory. My matirx is 20000*20000 and is it really due to the insufficient memory?

0 Kudos
8 Replies
Gennady_F_Intel
Moderator
1,503 Views

It should fit with this size of RAM. When you set work = -1, then check the working array size would be returned by this function. The problem might be how much free memory available on your system when you run this code?

0 Kudos
Gennady_F_Intel
Moderator
1,503 Views

I built the dsyevd example and added mkl_peak_mem_usage to report the peak memory allocated by mkl's syevd:

here is the output:

./a.out 20000
lwork == 800120001  <- size of the working array
... dsyevd passed with the status == 0...
..Currently allocated by Intel(R) MKL allocator : 10449815140 bytes in   96 buffers.

 

0 Kudos
wang__ningning
Beginner
1,495 Views

Gennady F. (Blackbelt) wrote:

I built the dsyevd example and added mkl_peak_mem_usage to report the peak memory allocated by mkl's syevd:

here is the output:

./a.out 20000
lwork == 800120001  <- size of the working array
... dsyevd passed with the status == 0...
..Currently allocated by Intel(R) MKL allocator : 10449815140 bytes in   96 buffers.

 

Thank you for your reply, now I ues the syevd function just as: call syevd(C,W,'V','U',info).  This function is different with the dsyevd and has no parameter lwork. So how to aviod the memory problem. And the linux system has no other program running in the same time. 

0 Kudos
Gennady_F_Intel
Moderator
1,495 Views

the memory consumption should be the same 

0 Kudos
Gennady_F_Intel
Moderator
1,503 Views

I build the trivial example of SYEVD API and ran on the machine with 128 Gb of RAM. Everything works as expected

$ ./a.out
 SYEVD Example, Problem size ==        20000
 ...SYEVD start...
 ...SYEVD finish, Status ==            0
 

0 Kudos
Gennady_F_Intel
Moderator
1,503 Views

the same with verbose mode enabled:

$ ./a.out
 SYEVD Example, Problem size ==        20000
 ...SYEVD start...
MKL_VERBOSE Intel(R) MKL 2020.0 Product build 20191122 for Intel(R) 64 architectenabled processors, Lnx 2.80GHz lp64 intel_thread
MKL_VERBOSE SSYEVD(V,L,20000,0x2acabe264200,20000,0x2acabc9f6240,0x7ffe41ad3da0,ID:0  NThr:20
MKL_VERBOSE SSYEVD(V,L,20000,0x2acabe264200,20000,0x2acabc9f6240,0x2acb1e2652c0,800120064,0x2acabca0a280,100003,0) 127.43s CNR:OFF Dyn:1 FastMM:1 TID:0  NThr:20
 ...SYEVD finish, Status ==            0
 

 

0 Kudos
mecej4
Honored Contributor III
1,495 Views

Ningning Wang: I suspect that you are making a rather basic mistake, which we could have readily pointed out if you had shown us enough of your code to enable doing so.

The routine name SYEVD is a generic name for two specific names, and has the calling sequence

          call syevd(a, w [,jobz] [,uplo] [,info])

An argument list with optional arguments implies that the caller must be provided with an interface to the routine SYEVD. Without that interface, the call will fail in mysterious ways. You must either add a USE LAPACK95 statement at the beginning of the subprogram or main program from which you call the generic SYEVD, or provide an interface for SYEVD in another way. See Fortran 95 Interface Conventions for LAPACK Routines in the MKL Developer Reference.

0 Kudos
CCheng_LZU
Beginner
1,386 Views

I also met this kind of problem for large matrices. 

I guess you were using the old LAPACK 95 interface for Fortran or the C interface, where the function dsyevd() or LAPACKE_dsyevd() has simpler form. If you use the (not so) new Fortran interface, you will see the function with more parameters, some of which control/affect the memory usage. Please check dsyevd Example (intel.com) for more information. 

0 Kudos
Reply