- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Attached is a reduced test case where the use of OpenMP inhibits vectorization for no apparent reason, resulting in a substantial performance decrease.
Using the -vec-report flag, the missed vectorization is the loop beginning on line 77. If compiled without OpenMP, the two function calls to "weno6" are inlined and vectorized; without OpenMP, the loop is not vectorized. It's not clear to me if ifort is inlining the function calls when OpenMP is active, which may be the source of the problem. Using -opt-report, ifort reports a possible vector dependence in the loop, but only when compiled with OpenMP. A workaround is to add "!DEC$ SIMD" before the loop, in which case it is vectorized.
This is with ifort 12.1.6 20120928 on Mac OS X 10.8.3. The code is compiled with "ifort -O3 -finline -vec-report".
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It certainly looks as if your function is inlined.
I wouldn't say there is "no apparent reason" for non-vectorization, but the reasons I've seen from various compiler versions are bogus.
It's not the first time -openmp has caused the compiler to be more cautious about dependencies. This also looks complicated enough to fall under the stated policy of relying on the directives to control optimization in cases of any doubt.
If you're interested in the direction ifort is taking, you might get the beta compiler and file a problem report, possibly with respect to both the old and future directives.

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