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

optimization flag confusion

grs2103
Beginner
598 Views
Looking at the reference guide, there are a lot of optimization flag options. Assuming I'm executing my program on the same system I'm compiling and linking it (OS X core2duo), is there, in general, anything other than the -fast flag I should try? Will it automatically optimize for the architecture, or should I be giving it a -mtune flag?
0 Kudos
2 Replies
TimP
Honored Contributor III
598 Views
-fast does select the option tieing the code most closely to the build CPU.
As you have dual core, you can do a quick check for threading opportunities with -parallel.
The first priority should be to assure correctness, and to make sure that you don't lose any accuracy by not invoking '-assume protect-parens -prec-div -prec-sqrt' (or maybe -fp-model source, which includes those).
0 Kudos
grs2103
Beginner
598 Views
Quoting - tim18
-fast does select the option tieing the code most closely to the build CPU.
As you have dual core, you can do a quick check for threading opportunities with -parallel.
The first priority should be to assure correctness, and to make sure that you don't lose any accuracy by not invoking '-assume protect-parens -prec-div -prec-sqrt' (or maybe -fp-model source, which includes those).

I gather compiling with the flag -fast -fp-model precise will optimize as much as possible while retaining floating point accuracy?
0 Kudos
Reply