Optimization reports provide valuable information related to loops that the compiler has or has not been able to vectorize. For the Intel compilers installed on Stampede2, these reports are generated in response to the -qopt-report<=n> flag, where n is an integer. This flag actually generates information on all the optimizations carried out by the compiler; to restrict the output to the results of vectorization only, add the flag -qopt-report-phase=vec. (This combination of flags replaces the now-deprecated flag -vec-report<=n>.) Increasing values of n lead to extra levels of detail regarding vectorization, as follows:

Optimization report options and vectorization details with Intel compilers
n Description of information presented
0No vector report
1Lists the loops that were vectorized
2(default level) Adds the loops that were not vectorized, plus a short reason
3Adds summary information from the vectorizer about all loops
4Adds verbose information from the vectorizer about all loops
5Adds details about any data dependencies encountered (proven or assumed)

By default, reports are written to files suffixed with .optrpt, one per source file. The contents of the reports will appear in your terminal window, instead, if you use the -qopt-report-file=stdout option. However, be aware that these reports can be quite lengthy, especially the higher-numbered levels. (There are numerous ways to customize your optimization reports; see Intel's man pages for details.)

For the GNU compilers, the corresponding options are -fopt-info for a complete optimization report, and -fopt-info-vec for just the portion from the vectorizer. GCC's default verbosity is roughly equivalent to level 1 in the table above. For a level comparable to 2, add a second option with -missed, e.g.,

For an equivalent to level 5 from the GCC vectorizer, use -fopt-info-vec-all. The vectorization report is displayed in your terminal window (on stderr) unless =<filename> is specified.

Vector reports are essential for determining where the compiler is or is not vectorizing. Remember, the compiler must be conservative when vectorizing; it can sometimes fail to vectorize a loop just because it cannot rule out a potential problem. Vectorization reports allow the developer to locate such situations and implement fixes. It may be possible for the developer to supply hints (or guarantees) that allow the compiler to adjust its assumptions about potential data dependencies, e.g., or about other constructs that are inhibiting vectorization. (In the next section, we take a look at such issues and the hints that can overcome them.)

Try it!

Go ahead and do steps 1-5 of the Exercise, in which you use vectorization reports to see the effects of different compiler options. You'll notice that the instructions apply specifically to the Intel compiler on Stampede2, but you can follow similar steps on any workstation with Intel C/C++ or GCC.

 
©   Cornell University  |  Center for Advanced Computing  |  Copyright Statement  |  Inclusivity Statement