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

IBM vs Intel fortran compilers

amit-amritkar
New Contributor I
1,253 Views
Hi,

I have a large CFD code written in Fortran, I compiled the code with following options using the

IBM compiler
-O3 -q64 -qwarn64 -qautodbl=dbl4 -qalign=4k


and

Intel compiler
-r8 -align all -O3


I did test runs on a simple problem with MPI for both the binaries above and found that both the compilers are giving different results when I compare the output.

Now the Intel compiled code runs on a SGI altix shared memory machine as an MPI process and IBM code runs on a cluster of Apple PowerMac G5 computers.
Is this inconsistent result because of the -O3 compiling on the both the compilers or the difference in libraries or am I missing something here?

Thanks,
Amit
0 Kudos
2 Replies
TimP
Honored Contributor III
1,253 Views
You leave a lot of dependence on guesswork, including guessing why you don't tell us if you got better agreement when you set options for numerical consistency. I believe both compilers could violate parentheses with the quoted options. Supposing that both systems use fused multiply-add so as occasionally to gain accuracy when multiplication is followed by add/subtract, it won't have the same effects in each case, and that will happen not only at -O3.
Plenty of expressions allow for different orders of evaluation even when standards compliance options are set, and changing from -O3 wouldn't change that. As you hint, math functions can't be expected to be identical.
How do you know compilers give different results? Did you use the same MPI in both cases? Can you get identical results from run to run?
I took some reconsideration to figure out that the Altix system must be Itanium, on the assumption that the advertised Xeon based shared memory systems haven't yet been produced.

0 Kudos
amit-amritkar
New Contributor I
1,253 Views
Quoting - tim18
You leave a lot of dependence on guesswork, including guessing why you don't tell us if you got better agreement when you set options for numerical consistency. I believe both compilers could violate parentheses with the quoted options. Supposing that both systems use fused multiply-add so as occasionally to gain accuracy when multiplication is followed by add/subtract, it won't have the same effects in each case, and that will happen not only at -O3.
Plenty of expressions allow for different orders of evaluation even when standards compliance options are set, and changing from -O3 wouldn't change that. As you hint, math functions can't be expected to be identical.
How do you know compilers give different results? Did you use the same MPI in both cases? Can you get identical results from run to run?
I took some reconsideration to figure out that the Altix system must be Itanium, on the assumption that the advertised Xeon based shared memory systems haven't yet been produced.


Tim,

Thanks for your reply.
I figured it out that I had something else wrong and I need to fix it before I can proceed any further with this line of enquiry.

Thanks again,
Amit
Amit
0 Kudos
Reply