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

Fortran exe behaving different on different machines

h-faber
Beginner
788 Views
Hi all,
still me...
After having solved the NaN problem at least on my machine, we wonder why the .exe does not work the same way as on other computers.
IDEs, compilers, sources and project settings are the same but the results still differs. We tried to only let my .exe run on the other PC. But again no change, still the NaN result. Finally we have taken a 3rd PC, same OS as on my PC - again NaN.

How does the program work?
-> It reads a file, calculates and generates some output files. It is all the same input file but on two PCs the Fortran .exe produces a different result than on the third PC.
What reason might there be for this behaviour?
0 Kudos
4 Replies
dima333a
Beginner
788 Views

It might be the problem of different CPUs on different machines. Certain optimizations, that compiler exploit to make program run faster on one CPU may result in erroneous outcome on the other CPU due to difference in architecture.

I would try to compile without optimizations (disable optimizations in compiler options) and see what happens.

Good luck.

0 Kudos
h-faber
Beginner
788 Views
Hi,

the point is:

We use the default project settings, look at http://img232.imageshack.us/my.php?image=optimizationsettingsopas5ue.jpg



I assume that these settings mean "Optimization completely disabled". If this assumption is wrong, I think I need some advice concerning useful/required changes.

The current command line arguments show:
/nologo /Zi /Od /Qsave /Qzero /module:"$(INTDIR)/" /object:"$(INTDIR)/" /traceback /check:bounds /libs:static /dbglibs /c


Thanks in advance.

Message Edited by h-faber on 09-19-2005 12:01 AM

0 Kudos
dima333a
Beginner
788 Views
O.K.... If you are getting NaN on some of the machines, try to debug the program , i.e. compile in debug mode with proper handling of floating point violations ( I know that in CVF there is an option fpe:0 and fpe:3 , that allows you to force program to crash in case NaN is caculated) . I usially compile in CVF with option /traceback to see at which line the NaN is calculated, then I look what variable is causing that... and so on and so forth..... I had a case when debug version could run, but "optimise" was having this NaN problem.... so I had to trace it by fpe and traceback options. I suspect that IFC may have its own options for that, but I am not sure.
0 Kudos
sabalan
New Contributor I
788 Views

Uninitialized variables and arrays may take different "garbage" values in different systems. In one system this "garbage" value may help to go through the calculations withoutgetting NaN, while in some other system this "garbage" may just produce NaN. Therefore my suggestion is: Use IMPLICIT NONE, declare all variables and arrays, andinitialize all variables, especially arrays.

Sabalan.

0 Kudos
Reply