Intel® Advisor Help
Running your target application from start to finish with the Intel Advisor can take substantially longer than running your target application without the Intel Advisor. For example:
Runtime Overhead / Analysis |
Survey |
Trip Counts & FLOP |
Roofline |
Dependencies |
MAP |
---|---|---|---|---|---|
Target application runtime with Intel Advisor compared to runtime without Intel Advisor |
1.1x longer |
3 - 8x longer |
3.1 - 8.1x longer |
5 - 100x longer |
5 - 20x longer |
Use the following techniques to skip uninteresting parts of your target application, such as the initialization phase, and analyze only interesting parts.
Minimization Technique |
Impacted Intel Advisor Analyses |
Summary |
---|---|---|
|
Pause collection:
Resume collection:
|
|
Pause collection/Resume collection using annotations See Pause Collection and Resume Collection Annotations for more information. |
Some analysis types recognize the structural annotations typically used in the Threading Advisor workflow. |
Pause collection:
Resume collection:
|
|
Start target application with collection paused:
NoteYou can use different techniques to resume collection. The most common is __itt_resume |
|
Start target application with collection paused/Resume collection after N seconds |
|
GUI control: Project Properties > Analysis Target > [Name] Analysis > Advanced > Automatically resume collection after (sec) checkbox CLI action option: -resume-after=<integer> NoteUse a value representing seconds in the GUI field and milliseconds in the integer argument. |
All |
GUI control: Project Properties > Analysis Target > [Name] Analysis > Advanced > Automatically stop collection after (sec) checkbox and field CLI action option: -stop-after=<integer> NoteUse a value representing seconds in both the GUI field and integer argument. |
|
All |
GUI control: Vectorization Workflow pane > Stop current analysis control and Site Coverage widget CLI: action: -command=stop |
|
|
Pause collection:
Resume collection:
|
|
|
Attach to process:
Detach from process:
|
Minimize collection overhead.
Applicable analyses: Roofline, Survey, Trip Counts and FLOP.
Use when:
Modifying/recompiling your target application is not an issue.
You do not want to analyze one or more uninteresting parts of your target application.
The interesting parts of your target application involve more than a few loops.
Prerequisites:
Add to your codebase the ittnotify.h header file, which contains all the Instrumentation and Tracing Technology (ITT) APIs used for instrumentation.
Configure your build system to reach ITT API header file and libraries, where <install-dir> is the Intel Advisor installation directory.
Add the appropriate entry to your INCLUDE path:
C++: <install-dir>\include
Fortran: <install-dir>\include\ia32 or <install-dir>\include\ia64
Microsoft Visual Studio* IDE: Project Properties > C/C++ | Fortran > General > Additional Include Directories.
Add <install-dir>\lib32 or <install_dir>\lib64 to your LIBRARIES path.
Visual Studio IDE: Project Properties > C/C++ | Fortran > General > Additional Include Libraries.
Link your target application to the static library libittnotify.a (Linux* OS) or libittnotify.lib (Windows* OS) by passing -littnotify to your compiler.
Visual Studio IDE: Project Properties > Linker > Input > Additional Dependencies
Insert the _itt_pause API method before uninteresting parts of your target application and the _itt_resume API method before interesting parts of your target application.
Example 1: The following snippet plus the standard run control collects analysis data twice - at the beginning and the middle of the snippet:
#include <ittnotify.h> int main(int argc, char* argv[]) { // Do work here __itt_pause(); // Do uninteresting work here __itt_resume(); // Do work here __itt_pause(); // Do uninteresting work here return 0; }
Example 2: The following snippet plus the standard run control collects analysis data only once - in the middle of the snippet:
#include <ittnotify.h> int main(int argc, char* argv[]) { __itt_pause(); // Do uninteresting work here __itt_resume(); // Do work here __itt_pause(); // Do uninteresting work here return 0; }
Example 3: The following snippet plus the standard run control collects analysis data only once - at the end of the snippet:
#include <ittnotify.h> int main(int argc, char* argv[]) { __itt_pause(); // Do uninteresting work here __itt_resume(); // Do work here return 0; }
Example 4: The following snippet plus the
Start Paused control collects analysis data only once - at the end of the snippet:
#include <ittnotify.h> int main(int argc, char* argv[]) { // Do uninteresting work here __itt_resume(); // Do work here return 0; }
After performing the prerequisites and recompiling, do one of the following:
Click the standard run control or the
Start Paused control on the
Workflow pane to run the desired analysis.
Use the CLI action -collect with or without the CLI action option -start-paused to run the desired analysis. For example:
advixe-cl -collect survey -project-dir ./myAdvisorProj -- ./bin/myTargetApplication
Minimize collection overhead.
Applicable analyses: Survey, Trip Counts and FLOP.
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.
To implement, do one of the following:
Click the associated
control on the
Workflow pane to run the desired analysis.
Use the CLI action option -start-paused when you run the desired analysis. For example:
advixe-cl -collect survey -project-dir ./myAdvisorProj -start-paused -- ./bin/myTargetApplication
You can use different techniques to resume collection. The most common is __itt_resume.
Minimize collection overhead.
Applicable analyses: Survey, Trip Counts and FLOP.
Use when...
You do not want to modify/recompile your target application.
You do not want to analyze the initialization phase of your target application.
You have a good idea of the time interval of interest, but pinpointing the exact beginning of the interesting part of your target application is not important.
The interesting part of your target application is more than a few loops.
To implement, do one of the following:
Enable the Project Properties > Analysis Target > [Name] Analysis > Advanced > Automatically resume collection after (sec) checkbox and supply the desired value.
Click the standard run control on the Workflow pane to run the desired analysis. (Collection automatically starts in the paused state.)
Use the CLI action option -resume-after=<integer> when your run the desired analysis. For example:
advixe-cl -collect survey -project-dir ./myAdvisorProj -resume-after=30 -- ./bin/myTargetApplication
Use a value representing seconds in the GUI field and milliseconds in the integer argument.
Minimize collection overhead.
Applicable analyses: Roofline, Survey, Trip Counts and FLOP, Dependencies, Memory Access Patterns.
This is the flip side of the Start target application with collection paused technique. Use when...
You do not want to modify/recompile your target application.
You do not want to analyze the end of your target application.
You have a good idea of the time interval of interest, but pinpointing the exact end of the interesting part of your target application is not important.
The interesting part of your target application is more than a few loops.
To implement, do one of the following:
Enable Project Properties > Analysis Target > [Name] Analysis > Advanced > Automatically stop collection after (sec) checkbox and supply the desired value.
Click the standard run control on the Workflow pane to run the desired analysis.
Use the CLI action option -stop-after=<integer> when you run the desired analysis. For example:
advixe-cl -collect survey -project-dir ./myAdvisorProj -stop-after=30 -- ./bin/myTargetApplication
Use a value representing seconds in both the GUI field and integer argument.
Minimize collection overhead.
Applicable analyses: Roofline, Survey, Trip Counts and FLOP, Dependencies, Memory Access Patterns.
Use when...
You do not want to modify/recompile your target application.
You do not want to analyze the end of your target application.
You can detect the time interval of interest based on target application output.
The interesting part of your target application is more than a few loops.
To implement, do one of the following:
Click the associated
control on the
Workflow pane when running the desired analysis.
If running a Dependencies or Memory Access Patterns analysis, use the
Site Coverage bar to determine when all marked loops are analyzed at least once:
Use the CLI action -command=stop when you run the desired analysis. For example:
advixe-cl -command=stop -result-dir ./myAdvisorResult
Minimize collection overhead.
Applicable analyses: Survey, Trip Counts and FLOP.
Use when...
You can detect the time interval of interest based on target application output.
Your need to pause or resume is unplanned and spontaneous.
To implement, do one of the following to pause analysis data collection (the target application continues running, but analysis data collection stops):
Click the associated
control on the
Workflow pane when running the desired analysis.
Use the CLI action -command=pause when you run the desired analysis. For example:
advixe-cl -command=pause -result-dir ./myAdvisorResult
Do one of the following to resume analysis data collection:
Click the associated
control on the
Workflow pane.
Use the CLI action -command=resume. For example:
advixe-cl -command=resume -result-dir ./myAdvisorResult
Minimize collection overhead.
Applicable analyses: Survey, Trip Counts and FLOP 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:
The process is a service that runs forever.
The launching infrastructure is relatively complicated, such as a sequence of scripts that must be modified to embed a launch collection command.
GUI:
Choose Project Properties > Analysis Target > [Name] Analysis> Launch Application drop-down > Attach to Process.
Disable the Inherit settings from Survey Hotspots Analysis Type checkbox.
Choose the Process name or PID option and identify a process.
Supply other information as desired and close the Project Properties dialog box.
Click the standard run control on the Workflow pane to run the desired analysis.
CLI: Use the CLI action option -target-pid=<unsigned integer> or -target-process=<string> to attach to a process when running the desired analysis. For example:
advixe-cl -collect survey -project-dir ./myAdvisorProj -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):
Click the associated
control on the
Workflow pane.
Use the CLI action -command=detach. For example:
advixe-cl -command=detach -result-dir ./myAdvisorResult
Ensure call stacks are disabled (which is the default setting) if you run the Trip Counts and FLOP analysis:
Disable the Project Properties > Analysis Target > Trip Counts and FLOP Analysis > Advanced > Collect stacks checkbox.
Add the CLI action option -no-stacks to the -collect command, or simply omit a -stacks action option on the -collect command.
Using the CLI action -command=stop kills the process (which also stops analysis data collection).