- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am using ifort (IFORT) 12.0.0 at our linux server, and I am experiencing a strange behavior with stream access I/O.
A minimal-size sample code would look as follows:
program inq_pos_test
implicit none
! integer,parameter :: nbuf=2**14-1
integer,parameter :: nbuf=2**14
integer :: offset
character(len=nbuf) :: str
offset=1
open(11,file='./input.txt',form='unformatted',access='stream')
read(11,pos=offset) str(1:nbuf)
inquire(11,pos=offset)
write(*,'(a,i8,a,i8)') 'pos after reading ',nbuf,' bytes=',offset
close(11)
end program inq_pos_test
where './input.txt' is a 2MB ascii file. Definately I would expect the final value of offset to be (nbuf+1). This is true when nbuf = 2**14 - 1 (= 16383):
pos after reading 16383 bytes= 16384
However, it returns a strange value if nbuf = 2**14 (= 16384):
pos after reading 16384 bytes= 8193
where 8193 = 2**13 + 1. Seems like offset is always 8193 for any values of nbuf >= 2**14.
First of all, I would like to know whether this is our system-specific problem or not. Could anyone check whether this could be reproduced?
Thanks in advance.
ps. gfortran seems to work as expected for any values of nbuf.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This appears to be a bug prevalent in the 12.x and 13.0 compilers. It is fixed in the first 13.1 compiler, 13.1.0.146 build 20130121 and all compilers thereafter ( all 13.1.x and 14.x compilers).
Nothing wrong with the code that I see. Latest compilers from 13.1 onwards gives:
$ ifort -V -O0 -o inq inq.f90 ; ./inq
Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 13.1.0.146 Build 20130121
Copyright (C) 1985-2013 Intel Corporation. All rights reserved.
Intel(R) Fortran 13.1-2134
GNU ld version 2.20.51.0.2-5.34.el6 20100205
pos after reading 16384 bytes= 16385
I would recommend updating to a 13.1 or 14.0 compiler. There currently are no more planned releases for the 13.0 or 12.x compilers.
ron
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This appears to be a bug prevalent in the 12.x and 13.0 compilers. It is fixed in the first 13.1 compiler, 13.1.0.146 build 20130121 and all compilers thereafter ( all 13.1.x and 14.x compilers).
Nothing wrong with the code that I see. Latest compilers from 13.1 onwards gives:
$ ifort -V -O0 -o inq inq.f90 ; ./inq
Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 13.1.0.146 Build 20130121
Copyright (C) 1985-2013 Intel Corporation. All rights reserved.
Intel(R) Fortran 13.1-2134
GNU ld version 2.20.51.0.2-5.34.el6 20100205
pos after reading 16384 bytes= 16385
I would recommend updating to a 13.1 or 14.0 compiler. There currently are no more planned releases for the 13.0 or 12.x compilers.
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ron,
Many thanks for the clarification. I'll talk to our system administrator about the compiler update.
Thanks again.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page