Intel® Advisor User Guide

ID 766448
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Run Vectorization and Code Insights Perspective from Command Line

Vectorization and Code Insights perspective includes several analyses that you can run depending on the desired result. The main analysis is the Survey, which collects performance data for loops and functions in your application and identifies under-vectorized and non-vectorized loops/functions. The Survey analysis is enough to get the basic insights about your application performance.

TIP:
See Intel Advisor cheat sheet for quick reference on command line interface.

Prerequisites

Set Intel Advisor environment variables with an automated script to enable the command line interface (CLI).

Run Vectorization and Code Insights Perspective

Note: In the commands below, make sure to replace the myApplication with your application executable path and name before executing a command. If your application requires additional command line options, add them after the executable name.

  1. Run the Survey analysis.
    advisor --collect=survey --project-dir=./advi_results -- ./myApplication
  2. Run the Characterization analysis to collect trip counts and FLOP data:
    advisor --collect=tripcounts --flop --stacks --project-dir=./advi_results -- ./myApplication
  3. Optional: Run the Memory Access Patterns analysis for loops/functions with the Possible Inefficient Memory Access Patter issue.
    advisor --collect=map --select=has-issue --project-dir=./advi_results -- ./myApplication
  4. Optional: Run the Dependencies analysis to check for loop-carried dependencies in loops/functions with Assumed dependency present issue:
    advisor --collect=dependencies --project-dir=./advi_results --select=has-issue -- ./myApplication

You can view the results in the Intel Advisor graphical user interface (GUI), print a summary to a command prompt/terminal, or save to a file. See View the Results below for details.

Analysis Details

The Vectorization and Code Insights workflow includes the following analyses:

  1. Survey to collect initial performance data.
  2. Characterization with trip counts and FLOP data to collect additional performance details.
  3. Memory Access Patterns (optional) to identify memory traffic data and memory usage issues.
  4. Dependencies (optional) to identify loop-carried dependencies.

Each analysis has a set of additional options that modify its behavior and collect additional performance data. The more analyses you run and option you use, the more useful data about your application you get.

Consider the following options:

Characterization Options

To run the Characterization analysis, use the following command line action: --collect=tripcounts.

Recommended action options:

Options

Description

--flop

Collect data about floating-point and integer operations, memory traffic, and mask utilization metrics for AVX-512 platforms.

--stacks

Enable advanced collection of call stack data.

--enable-cache-simulation

Model CPU cache behavior on your target application.

--cache-config=<config>

Set the cache hierarchy to collect modeling data for CPU cache behavior. Use with enable-cache-simulation.

The value should follow the template: [<num_of_caches>]:[<num_of_ways_caches_connected> ]:[<cache_size>]:[<cacheline_size>] for each of three cache levels separated with a /.

--cachesim-associativity=<num>

Set the cache associativity for modeling CPU cache behavior: 1 | 2 | 4 | 8 (default) | 16. Use with enable-cache-simulation.

--cachesim-mode=<mode>

Set the focus for modeling CPU cache behavior: cache-misses | footprint | utilization. Use with enable-cache-simulation.

See advisor Command Option Reference for more options.

Memory Access Patterns Options

The Memory Access Patterns analysis is optional because it adds a high overhead. To run the Memory Access Patterns analysis, use the following command line action: --collect=map.

Recommended action options:

Options

Description

--select=<string>

Select loops for the analysis by loop IDs, source locations, or criteria such as scalar, has-issue, or markup=<markup-mode>. This option is required.

See select for more selection options.

--enable-cache-simulation

Model CPU cache behavior on your target application.

--cachesim-cacheline-size=<num>

Set the cache line size (in bytes) for modeling CPU cache behavior: 4 | 8 | 16 | 32 | 64 (default) | 128 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384 | 32768 | 65536. Use with enable-cache-simulation.

--cachesim-sets=<num>

Set the cache set size (in bytes) for modeling CPU cache behavior: 256 | 512 | 1024 | 2048 | 4096 (default) | 8192. Use with enable-cache-simulation.

See advisor Command Option Reference for more options.

Dependencies Options

The Dependencies analysis is optional because it adds a high overhead and is mostly necessary if you have scalar loops/functions in your application. To run the Dependencies analysis, use the following command line action: --collect=dependencies.

Recommended action options:

Options

Description

--select=<string>

Select loops for the analysis by loop IDs, source locations, criteria such as scalar, has-issue, or markup=<markup-mode>. This option is required.

See select for more selection options.

--filter-reductions

Mark all potential reductions with a specific diagnostic.

See advisor Command Option Reference for more options.

Next Steps

Continue to explore the Vectorization and Code Insights results with a preferred method. For details about the metrics reported, see CPU and Memory Metrics.

See Also