Discover Where Vectorization Will Pay Off The Most

This section shows how to get started using only the Intel Advisor Survey analysis. The main advantage of using this single-analysis Vectorization Advisor workflow is low runtime overhead. The main disadvantage is it may not provide enough data to help you make improvement decisions; you may need to dig deeper using another workflow.

Intel Advisor Workflow: Discover Where Vectorization Will Pay Off the Most

Survey Report - Offers integrated compiler report data and performance data that shows where vectorization will pay off the most; if vectorized loops are providing benefit, and if not, why not; un-vectorized loops and why they are not vectorized; and performance problems in general.

Set Up Environment

Environment

Set-Up Tasks

Intel® Parallel Studio XE/Linux* OS

  • Do one of the following:

    • Run one of the following source commands:

      • For csh/tcsh users: source <advisor-install-dir>/advixe-vars.csh

      • For bash users: source <advisor-install-dir>/advixe-vars.sh

      The default installation path, <advisor-install-dir>, is below:

      • /opt/intel/ for root users

      • $HOME/intel/ for non-root users

    • Add <advisor-install-dir>/bin32 or <advisor-install-dir>/bin64 to your path.

    • Run the <parallel-studio-install-dir>/psxevars.csh or <parallel-studio-install-dir>/psxevars.sh command. The default installation path, <parallel-studio-install-dir>, is below:

      • /opt/intel/ for root users

      • $HOME/intel/ for non-root users

  • Set the VISUAL or EDITOR environment variable to identify the external editor to launch when you double-click a line in an Intel Advisor source window. (VISUAL takes precedence over EDITOR.)

  • Set the BROWSER environment variable to identify the installed browser to display Intel Advisor documentation.

  • If you are using Intel® Threading Building Blocks (Intel® TBB), set the TBBROOT environment variable so your compiler can locate the installed Intel TBB include directory.

  • Make sure you run your application in the same Linux* OS environment as the Intel Advisor.

Intel Parallel Studio XE/Windows* OS

Note

Setting up the Windows* OS environment is necessary only if you plan to use the advixe-cl command to run the command line interface, or choose to use the advixe-gui command to launch the Intel Advisor standalone GUI instead of using available GUI or IDE launch options.

Do one of the following:

  • Run the <advisor-install-dir>\advixe-vars.bat command.

    The default installation path, <advisor-install-dir>, is below C:\Program Files (x86)\IntelSWTools\ (on certain systems, instead of Program Files (x86), the directory name is Program Files ).

  • Run the <parallel-studio-install-dir>\psxevars.bat command.

    The default installation path, <parallel-studio-install-dir>, is below C:\Program Files (x86)\IntelSWTools\.

Intel® System Studio

Note

Setting up the environment is necessary only if you plan to use the advixe-cl command to run the command line interface, or choose to use the advixe-gui command to launch the Intel Advisor standalone GUI instead of using available GUI or IDE launch options.

Run the <advisor-install-dir>\advixe-vars.bat command to set up your environment. The default installation path, <advisor-install-dir>, is below C:\Program Files (x86)\IntelSWTools\ (on certain systems, instead of Program Files (x86), the directory name is Program Files ).

Launch Intel Advisor and Create a Project

To launch the:

  • Intel Parallel Studio XE/Intel Advisor standalone GUI:

    • In the Linux* OS: Run the advixe-gui command.

    • In the Windows* OS: From the Microsoft Windows* All Apps screen, select Intel Parallel Studio XE 201n > Intel Advisor 201n

  • Intel System Studio/Intel Advisor standalone GUI: Choose Tools > Intel Advisor > Launch Intel Advisor from the IDE menu.

  • Intel Advisor plug-in to the Visual Studio* IDE: Open your solution in the Visual Studio* IDE.

To create an Intel Advisor project:

  1. Do one of the following

    • In the standalone GUI: Choose File > New > Project… to open the Create a Project dialog box. Supply a name and location for your project, then click the Create Project button to open the Project Properties dialog box.

    • In the Visual Studio* IDE: Choose Project > Intel Advisor 201n Project Properties... to open the Project Properties dialog box.

  2. On the left side of the Analysis Target tab, ensure the Survey Hotspots Analysis type is selected, then set appropriate parameters. (Setting the binary/symbol search and source search directories is optional for the Vectorization Advisor.)

Run Survey Analysis

Intel Advisor Vectorization Workflow Tab: Survey Target

Under Survey Target in the Vectorization Workflow, click the Intel Advisor control: Run analysis control to collect Survey data while your application executes. Upon completion the Intel Advisor displays a Survey Report similar to the following.

Note

If the Workflow is not displayed in the Visual Studio IDE: Click the Intel Advisor toolbar icon icon on the Intel Advisor toolbar.


