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

bug report- write statement have no idea of some bounds of multi-dim allocatable var

Intel_C_19
Beginner
560 Views

hi, I'm using the ifort 14.0.0 20130728

I found a possible bug of this version. 

when some allocatable variable has a non-1 lower bound, for some elements(not all) of this allocated variable, the write() statement do not know what's the true lower bound, it will use '1' instead. so when you write something like "write(*,*) a(:,0,1)", you get some strange answer. however if you use  something like "write(*,*) a(1:6,0,1)" which strictly defines the first dimension, the answer is correct.

the funny thing is, this kind of wrong answer is very rare, in most cases the compiler get the correct bounds. so I didn't realize it is maybe it is related to the compiler.

I cannot reproduce it in a normal simple code, so I upload my original code here.

be aware of line 111,112 and 132-137

on our sever here, it will write 0.0E0 for the first output at line 112

output at 128 of "meanstrain" is also always 0 whatever the true data is

 

 

 

 

 

 

 

 

0 Kudos
6 Replies
Steven_L_Intel1
Employee
560 Views

Thanks - would you please also attach a tar file of the data files this code uses?

0 Kudos
Intel_C_19
Beginner
560 Views

Steve Lionel (Intel) wrote:

Thanks - would you please also attach a tar file of the data files this code uses?

 OK, Steve. The original data file is very large. I'm now trying to obtain the lines that the write get wrong. Any way, if you get 0.0 output for line 112, that should reproduce the problem. 

 

0 Kudos
Steven_L_Intel1
Employee
560 Views

I can't run this without the data files. That you can't reproduce it in a smaller version suggests that the error is caused somewhere else in the program. Have you tried a build with -CB ?

0 Kudos
Intel_C_19
Beginner
560 Views

Steve Lionel (Intel) wrote:

I can't run this without the data files. That you can't reproduce it in a smaller version suggests that the error is caused somewhere else in the program. Have you tried a build with -CB ?

oh, sorry, I just found my last reply is useless.

I extracted the first line of data where the code went wrong. the input is in the attachment.

The true data is the last line in both files. However, I found it seems to be okay when there is only one line, since the upper and lower bounds are equal, so I added a line of "2 -1 -1 -1" in dump.ori and "2 -1 -1 -1 1 1 1 1 1 1" in dump.dis as they are now in the attachment.

After I see your reply, I added the -CB, but no effect.

The current output is 0.0 while it shouldn't be.

(I mean the output of line 146 for the data in the last line of input files, please delete or comment line 111-112,127-130 and 132-139, I just wanted to see some detail things to debug here, they may cause runtime errors in this extracted input file(correction: no runtime errors with these lines, but they are truely useless for this input))

 

Thanks!

BTW: it seems only related to the write statement, because all the value assigned is right, and can be accessed correctly if I use "write(*,*) meanstrain(1:6,x,y)" instead of "write(*,*) meanstrain(:,x,y)"

0 Kudos
Steven_L_Intel1
Employee
560 Views

Thanks. I can reproduce the problem with 14.0.0 but not with 14.0.1, so it looks as if it's a bug we fixed. 14.0.1 was released in October.

0 Kudos
Intel_C_19
Beginner
560 Views

Steve Lionel (Intel) wrote:

Thanks. I can reproduce the problem with 14.0.0 but not with 14.0.1, so it looks as if it's a bug we fixed. 14.0.1 was released in October.

Many thanks! So it is always better to catch up with the lastest fashion.;)

 

0 Kudos
Reply