- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have this legacy Fortran 77/90 code which I compiled using nmake. The answer I get when I run in the computer that I compiled with (Intel i7) is different the when I run in AMD Opteron. What are the compiler switch I need to set so that the executable is processor independent?
Link Copied
9 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are using Intel Visual Fortran Composer XE 2011, try /Qimf-arch-consistency . Make sure that you do NOT use any form of /Qax switch.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am just using Intel Fortran 11.1 something. I'll check to see if the /Qimf-arch-consistency exist. I'm assuming is a linker switch.
Thanks for the quick answer Steve.
Thanks for the quick answer Steve.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, arch-consistency was introduced in ifort 12.0.0 (Windows), 12.0.4 (linux). The special run-time library calls are implemented at compile time, although it is a new group of library functions.
The older switches /Qprec-div /!Qprec-sqrt also help to reduce architectural numerical differences in some situations, with less impact on performance.
The older switches /Qprec-div /!Qprec-sqrt also help to reduce architectural numerical differences in some situations, with less impact on performance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, it's a compiler switch and it is new in version 12.
The problem you have is that the math library has CPU dispatch code that will take different paths for Intel and non-Intel processors. We added this switch to force all CPUs through the same path, though it will be slower than it would be otherwise on Intel CPUs.
The problem you have is that the math library has CPU dispatch code that will take different paths for Intel and non-Intel processors. We added this switch to force all CPUs through the same path, though it will be slower than it would be otherwise on Intel CPUs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Still no resolution. The compile flags I set are (the relevant ones)
/nologo /03 /arch:IA32 /Qsave /Qzero /Qprec-div /Qprec-sqrt /fp:source/compile_only /f77rtl /intconstant
I'll have to say it had an effect, but still the output files are not the same. Also, when I compile with Digital Visual Fortran V6 the output files are equal (DVF is on AMD running Windows 2000) even with optimization off. However,the outputs with optimization on and off are not the same (will have to tackle it some other time, unless it is related to my current problem).
So, I'm stuck. I've seen a thread were somebody had the same problem but opted to use an older compiler. Do I need tokeep using DVF or do I need to try to fix the code (I'm assuming that there are no more compiler flags that I could set to fix the problem).
Any suggestions?
/nologo /03 /arch:IA32 /Qsave /Qzero /Qprec-div /Qprec-sqrt /fp:source/compile_only /f77rtl /intconstant
I'll have to say it had an effect, but still the output files are not the same. Also, when I compile with Digital Visual Fortran V6 the output files are equal (DVF is on AMD running Windows 2000) even with optimization off. However,the outputs with optimization on and off are not the same (will have to tackle it some other time, unless it is related to my current problem).
So, I'm stuck. I've seen a thread were somebody had the same problem but opted to use an older compiler. Do I need tokeep using DVF or do I need to try to fix the code (I'm assuming that there are no more compiler flags that I could set to fix the problem).
Any suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please try version 12 with the /Qimf-arch-consistency switch. That's what it's for. None of the options you selected would have any effect on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you set /arch:ia32 you are likely to see more implicit promotion of single precision to double with optimization. If your results appear to be more accurate with this implicit promotion, it may mean you should be writing in double precision explicitly somewhere.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve,
I followed your advice and downloaded a trial version of IVF 12. I added /Qimf-arch-consistency switch:true to the compiler flags and now I get the same results when I ran in different processors.
As to the different results between DVF and IVF, I now know, from reading other posts here, that I have a lot of work ahead of me. It is also good to know that is only a coding issue and not the compiler.
Thank you very much for your help, you, as well as TimP, have saved me a lot of time. Tino
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We're glad to have been of help.

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