Hello,
we installed the new release 3 of the Intel Parallel Studio 2016 (parallel_studio_xe_2016.3.067) on our cluster and a problem occurs while reading from an unformatted file with any optimization (O1, O2, O3) on.
The program itself works flawlessly with -O2 with release 2 of this year's ifort as well as with ifort 10 and 11. The operating system is Linux with kernel version 3.12.60.
The following code was taken from the complete program in fixed form Fortran and is able to reproduce the error:
program main
implicit none
integer*4 iconf(1000)
integer*4 jerz(20), jver(20)
integer*4 iv(20),ie(20),
. ivsave(20),iesave(20)
character*4 girep
integer*4, allocatable ::lconf(:,:)
integer*4, allocatable ::lstart(:)
integer*4, allocatable ::iconf1(:,:)
integer*4, allocatable ::iconf2(:,:)
integer*4, allocatable ::i1off(:,:)
integer*4, allocatable ::i2off(:,:)
integer*4, allocatable ::i1ix(:)
integer*4, allocatable ::i1ex(:)
integer*4, allocatable ::i2iix1(:)
integer*4, allocatable ::i2iix2(:)
integer*4, allocatable ::i2iex1(:)
integer*4, allocatable ::i2iex2(:)
integer*4, allocatable ::i2eex1(:)
integer*4, allocatable ::i2eex2(:)
integer*4, allocatable :: mat(:) ,merz(:,:) ,mver(:,:)
integer irefold(73),i,j
integer*8 matall,matclast,matcalc
integer*4 i1i,i1e,i2ie,i2ii,idum,imem,ierr
integer*4 momax,MEMMB,NCONF,INTS2EEMAX,INTS2IEMAX
integer*4 INTS2IIMAX,INTS1EMAX,INTS1IMAX
integer*4 INT2,INT1,I2EE,INT0
matall = 0
nconf=8477
open(unit=2,file='Hc.info.ag',form='unformatted')
read(2) idum
read(2) int0
read(2) (irefold(i),i=1,int0)
read(2) momax
read(2) i2ii
allocate(i2iix1(i2ii),i2iix2(i2ii),stat=ierr)
if (ierr.ne.0) stop 'Allocation failed for creators in cinew'
read(2)(i2iix1(i),i=1,i2ii)
read(2)(i2iix2(i),i=1,i2ii)
print *, '1'
read(2) i2ie
allocate(i2iex1(i2ie),i2iex2(i2ie),stat=ierr)
if (ierr.ne.0) stop 'Allocation failed for creators in cinew'
read(2)(i2iex1(i),i=1,i2ie)
read(2)(i2iex2(i),i=1,i2ie)
print *, '2'
read(2) i1i
allocate(i1ix(i1i),stat=ierr)
if (ierr.ne.0) stop 'Allocation failed for creators in cinew'
read(2)(i1ix(i),i=1,i1i)
print *, '3'
read(2) i1e
allocate(i1ex(i1e),stat=ierr)
if (ierr.ne.0) stop 'Allocation failed for creators in cinew'
read(2)(i1ex(i),i=1,i1e)
print *, '4'
read(2) i2ee
allocate(i2eex1(i2ee),i2eex2(i2ee),stat=ierr)
if (ierr.ne.0) stop 'Allocation failed for creators in cinew'
read(2)(i2eex1(i),i=1,i2ee)
read(2)(i2eex2(i),i=1,i2ee)
print *, '5'
read(2) int1
allocate(iconf1(2,int1),stat=ierr)
if (ierr.ne.0) stop 'Allocation failed for iconf1'
print *, '6'
read(2) ((iconf1(i,j),i=1,2),j=1,int1)
read(2) int2
allocate(iconf2(3,int2),stat=ierr)
if (ierr.ne.0) stop 'Allocation failed for iconf2'
print *, '7'
read(2) ((iconf2(i,j),i=1,3),j=1,int2)
allocate(i1off(0:int1,2),stat=ierr)
if (ierr.ne.0) stop 'Allocation failed for i1off'
read(2)(i1off(i,1),i=0,int1)
read(2)(i1off(i,2),i=0,int1)
print *, '8'
allocate(i2off(0:int2,3),stat=ierr)
if (ierr.ne.0) stop 'Allocation failed for i2off'
read(2)(i2off(i,1),i=0,int2)
read(2)(i2off(i,2),i=0,int2)
read(2)(i2off(i,3),i=0,int2)
read(2) ints1imax,ints1emax,ints2iimax,ints2iemax,ints2eemax
print *, '9'
allocate(lstart(nconf+1),stat=ierr)
if (ierr.ne.0) stop'Allocation failed for lstart in mrci'
imem = imem + 4 * ( nconf + 1 )
print *, '10'
read(2)(lstart(i),i=1,nconf+1)
print *, '11'
close(2)
end
$ ifort -O0 main.f
$ ./a.out
1
2
3
4
5
6
7
8
9
10
11
This works as expected. But with -O1, -O2 or -O3 the following error occurs:
$ ifort -O2 main.f
$ ./a.out
1
2
3
4
forrtl: severe (67): input statement requires too much data, unit 2, file /home/adrian/tmp/ifort_test/Hc.info.ag
Image PC Routine Line Source
a.out 0000000000407049 Unknown Unknown Unknown
a.out 000000000041DAB6 Unknown Unknown Unknown
a.out 000000000041B673 Unknown Unknown Unknown
a.out 00000000004032A6 Unknown Unknown Unknown
a.out 00000000004026DE Unknown Unknown Unknown
libc.so.6 00007F01B068EF45 Unknown Unknown Unknown
a.out 00000000004025E9 Unknown Unknown Unknown
The input file was created by a working binary of the program compiled with release 2 of ifort 2016 and is the same in all test cases.
Thanks.