Intel Advisor: Survey Report controls
There are many controls available to help you focus on the data most important to you, including the following:

1

Click the control to save a read-only result snapshot you can view any time.

Intel Advisor stores only the most recent analysis result. Visually comparing one or more snapshots to each other or to the most recent analysis result can be an effective way to judge performance improvement progress.

To open a snapshot, choose File > Open > Result...

2

Click the various Filter controls to temporarily limit displayed data based on your criteria.

3

Click the control to view loops in non-executed code paths for various instruction set architectures (ISAs). Prerequisites:

  • Compile the target application for multiple code paths using the Intel compiler.

  • Enable the Analyze loops in not executed code path checkbox in Project Properties > Analysis Target > Survey Hotspots Analysis.

4

This toggle control currently combines two features: The View Configurator and the Smart Mode filter.

  • View Configurator - Toggle on the Customize View control to choose the view layout to display: Default, Smart Mode, or a customized view layout. To create a customized view layout you can apply to this and other projects:

    1. Click the Settings control next to the View Layout drop-down list to open the Configure Columns dialog box.

    2. Choose an existing view layout in the Configuration drop-down list.

    3. Enable/disable columns to show/hide.

      Outcome: Copy n is added to the name of the selected view layout in the Configuration drop-down list.

    4. Click the Rename button and supply an appropriate name for the customized view layout.

    5. Click OK to save the customized view layout.

  • Smart Mode Filter - Toggle on the Customize View control to temporarily limit displayed data to the top potential candidates for optimization based on Total CPU Time (the time your application spends actively executing a function/loop and its callees). In the Top drop-down list, choose one of the following:

    • The Number of top loops/functions to display

    • The Percent of Total CPU Time the displayed loops/functions must equal or exceed

Intel Advisor: View Configurator

5

Click the button to search for specific data.

6

Click the tab to open various Intel Advisor reports or views.

7

Right-click a column header to:

  • Hide the associated report column.

  • Resume showing all available report columns.

  • Open the Configure Columns dialog box (see #4 for more information).

8

Click the toggle to show all available columns in a column set, and resume showing a limited number of preset columns in a column set.

9

Click the control to:

  • Show options for customizing data in a column or column set.

  • Open the Configure Columns dialog box (see #4 for more information).

For example, click the control in the Compute Performance column set to:

  • Show data for floating-point operations only, for integer operations only, or for the sum of floating-point and integer operations.

  • Determine what is counted as an integer operation in integer calculations:

    • Choose Show Pure Compute Integer Operations to count only ADD, MUL, IDIV, and SUB operations.

    • Choose Show All Operations Processing Integer Data to count ADD, ADC, SUB, MUL, IMUL, DIV, IDIV, INC/DEC, shift, and rotate operations.

10

Click the control to show/hide a chart that helps you visualize actual performance against hardware-imposed performance ceilings, as well as determine the main limiting factor (memory bandwidth or compute capacity), thereby providing an ideal roadmap of potential optimization steps.

11

Click a data row in the top of the Survey Report to display more data specific to that row in the bottom of the Survey Report. Double-click a loop data row to display a Survey Source window. To more easily identify data rows of interest:

  • = Vectorized function

  • = Vectorized loop

  • = Scalar function

  • = Scalar loop

12

Click a checkbox to mark a loop for deeper analysis.

13

If present, click the image to display code-specific how-can-I-fix-this-issue? information in the Recommendations pane.

14

If present, click the image to view the reason automatic compiler vectorization failed in the Why No Vectorization? pane.

15

Click the control to show/hide the Workflow pane.

Investigate Loops

If all loops are vectorizing properly and performance is satisfactory, you are done! Congratulations!

If one or more loops is not vectorizing properly and performance is unsatisfactory:

  1. Improve application performance using various Intel Advisor features to guide your efforts, such as:

    • Information in the Intel Advisor control: RecommendationsPerformance Issues column and associated Intel Advisor control: RecommendationsRecommendations tab
      Intel Advisor: Recommendations

      Table of contents on right, showing recommendations for each issue relevant to the loop. Expandable/collapsible recommendations on left (some reference details specific to the analyzed loop, such as vector length or trip count). Number of bars on recommendation icon shows confidence this recommendation is the appropriate fix.
    • Suggestions in Next Steps: After Running Survey Analysis in the Intel Advisor User Guide

    • Optional Dependencies and Memory Access Patterns (MAP) analyses to help you dig deeper

  2. Rebuild your modified code.

  3. Run another Survey analysis to verify all loops are vectorizing properly and performance is satisfactory.

For more complete information about compiler optimizations, see our Optimization Notice.