Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussions

Different computation results by using optimization Settings

Christian1
Beginner
674 Views

Hey there.

I'm working on a simulation software which uses time step integration.

I found out, that the simulation results of my written code depend on some compiler settings.
In special the following settings influence the computation results:

In IVF version 11.0.075

Project Settings -> Fortran -> Optimization -> Oprimization set to "Maximize Speed and Higher Level Optimization"

Project Settings ->Fortran -> Optimization ->Global Optimization setto "Yes"

Project Settings -> Fortran -> Optimization -> Internal Procedure Oprimization set to "Single File"

Project Settings -> Fortran -> Run-Time -> "Check Array and String Bounds" set to "Yes"

These mentioned settings confuse me a little bit, esspecially the last on.


Why is the "check array and string bounds" setting influencing the results, this makes no sense!

Are the optimization setting supposed to influence the accuracy of the code (perhaps variables)?
Did you have anysimillar problems so far?

Regards,

Chris

0 Kudos
4 Replies
bendel_boy1
Beginner
674 Views

They affect assumptions made about your code, and the way in which floating results are rounded/flushed back to memory.

The only one that really puzzles me is the debug option for bounds - but it may be that by switching on some debug code that that does affect, again, the assumptions about floating point optimisations.

0 Kudos
TimP
Honored Contributor III
674 Views

You should have set /assume:protect_parens,minus0 so that any changes which occur with varying level of optimization don't violate Fortran standards. Setting /Qprec-div /Qprec-sqrt also would be preferable, so as to comply with IEEE754 in those respects.

If you limit yourself to the options which are listed in Properties, change the fp:fast setting to fp:source; that will include the settings above, other than minus0, and also prevent vector sum reductions, which are among the optimizations which affect numerical results.

0 Kudos
Christian1
Beginner
674 Views

Thanks a lot.

By setting the Floating Point Model to Source I could get rid of the problem

Even the Run-Time Check BoundsFlag does not affect the computations anymore.
Nevertheless, the bounds issue still makes me wonder why it affects the folating point model.

0 Kudos
TimP
Honored Contributor III
674 Views
As the previous responder hinted, bounds check removes some of the possibilities to optimize; in this case, apparently including aggressive optimizations which affect your result.
0 Kudos
Reply