Out of memory problem

Out of memory problem

Dear all, 

I am running a big code for flow simulation and when I am using a mesh with large number of nodes, FORTRAN 90 gave me an error F6773 cannot allocate array out of memory 

So how I can handle this error and if I use intel FORTRAN the problem will be solved or not. 

its about 10000 nodes and I have many arrays in the code , the biggest one dimension is (5*number of nodes ,5*number of nodes) 

Regards
Regards

10 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

Please provide additional technical details.

>>...its about 10000 nodes and I have many arrays in the code , the biggest one dimension is (5*number of nodes,
>>5*number of nodes)...

What platform ( system description / specs ) do you use and what is the total size of these arrays?

I am using Win 7 RAM 16 gigabyte, Fortran 90 under win 32 bit platform, I donnot know the total size of arrays , ut are as follows

ALLOCATE(u_n(3,nnodes),NJdxdy(3,8),STRAIN(3,NNODES,nsteps+1),U(3,NNODES),kzb(nuzb),kx1(nXaxis),FORCESTR(3*NNODES),TM3(NN,3*NN),kyf(NUyAXIS),knownfz(nuz),KNOWNXF(NUyAXIS),ZZ(NNODES),STLOAD(3*NNODES),Knownux(NUXAXIS),Knownuy(NUyAXIS),M5e(3*NN,3*NN),Knownx(nXaxis),KnownY(nyaxis),temp_load(nnodes),radius(nXaxis),vec(nxaxis),MDISP(NELE,4,16),CLOAD_1(nnodes),KKLOAD_1(nnodes))
ALLOCATE(loade(nnodes),pre(nnodes),forcep(nnodes),LOADV(3*NNODES),AKTU22(NELE,4,4),k_k(nnodes))
ALLOCATE(KX(nrw),Kre(nRe),M4e(nn,nn),ANS(4*NNODES),K_KLOAD(nnodes))
ALLOCATE(disp_init(3*nnodes),pressure_init(nnodes),temp_init(nnodes),delta_u(2*nnodes),load_dec(2*nnodes))
ALLOCATE(soln(nnodes),pressV(nnodes),ANST(nnodes,nsteps+1),anse(nnodes,nsteps+1),C_TEMP(NELE,8,8), C_TEMP1(NELE,8,8))
ALLOCATE(Kt(nnodes,nnodes),Kt1(nnodes,nnodes),ANSE1(nnodes,NSTEPS+1))
ALLOCATE(MATE(5*NN,5*NN),M3(NNODES,3*NNODES),tempval(5*AC_NODE ),pr(nnodes),Tr(nnodes),xx(nnodes),yy(nnodes),AKTU11(NELE,8,8))
ALLOCATE(F4(3*nnodes),force(3*nnodes +nnodes),ma_vec(2*nnodes +nnodes),mi_vec(3*nnodes +nnodes))
ALLOCATE(displacement_u(3*nnodes,nsteps+1),M8E( NN,NN),LOAD_C(nnodes),AKTU111(NELE,8,8) )
ALLOCATE(KTP(nn,nn),refsoln(5*AC_NODE),stress_index(3*NNODES),TEMP_L(2*nnodes),TEMPL_1(2*nnodes))
ALLOCATE(STRESSRT(NNODES,3),bcout(nrelem,3),bcin(nrwelem,3),AKTU222(NELE,4,4))
ALLOCATE(Xini(Nnodes),Yini(Nnodes),Ake1(Nele,8,8),STRESS_INIT(NNODES,3),AKT1(NELE,8,8))
ALLOCATE(pressure_new(nnodes),TEMPERATURE_NEW(nnodes),BOUNDX(NMIN ,3) )
ALLOCATE(LOADSTR(3*NNODES),akp(NELE,8,8),DT(NSTEPS),AREA(NELE),STRESS_HISTORY(NSTEPS,NNODES,3),CORNER_NODE(nnodes,2))

nnodes : is the total number of nodes

Even with allocatable arrays, under Windows 32-bit with Fortran you can't use more than 4GB total for all of the following: Windows OS, your program, your data, .....

As you have so much RAM, it would make more sense to switch to 64-bit Windows and ifort for Intel64.

>>...under Windows 32-bit with Fortran you can't use more than 4GB total for all of the following: Windows OS,
>>your program, your data,...

For the last two items, that is '...program...data...' the limit is 2GB of memory. So, you need to consider a change to a 64-bit configuration.

Also, use the Task Manager in order to evaluate how much memory is allocated by the application when the message 'Out of Memory' is displayed.

Are you still using Microsoft Fortran PowerStation?

2GB is indeed the limit on 32-bit Windows for all program virtual memory combined.

Steve - Intel Developer Support

Sergey,

The Task Manager does not tell you how much memory is allocated. It tells you how much is in use. Depending on O/S version, memory becomes in-use when the process first touches the allocated memory (page granularity). Thus allocation alone is insufficient. For a memory test program, after (first) allocation you would need to walk the allocated memory using page sized probes (e.g. read or write something every 4KB or 4MB within the allocation). You normally do not do this in an application unless you have a requirement that the allocation us usable. Note, if the page file is too small and not permitted to grow, it is not unusual to receive a "page fault" when writing data to a successfully allocated buffer.

Jim Dempsey

www.quickthreadprogramming.com

>>...The Task Manager does not tell you how much memory is allocated...

Jim,

I really don't see a difference in that case between used and allocated. It actually doesn't matter because as soon as 2GB limit is reached Out of Memory message is displayed on a 32-bit platform.

My position is Not to have almost useless theoretical discussions when a simple evaluation needs to be done on the 32-bit platform followed by a test on a 64-bit platform.

Reda A.

My recommendation to you is that you
- rewrite the code so that you have one array allocated per line of code
- import this code into Excel
- text to columns, using (,) as delimiters can help with this.
- compute the size of each array, including the kind/byte size of each variable type.
- use reference to each variable size, so you can test the change to memory usage for changes to problem dimension.
Use of a VLOOKUP for parameters is a good idea, as this allows to sort the allocate lines, based on size.

I would recommend that this would give you a good insight into where all the memory usage is taking place.

A good coding technique is to map out where the arrays are being use, as typically they are not all used at the same time.
There is a long history of sparse memory techniques to reduce memory usage. Creating indexed tables of values is also a useful technique.
Even with 64-bit, mapping techniques to reduce array sizes often result in significant reduction in run times, by mapping out needless computation of zero values.

You certainly have identified a diverse group of variables in your earlier post.

John

ps : I have attached a spreadsheet of dimensions. It needs correction for parameter values and variable KIND. Once corrected it will show you where the memory is being used. Although you havn't indicated the variable sizes, I would suspect this will identify what to change. I have named "select_data" to help with the sort.

Fichiers joints: 

Fichier attachéTaille
Télécharger allocate-list.txt3.14 Ko
Télécharger allocate-list.xls51.5 Ko

Laisser un commentaire

Veuillez ouvrir une session pour ajouter un commentaire. Pas encore membre ? Rejoignez-nous dès aujourd’hui