- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, everyone!
I observed the default optimization option for ifort is -O2, and I tried -O3 and I found the performance of the compiled binary could be improved. Thus, I want to know why not to set -O3 as the default option? Is it possible for the -O3 option to produce some unexpected numerical instability?
Thank you in advance!
I observed the default optimization option for ifort is -O2, and I tried -O3 and I found the performance of the compiled binary could be improved. Thus, I want to know why not to set -O3 as the default option? Is it possible for the -O3 option to produce some unexpected numerical instability?
Thank you in advance!
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - woshiwuxin
I observed the default optimization option for ifort is -O2, and I tried -O3 and I found the performance of the compiled binary could be improved. Thus, I want to know why not to set -O3 as the default option? Is it possible for the -O3 option to produce some unexpected numerical instability?
I usually set -O3 -assume protect_parens,minus0 -prec-div -prec-sqrt so as to improve standards compliance and avoid risky optimizations which don't often improve performance on current CPUs.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - woshiwuxin
I observed the default optimization option for ifort is -O2, and I tried -O3 and I found the performance of the compiled binary could be improved. Thus, I want to know why not to set -O3 as the default option? Is it possible for the -O3 option to produce some unexpected numerical instability?
I usually set -O3 -assume protect_parens,minus0 -prec-div -prec-sqrt so as to improve standards compliance and avoid risky optimizations which don't often improve performance on current CPUs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tim18
-O3 doesn't always improve performance, and may increase compile time. On a large application, it's likely to be necessary to find out which source files are best compiled at -O3.
I usually set -O3 -assume protect_parens,minus0 -prec-div -prec-sqrt so as to improve standards compliance and avoid risky optimizations which don't often improve performance on current CPUs.
I usually set -O3 -assume protect_parens,minus0 -prec-div -prec-sqrt so as to improve standards compliance and avoid risky optimizations which don't often improve performance on current CPUs.
Hi all.
I totally agree.
I hope I'm right: I knew that up to -O3 compilation, the compiler could increase computing performance without a deep "restructuring" of the code (which would take place with -O4 and more with -O5)...
I use -O3 almost every time and I have never had problems.
Surely the advice to set -O3 -assume protect_parens,minus0 -prec-div -prec-sqrt erases any possibility of risks.
Greetings
Herger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - herger
I hope I'm right: I knew that up to -O3 compilation, the compiler could increase computing performance without a deep "restructuring" of the code (which would take place with -O4 and more with -O5)...
I use -O3 almost every time and I have never had problems.
Surely the advice to set -O3 -assume protect_parens,minus0 -prec-div -prec-sqrt erases any possibility of risks.
Intel compilers may be set for more aggressive interprocedural optimization by setting -ip or -ipo options; a less aggressive setting of -ip is included in -O2 and -O3.
Ifort already performs many loop restructuring optimizations at -O2, and more at -O3.

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