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

same compiler and compile option, only difference in write statement, different results

heaveng
Beginner
584 Views

I have two versions of a code. the only difference is that Version Ahas a write statement about certain variable, while Version B has not. This difference leads to completely different results. Do you what the reason is and how to avoid such situation? Thank!

Compiler: mpif90

compile option:-fpp-r8 -132 -c -align all

link option:-Vaxlib -mp

OS:Red Hat 3.4.6-8

CPU:Intel Pentium 4 CPU 3.40GHz

0 Kudos
2 Replies
drraug
Beginner
584 Views

Usually when I meet such problems, the investigation shows that there is a bug in code, and some data are used when they are not defined, which leads to unpredictable results (NaNs, for example).

You can try to set optimization level to zero -O0 and check again, just to be sure, that this problem is not introduced by compiler optimization process.

0 Kudos
TimP
Honored Contributor III
584 Views
In addition to checking for uninitialized data or array over-run, if your application requires -mp (presumably using ifort 10.0 or earlier?) that option would be effective only for compile, not for link.
0 Kudos
Reply