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

Error "forrtl: severe (41): insufficient virtual memory" when use MKL poisson library in time-dependent problem

zlh007
Beginner
1,336 Views

Hello,
Recently, I used the MKL possion library to solve 2-d Helmholtz equations in a time-dependent problem by the use of the IVF11.1.038(ia32) in microsoft visual studio 2008 in windowsXP(32bit). Because the arrays used in my code is tool large (having the dimensions as: 201*401*2), "heap-arrays" is the additional option of used in the command line.At each time step, two 2-D Helmholtz equations will be solved. At each time solving the Helmholtz, the sequence of invoking Poisson library follows the standard foursteps: Initialization-->check consistency and correctness-->compute solution-->clear the memory. I have built the code successfully and theresultscalculatedby this code seems correct until the time step n=144000. After that time step, the execute of the code terminated as showing the error "Error forrtl: severe (41): insufficient virtual memory". The codeabout this part is:

!------------- Input parameter forHelmholtz solver
! nx and nyare the number of gridpoints in x- and y-direction, respectively
integer ipar(128),stat
real*8 ax, bx, ay, by
real*8 dpar(13*(nx-1)/2+7),f(nx,ny)
real*8 bd_ax(ny), bd_bx(ny), bd_ay(nx), bd_by(nx)
type(DFTI_DESCRIPTOR), pointer :: xhandle
character(4) BCtype
parameter (ax=0,bx=lx,ay=0,by=ly,BCtype = 'DDDD')
!
!--------------------- Time Stepping --------------------------
!
do 10 n=1,10000000
!---------------------------------------------------------------
! Solving Helmholtz equation
!---------------------------------------------------------------
! Array 'rdec' is the right hand side of the 2-d Helmholtz equation
! Vector 'Lv' is the costant 'q' for Helmholtz equation
do k=1,2
call d_init_Helmholtz_2D(ax, bx, ay, by, nx-1, ny-1, BCtype, Lv(k), ipar, dpar, stat)
call d_commit_Helmholtz_2D(rdec(:,:,k), bd_ax, bd_bx, bd_ay, bd_by, xhandle, ipar, dpar, stat)
call d_Helmholtz_2D(rdec(:,:,k), bd_ax, bd_bx, bd_ay, bd_by, xhandle, ipar, dpar, stat)
call free_Helmholtz_2D(xhandle, ipar, stat)
enddo
endif
10 continue

The code run correctly until about n=144000. Is there errorsin the calling of the Poisson library? Or, any otherpossible misunderstandings I have made?
Thanks for your reading.

Zhong

0 Kudos
7 Replies
Gennady_F_Intel
Moderator
1,336 Views

Zhong, at the first sight the calling of Poisson solver is correct. Can you check the probelm with 64-bit version and with 64-bit compiler as well? if not - can you get the test. We'll check on our side!
--Gennady
0 Kudos
zlh007
Beginner
1,336 Views

Zhong, at the first sight the calling of Poisson solver is correct. Can you check the probelm with 64-bit version and with 64-bit compiler as well? if not - can you get the test. We'll check on our side!
--Gennady

Gennady,
Thanks a lot! Yesterday, Ibuilt the code without the option-'/heap-arrays' but with '/stack:80000000' in link comand line option. In this case, the execute run correctly without the previous error until now (n=300000) and the the time integration is still stepping at the time I replying this thread. I willkeep on oberving this execute stepping. Hope the problem can be solved in this way. But I still don't understand the reason about it.
---Zhong
0 Kudos
Alexander_K_Intel2
1,336 Views
Quoting - zlh007

Gennady,
Thanks a lot! Yesterday, Ibuilt the code without the option-'/heap-arrays' but with '/stack:80000000' in link comand line option. In this case, the execute run correctly without the previous error until now (n=300000) and the the time integration is still stepping at the time I replying this thread. I willkeep on oberving this execute stepping. Hope the problem can be solved in this way. But I still don't understand the reason about it.
---Zhong

Hi Zhong,

In reason to reproduce your problem could you provide us example of your program with calling Helmholtz routines? Also, could you describe what type of Dirichle boundary condition you used in your code - zero or nonzero? Based on it we can propose solution of your problem and restructure loop to optimize performance.

With best regards,
Alexander Kalinkin

0 Kudos
zlh007
Beginner
1,336 Views

Hi Zhong,

