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

IVF gives different results with DVF

j_fan
Beginner
629 Views
Im using IVF 11.0and DVF 6.0 to run the same codes, but they give different results, why? I've tried several programs, some of them have the same resuts, but others do not. And I know the results given by DVF are what I want. why does this happen?
0 Kudos
1 Solution
bmuirpurdue_edu
629 Views
Quoting - j.fan

Thank you Steve. Sorry I didn't say clearly. Themagnitude of the differences may betens of orders. Or, for some cases,IVFgive an 'infinite' or 'NaN'result. These old scientific computational codeswere originallydeveloped in F77 and re-developed later and worked wellwith DVF. I just wonder whether some new features of IVF could result in the huge differences.

I ran into exactly the same problem converting between Windows Powerstation VF (WVF) and IVF. IVF does not allow for sloppy programming, PVF was very forgiving. Uninitalized variables turned out to bethe culprit. WVF set these to zero for you, with IVF they are also set, but to a very large negative number or perhaps even random. So divide by zero or number out of range results. Step thrugh the program around where the error occurs and see if all variables have defined and correct values. There maybe compiler options that allow IVF and WVF to have the same defaults, but it is better to correct the code.

View solution in original post

0 Kudos
4 Replies
Steven_L_Intel1
Employee
629 Views
There are many possible reasons, including coding errors in your application (specifically, use of uninitialized variables or failure to use SAVE statements), optimizations causing reordering of floating point operations, and for 11.0 and later, the Intel default to use SSE instructions rather than X87 for floating point. There may be other possibilities. You don't say if the differences are floating point or otherwise, nor what the magnitude of the differences are. You should not expect bit-for-bit identical floating point results across implementations as there are many ways differences can enter due to the nature of computational floating point.

If you can identify the point in your application where results diverge, you'll be better able to understand the cause.
0 Kudos
j_fan
Beginner
629 Views
There are many possible reasons, including coding errors in your application (specifically, use of uninitialized variables or failure to use SAVE statements), optimizations causing reordering of floating point operations, and for 11.0 and later, the Intel default to use SSE instructions rather than X87 for floating point. There may be other possibilities. You don't say if the differences are floating point or otherwise, nor what the magnitude of the differences are. You should not expect bit-for-bit identical floating point results across implementations as there are many ways differences can enter due to the nature of computational floating point.

If you can identify the point in your application where results diverge, you'll be better able to understand the cause.

Thank you Steve. Sorry I didn't say clearly. Themagnitude of the differences may betens of orders. Or, for some cases,IVFgive an 'infinite' or 'NaN'result. These old scientific computational codeswere originallydeveloped in F77 and re-developed later and worked wellwith DVF. I just wonder whether some new features of IVF could result in the huge differences.
0 Kudos
bmuirpurdue_edu
630 Views
Quoting - j.fan

Thank you Steve. Sorry I didn't say clearly. Themagnitude of the differences may betens of orders. Or, for some cases,IVFgive an 'infinite' or 'NaN'result. These old scientific computational codeswere originallydeveloped in F77 and re-developed later and worked wellwith DVF. I just wonder whether some new features of IVF could result in the huge differences.

I ran into exactly the same problem converting between Windows Powerstation VF (WVF) and IVF. IVF does not allow for sloppy programming, PVF was very forgiving. Uninitalized variables turned out to bethe culprit. WVF set these to zero for you, with IVF they are also set, but to a very large negative number or perhaps even random. So divide by zero or number out of range results. Step thrugh the program around where the error occurs and see if all variables have defined and correct values. There maybe compiler options that allow IVF and WVF to have the same defaults, but it is better to correct the code.
0 Kudos
Steven_L_Intel1
Employee
629 Views
Try adding the following option: /Qsave

If building from the command line. /Qsave will be on by default when converting a CVF project in version 11.

If you are building from the command line, I also recommend adding /gen-interface /warn:interface
0 Kudos
Reply