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

I get different results with /debug:full or not

ronghewang
Beginner
929 Views
How can I get the same results with release and debug build?

Thanks,
Victor
0 Kudos
9 Replies
TimP
Honored Contributor III
929 Views
Quoting - ronghewang
How can I get the same results with release and debug build?

A great deal of good information has appeared in past forum posts, so I'll try to summarize briefly.
1. Use the correctness checking options of the compiler:
a. /Qdiag-enable:sc (pre-build checks)
b. /check (run-time checks)
2. Turn off risky optimizations for release build
a. (more conservative) /fp:source
b. (more aggressive, but less than default release options)
/assume:protect_parens /Qprec-div /Qprec-sqrt
3. For the 32-bit compiler, set /arch:ia32 as a temporary diagnostic step
0 Kudos
Steven_L_Intel1
Employee
929 Views
/debug:full is likely not relevant. A Release configuration enables optimizations, and this can often cause differences in floating point results. Tim has good advice.
0 Kudos
ronghewang
Beginner
929 Views

I test Tim's suggestion, but I still get different results.My compilecommand lines are:
1. /nologo /debug:full /DhammerXM /DdialogUI /Dcvf /fpscomp:ioformat /fpscomp:ldio_spacing /fpscomp:logicals /iface:cvf /module:"ReleaseXM/" /object:"ReleaseXM/" /traceback /check:bounds /check:uninit /libs:static /threads /winapp /c
2. /nologo /DhammerXM /DdialogUI /Dcvf /fpscomp:ioformat /fpscomp:ldio_spacing /fpscomp:logicals /iface:cvf /module:"ReleaseXM/" /object:"ReleaseXM/" /traceback /check:bounds /check:uninit /libs:static /threads /winapp /c
I got different results for the settings for my test suite.

0 Kudos
ronghewang
Beginner
929 Views
Other things need to mention:
1. When use /check, I get"forrtl: severe (408): fort: (7): Attempt to use pointer NULL_SECURITY_ATTRIBUTES when it is not associated with a target"

2. When use /assume:protect_parens /Qprec-div /Qprec-sqrt, my program hang there.

Any suggestions?
Thanks.

0 Kudos
Steven_L_Intel1
Employee
929 Views
You aren't guaranteed to get the same results. Tim suggested some options that may help reduce differences, but it may not eliminate them. Which options did you try? It may also be that your code has an unstable algorithm or an error.

For where you have NULL_SECURITY_ATTRIBUTES, just use NULL instead.
0 Kudos
ronghewang
Beginner
929 Views
You aren't guaranteed to get the same results. Tim suggested some options that may help reduce differences, but it may not eliminate them. Which options did you try? It may also be that your code has an unstable algorithm or an error.

For where you have NULL_SECURITY_ATTRIBUTES, just use NULL instead.

I tried all the options:

1) /Qdiag-enable:sc/arch:ia32
2) /Qdiag-enable:sc/arch:ia32 /fp:source
3) /Qdiag-enable:sc/arch:ia32 /assume:protect_parens /Qprec-div /Qprec-sqrt
4) /check /arch:ia32

Thanks.

0 Kudos
Steven_L_Intel1
Employee
929 Views

/Qdiag-enable-sc is used for diagnostics only. If you have that set, you don't get an executable, so none of the other options would be used.

What are the differences? Can you determine the point in the program where results start to diverge?
0 Kudos
ronghewang
Beginner
929 Views

/Qdiag-enable-sc is used for diagnostics only. If you have that set, you don't get an executable, so none of the other options would be used.

What are the differences? Can you determine the point in the program where results start to diverge?

You can see the only difference in the command lines is if use /debug:full.
1. Can you tell me what is the main difference for using /debug:full or not?

My program repeats hundreds times.
2. when I use /arch: ia32, and run the program, it hangs there for about 190 iterations.

3. The first difference happens about 16 iterations if I only do not use /debug:full setting.

thanks.

0 Kudos
Steven_L_Intel1
Employee
929 Views
An important effect of /debug:full, assuming optimization is enabled, is that it disables interprocedural optimization within the same file. The compiler does some of this at default optimization levels, though it is more aggressive if you ask for it (/ip). This can result in dramatically different generated code, though it should still be correct.

It sounds as if your application is very sensitive to small floating point differences.
0 Kudos
Reply