Intel Advisor optimal flags and settings

453 views Asked by At

I'm reading this tutorial about code vectorization using Intel Advisor. In particular in this page they suggest to:

Build the target sample application in release mode ... compiler options: -O2 -g

And following:

To build your own applications to produce the most accurate and complete Vectorization Advisor analysis results, build an optimized binary in release mode using the following settings.

-g -O2 (or higher) -qopt-report=5 -vec -simd -qopenmp

Now, I have a couple of questions:

  1. I thought that in release mode we didn't produce any debug information (which is produced in the "debug mode"), so no -g should be included
  2. The weirdest thing is that in the Makefile given for the samples code (vec_samples in /opt/intel/advisor_*/...) uses only -g -O2 why they don't include all the other options. Why?
1

There are 1 answers

0
zam On BEST ANSWER

The relevant entry point to fresh Intel Advisor tutorials is Getting Started, where you can pick and choose appropriate sub-tutorials. Vectorization Advisor sub-tutorial for Linux can be found here. It precisely says that:

-qopt-report=5 : necessary for version 15.0 of the Intel compiler; unnecessary for version 16.0 and higher

With regards to -vec, -simd, -openmp, the tutorial slightly confuses flags needed for proper Advisor functioning (-g, -O2, optionally -opt-report) vs. flags needed for "proper" Compiler functioning ( -vec, -simd and -openmp). The later ones are just flags controlling compiler's vector code generation, they have nothing to do with Advisor profiling capabilities so you may or may not use them.


To give you deeper understanding: there is an important feature in Advisor, which is called Intel Advisor Survey "Compiler Integration". This feature leverages the data relatively similar but not identical to opt-report. In order to make this feature working you need

  1. Using Intel Coimpiler 14.x beta, 15.x, 16.x or 17.x
  2. -g (enable debug info) and -O2 or higher (enable some optimization)
  3. Optional (for Intel Compiler 15.x only) -qopt-report5

All other features in Intel Advisor work equally well regardless of Compiler version (item 1 above) or opt-report and versions (item 3 above) , but they all still require -g (part of option 2 above). -O2 is not needed for some features, but it is typically useless to deal with -O0 or -O1 compiled binaries when analyzing performance aspects.