1

I am reading an ascii file with Intel Fortran opened as:

open(10, file=trim(file_name), status='old', action='read', iostat=ierr, iomsg=msg)

To skip some file lines which I do not want to store I am using read() with no I/O list:

read(10, *)

VTune reports 53 GB allocated at the read() with no I/O list:

enter image description here

Is that memory really allocated or is it that VTune incorrectly identifies memory allocation? What causes this behaviour?

Vitaliy
  • 75
  • 1
  • 8
  • Do you have 53 GB physical/virtual memory? How large is the file? Is the file mmaped? – francescalus Aug 22 '23 at 13:01
  • To answer the question in the title: "Maybe". I realise this is not a useful answer, but it is totally up to the implementation as to how internally it performs the iteration, and could easily change between implementation, even from the same vendor. – Ian Bush Aug 22 '23 at 17:10
  • @francescalus I have 500 GB of physical memory. The file size is 65 MB, it has 1.5 million lines, and it is being read in parallel by 40 procs using MPI. Each rank reads and stores its own fraction of lines, and skips the other lines using read() with no arguments. The file is not mmaped. – Vitaliy Aug 23 '23 at 05:26

1 Answers1

2

No, there is not 53+GB of virtual memory being allocated at that point. The read with no I/O list likely allocates no memory at all.(I am a former Intel Fortran compiler developer.)

Steve Lionel
  • 6,972
  • 18
  • 31