- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page