subroutine function interface - debug options

subroutine function interface - debug options

dear all,

I have a problem with my program. When I compile it with:

ifort -r8 *.f90 -lmkl_blas95_lp64 -lmkl_lapack95_lp64 -mkl=sequential -CB

I have no problem and the results are correct, but of course the program results very slow.

On the other hand when I compile it without -CB I do not get exact results.

I would like to ask some questions:

1) How I can understand if my subroutine\functions calls are correct

2) Is there any way to correctly write a subroutine\functions? Now I am using all subroutine in module or interface

3)is there any compiler otions to find out the error?

4)is it a compiler bugs?

Thanks a lots

7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Steve Lionel (Intel)'s picture

You probably have a coding error leading to use of uninitialized variables. Without seeing a complete program that reproduces the problem, it's impossible to be more definite. It is unlikely to be a compiler error. -CB will change the generated code and the data layout, exposing or hiding uninitialized reference errors.

Steve

Thank you very much,

I supposed so. Do you have some suggestion? Can you suggest me some compiler options to fiend out the errors?

Thanks a lot

Steve Lionel (Intel)'s picture

I usually suggest -warn interface. You could also try -check uninit, but it isn't very reliable. If you have Intel Fortran Studio XE, Intel Parallel Studio XE or Intel Cluster Studio XE, you could  build with -diag-enable sc2 and view the resulting report with Intel Inspector XE. But otherwise it will be painstaking debugging to see where results start to diverge and where the changed values come from.

Steve

Dave Barker posted a fairly comprehensive method for detecting undefined data in ifort on linux:

www.nas.nasa.gov/hecc/assets/.../UnInit_Fix_your_code_2012_10_31.p...‎

I've been unable to get past the current forum scheme for finding and pasting a URL, but your search engine should be capable of finding this .pdf title.

  •  
  •  
  •  

 

dear all,

I have the "the method" with all the flags which I have to use.

I found where I have the difference. When I assign the initial value according to relative positions I get:

-7.527493540556792E-003 with -CB

-7.527493540555303E-003 without CB

the strange thing is that this happens only in x direction and not in y direction

this is normal or is this due to some allocate error?

another thing: if I print the values or not in a subroutine the two values are then the same

 

Thanks alot

 

Steve Lionel (Intel)'s picture

That's a pretty small difference and can easily be due to optimization choices.  If you align your arrays on 32-byte boundaries, you may reduce the differences.

How do you know which of those values is "more correct"? Is your input data good to that many digits? Have you done a detailed mathematical accuracy analysis of your algorithm?

At SC13 I participated in a workshop on numerical reproducibility. I've attached my presentation from that session.

Attachments: 

AttachmentSize
Download wp129s1.pdf694.18 KB
Steve

Login to leave a comment.