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

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

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

 

 

 

 

 

 

 

 

AttachmentSize
Downloadapplication/octet-stream extracstress.f905.01 KB
7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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

Steve - Intel Developer Support

Quote:

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. 

 

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 ?

Steve - Intel Developer Support

Quote:

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)"

Attachments: 

AttachmentSize
Downloadapplication/x-tar in.tar3 KB

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.

Steve - Intel Developer Support

Quote:

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.;)

 

Leave a Comment

Please sign in to add a comment. Not a member? Join today