Intel® Advisor Help

Collection Controls to Minimize Analysis Overhead

Issue

Running your target application with the Intel® Advisor can take substantially longer than running your target application without the Intel Advisor. Depending on an accuracy level and analyses you choose for a perspective, different overhead is added to your application execution time. For example:

Runtime Overhead / Analysis

Survey

Characterization

Dependencies

MAP

Target application runtime with Intel® Advisor compared to runtime without Intel® Advisor

1.1x longer

2 - 55x longer

5 - 100x longer

5 - 20x longer

Solutions

Use the following techniques to skip uninteresting parts of your target application, such as the initialization phase, and analyze only interesting parts.

Pause Collection/Resume Collection Using Annotations

Minimize collection overhead.

Applicable analyses: Survey, Dependencies.

Some analysis types recognize the structural annotations typically used in the Threading perspective workflow.

Use when:

To pause collection, add the following annotation to your code:

To resume collection, add the following annotation to your code:

Note

C# and .NET support is deprecated starting Intel® Advisor 2021.1.

See Pause Collection and Resume Collection Annotations for more information.

Pause Collection/Resume Collection Using API Methods

Minimize collection overhead using the Intel® Instrumentation and Tracing Technology (ITT) API.

Tip

For MPI applications, you can also use a standard MPI-specific function MPI_Pcontrol(<N>) to pause and resume data collection. This function requires no changes in the application building process, unlike the ITT API calls, which require linking of a static ITT API library. See Control Collection with an MPI_Pcontrol Function.

Applicable analyses: Survey, Characterization with Trip Counts or FLOP collection enabled.

Use when:

Prerequisites:

After performing the prerequisites and recompiling, do one of the following:

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.

To attach ITT APIs to a launched application, that is, to collect API data on an application that is already launched, point the target application to the ittnotify_collector library using an environment variable:

Note

Use the full path to the library without quotations marks.

After you complete configuration, start the instrumented application in the correct environment. Intel® Advisor collects API data even if the application is launched before the Intel® Advisor is launched.

You can find the ITT API documentation at https://github.com/intel/ittapi.

Start Target Application With Collection Paused

Minimize collection overhead.

Applicable analyses: Survey, Characterization with Trip Counts and FLOP collection enabled.

Use when you do not want to analyze the early phase(s) of your target application, such as the initialization phase, but you want analysis in ready mode.

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.

To implement, do one of the following:

Note

You can use different techniques to resume collection. The most common is __itt_resume.

Start Target Application With Collection Paused/Resume Collection After N Seconds

Minimize collection overhead.

Applicable analyses: Survey, Characterization with Trip Counts and FLOP collection enabled.

Use when...

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.

To implement, do one of the following:

Note

Use a value representing seconds in the GUI field and milliseconds in the integer argument.

Stop Collection After N Seconds

Minimize collection overhead.

Applicable analyses: Survey, Characterization with Trip Counts and FLOP collection enabled, Dependencies, Memory Access Patterns.

This is the flip side of the Start target application with collection paused technique. Use when...

To implement, enable Project Properties > Analysis Target > [Name] Analysis > Advanced > Automatically stop collection after (sec) checkbox and supply the desired value, where [Name] is Survey or Trip Counts and FLOP.

Click the standard run control on the Analysis Workflow pane to run the desired analysis.

Note

Use a value representing seconds in both the GUI field and integer argument.

Stop Collection

Minimize collection overhead.

Applicable analyses: Survey, Characterization with Trip Counts and FLOP collection enabled, Dependencies, Memory Access Patterns.

Use when...

To implement, do one of the following:

Manually Pause Collection/Manually Resume Collection

Minimize collection overhead.

Applicable analyses: Survey, Characterization with Trip Counts and FLOP collection enabled.

Use when...

To implement, do one of the following to pause analysis data collection (the target application continues running, but analysis data collection stops):

Do one of the following to resume analysis data collection:

Attach to Process/Detach from Process

Minimize collection overhead.

Applicable analyses: Survey, Characterization with Trip Counts and FLOP collection enabled without call stacks.

This technique is similar to the Start target application with collection paused technique, except you can attach to an already running process. This is particularly beneficial if:

GUI:

  1. Choose Project Properties > Analysis Target > [Name] Analysis> Launch Application drop-down list > Attach to Process, where [Name] is Survey or Trip Counts and FLOP.

  2. Disable the Inherit settings from Survey Hotspots Analysis Type checkbox.

  3. Choose the Process name or PID option and identify a process.

  4. Supply other information as desired and close the Project Properties dialog box.

  5. Click the standard run control on the Analysis Workflow pane to run the desired analysis.

CLI: Use the advisor CLI action option --target-pid=<unsigned integer> or --target-process=<string> to attach to a process when running the desired analysis. For example:

advisor --collect=survey --project-dir=./advi_results --result-dir=./myAdvisorResult --target-process=myProcess 

Do one of the following to stop collecting analysis data on a process (the process continues running but analysis data collection stops):

Note

  • Ensure call stacks are disabled (which is the default setting) if you run the Characterization with Trip Counts and FLOP collection enabled analysis:

    • Disable the Project Properties > Analysis Target > Trip Counts and FLOP Analysis > Advanced > Collect stacks checkbox.

    • Add the advisor CLI action option --no-stacks to the --collect command, or simply omit a --stacks action option on the --collect command.

  • Using the advisor CLI action --command=stop kills the process (which also stops analysis data collection).

See Also