In reason to reproduce your problem could you provide us example of your program with calling Helmholtz routines? Also, could you describe what type of Dirichle boundary condition you used in your code - zero or nonzero? Based on it we can propose solution of your problem and restructure loop to optimize performance.

With best regards,
Alexander Kalinkin

Hi Alexander,
Firstly, thank your very much for your help.On the four boundaries, Dirichle boundary conditions are given as zero. Becausemy codes is too long to display in thread, I compressed theminto a winrar file in attachments, in which one main code 'MLQGmain.f90' and several subroutines and a .dat file are included. You can build these codes asa console application. Thefile 'number.dat'must be put into the same directory as the codes and will be read when execute the application. The poisson solver is only used in time loop as shown in my question.
With best regards,
Linhao Zhong
0 Kudos
Gennady_F_Intel
Moderator
1,336 Views
Quoting - zlh007

Zhong, at the first sight the calling of Poisson solver is correct. Can you check the probelm with 64-bit version and with 64-bit compiler as well? if not - can you get the test. We'll check on our side!
--Gennady

Gennady,
Thanks a lot! Yesterday, Ibuilt the code without the option-'/heap-arrays' but with '/stack:80000000' in link comand line option. In this case, the execute run correctly without the previous error until now (n=300000) and the the time integration is still stepping at the time I replying this thread. I willkeep on oberving this execute stepping. Hope the problem can be solved in this way. But I still don't understand the reason about it.
---Zhong

Zhong,
probably the reason of thisbehaviour is the memory leakage in this functionality ...
Can you check it on your side, please ...
--Gennady
0 Kudos
Alexander_K_Intel2
1,336 Views

Zhong,
probably the reason of thisbehaviour is the memory leakage in this functionality ...
Can you check it on your side, please ...
--Gennady

Zhong,

Unfortunately, I didnt found in your code value of internal loop (k), but if k from 1 to 2 try to restructure your code in next way. It will increase performance of your code and, probably, could solve your problem:

call d_init_Helmholtz_2D(ax, bx, ay, by, nx-1, ny-1, BCtype, Lv(1), ipar_1, dpar_1, stat)

call d_init_Helmholtz_2D(ax, bx, ay, by, nx-1, ny-1, BCtype, Lv(2), ipar_2, dpar_2, stat)

ipar(1) = 990
call d_commit_Helmholtz_2D(rdec(:,:,k), bd_ax, bd_bx, bd_ay, bd_by, xhandle_1, ipar_1, dpar_1, stat)

ipar(1) = 990
call d_commit_Helmholtz_2D(rdec(:,:,k), bd_ax, bd_bx, bd_ay, bd_by, xhandle_2, ipar_2, dpar_2, stat)

do 10 n=1,10000000

! Array 'rdec' is the right hand side of the 2-d Helmholtz equation
! Vector 'Lv' is the costant 'q' for Helmholtz equation
ipar(1) = 9
call d_commit_Helmholtz_2D(rdec(:,:,1), bd_ax, bd_bx, bd_ay, bd_by, xhandle_1, ipar_1, dpar_1, stat)
call d_Helmholtz_2D(rdec(:,:,k), bd_ax, bd_bx, bd_ay, bd_by, xhandle_1, ipar_1, dpar_1, stat)

ipar(1) = 9
call d_commit_Helmholtz_2D(rdec(:,:,2), bd_ax, bd_bx, bd_ay, bd_by, xhandle_2, ipar_2, dpar_2, stat)
call d_Helmholtz_2D(rdec(:,:,k), bd_ax, bd_bx, bd_ay, bd_by, xhandle_2, ipar_2, dpar_2, stat)

10 continue

call free_Helmholtz_2D(xhandle_1, ipar_1, stat)

call free_Helmholtz_2D(xhandle_2, ipar_2, stat)

with best regards,

Alexander Kalinkin

0 Kudos
zlh007
Beginner
1,336 Views

Zhong,
probably the reason of thisbehaviour is the memory leakage in this functionality ...
Can you check it on your side, please ...
--Gennady

Gennady,
I see you have replied to my anotherquestion about using Pardiso in time-dependent problem. But I can't seeyourreply in that webpage maybe due to some mistake ofthe forum. Can yousend you advice to me in this thread ormy email (zlh@mail.iap.ac.cn)? Thanks a lot!
Zhong
0 Kudos
Reply