Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Memory problem because of I/O

gerrig
Beginner
451 Views
Hello smiley [:-)]

I've made the following observation. When a program make a (sequential) READ e.g.:

READ (UNIT) ((FIELD(I,J),I=1,N),J=1,N)

then the running process consumes an extra amout of memory afterwards. I.e. before the READ statement the process has allocated once the size of the array FIELD and after the READ statement the process has allocated twice the size. And this 'extra' amount of memory is not(!) freed during the execution of the subroutines afterwards.
Because I use huge arrays (>1GB) this 'buffer' memory takes away urgently needed memory, unfortunately.

I already tried the compile option '-assume nobuffered_io' and 'BUFFERED=NO' in the OPEN statement for the tape. But the behaviour doesn't change.
I also tried the ifort versions 7,8,9 and 10. But only the version 7 is 'problem free' in that case.

Has anyone an idea how one can force the freeing of this extra 'buffer' memory directly after the READ statement?

Thanks in advance,
Gerald Geudtner

0 Kudos
1 Reply
Steven_L_Intel1
Employee
451 Views
You can't free the memory. Will a simple:

READ (UNIT) FIELD

not work instead? That is much more efficient.

"buffering" refers to combining records to make the I/O more efficient (fewer reads or writes) - it does not affect memory buffering of I/O.
0 Kudos
Reply