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

memory increasing problem calling pardiso!

liubing84
Beginner
273 Views
Hi,
here is the exact description of my problem: In loops(up to more than 2,000,000),i need to call MKL Pardiso to calculate Ax=b, but when running my program, i find the memory is increasing all the time till the program has to stop.

Incidentally, i use MKL IA-32, static MKL, three libraries: libguide.lib mkl_c.lib mkl_solver.lib are linked.

The following subroutine is called in loops:
subroutine Solver_MF2(N,A,B)
IMPLICIT NONE
integer(kinD=4)::N
real(kind=8),dimension(N,N)::A
real(kind=8),dimension(N)::B
real(kind=8),dimension(N)::X

INTEGER*8 pt(64)
INTEGER maxfct, mnum, mtype, phase, nrhs, error, msglvl
INTEGER iparm(64)
integer,dimension(N+1)::ia
integer,allocatable::ja(:)
REAL*8,ALLOCATABLE::A_A(:)

INTEGER I,j,K,IDUM
REAL*8 waltime1, waltime2, ddum

DATA nrhs /1/, maxfct /1/, mnum /1/
K=0
do j=1,N
DO i=1,N
IF (A(I,J).NE.0.0) THEN
K=K+1
END IF
END DO
end do

ALLOCATE(A_A(K));ALLOCATE(JA(K))
A_A=0.0;JA=0;K=0;i=1
K=0;i=1
IA(I)=1
do i=1,N
DO J=1,N
IF(A(I,J).NE.0.0) THEN
K=K+1
A_A(K)=A(I,J)
JA(K)=J
END IF
END DO
IA(I+1)=K+1
end do

mtype=11 !real unsymmetric
call pardisoinit(pt,mtype,iparm)
iparm(3)=2 ! number of processors

phase = 11 ! only reordering and symbolic factorization
msglvl=0 !do not print
CALL pardiso (pt, maxfct, mnum, mtype, phase, N, A_A, ia, ja,idum, nrhs, iparm, msglvl, ddum, ddum, error)

phase = 22 ! only factorization
CALL pardiso (pt, maxfct, mnum, mtype, phase, n, A_A, ia, ja, idum, nrhs, iparm, msglvl, ddum, ddum, error)

iparm(8) = 2 ! max numbers of iterative refinement steps
phase = 33 ! only factorization
CALL pardiso (pt, maxfct, mnum, mtype, phase, n, A_A, ia, ja, idum, nrhs, iparm, msglvl, b , x, error)

phase = -1 ! release internal memory
CALL pardiso (pt, maxfct, mnum, mtype, phase, n, ddum, idum, idum,idum, nrhs, iparm, msglvl, ddum, ddum, error)
CALL MKL_FreeBuffers()
DEALLOCATE(A_A);DEALLOCATE(JA)
end



0 Kudos
3 Replies
Sergey_P_Intel2
Employee
273 Views

Hi,

Thank You for your question. The problemconcerning memory leakage in PARDISO is known.You didn't mention the MKL version butwe think thatit should be MKL 10.0 or MKL 10.1 Beta.This bughas been fixed recently and changes will be integrated innearest MKLbuilds.

With best regards,

Sergey

0 Kudos
liubing84
Beginner
273 Views
Thank you for your reply!

Sorry,I forgot that. I use MKL 10.0.1.015. Does this version have a bug as you have said? And which version should I use? Thanks!
0 Kudos
Gennady_F_Intel
Moderator
273 Views

Hi, I have to add 2 remarks:

1. Yes, the version you are using contains this error. The latest version MKL 10.0 Update 4 contains some fixes but not completely. This version is available from Intel Registration Center right now. We are planning to fix this problem completely in the next version MKL 10.1 Gold. We cannot provide the exact release date but it will be somewhere around November this year.

2. you pointed that you are linking only three libraries: libguide.lib mkl_c.lib mkl_solver.lib.

We are strongly recommend for Linking Pardiso the following libraies ( win32):

mkl_solver.lib mkl_intel_c.lib mkl_intel_thread.lib mkl_core.lib libguide40.lib

more details about linking exapmples and so on you can find in Userguide ( see chapter 5, for example ).

I hope it helps.

Regards, Gennady

0 Kudos
Reply