Loop Markup to Minimize Analysis Overhead
Issue
Running your target application with the
can take substantially longer than running your target application without the
.
Intel® Advisor
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
loops and analyze only
interesting
loops.
Select Loops by ID
Minimize collection overhead.
Applicable analyses:
Characterization with Trip Counts and FLOP collection enabled
, Dependencies, Memory Access Patterns.
Use when...
- You want to perform a deeper analysis on only a few loops.
- CLI environment: You cannot identify source file/line numbers, such as when you are analyzing a target application for which you do not have access to source code.
Prerequisites:
- Run a Survey analysis.
- advisorCLI environment: Identify the loop IDs for the loops of interest.advisor --report=survey --project-dir=./myAdvisorProj -- ./bin/myTargetApplication
Intel® Advisor
- Set your console width appropriately to avoid line wrapping.
- Pipe your report using the appropriate truncation command if you care only about the first few report columns.
After performing the prerequisites, do one of the following:
- Mark the loop(s) of interest by enabling the associated
checkbox on the
Survey Report.Then run aCharacterization with Trip Counts and FLOP collection enabled, Dependencies, or Memory Access Patterns analysis. - Mark the loop(s) of interest using the CLI action option-mark-up-list=<string>when running aCharacterization with Trip Counts and FLOP collection enabled, Dependencies, or Memory Access Patterns analysis. For example:advisor --collect=tripcounts --flop --project-dir=./myAdvisorProj --mark-up-list=5,10,12 -- ./bin/myTargetApplication
There is essentially no difference between selecting loops by ID and selecting loops by source file/line in the GUI environment. The difference is in the CLI environment:
- TheadvisorCLI action option--mark-up-list=<string>merely simulates enabling a GUI
checkbox; therefore it persists only for the duration of the
--collectcommand. - TheadvisorCLI action--mark-up-loopsand action option-select=<string>actually enables a GUI
checkbox; therefore it persists beyond the duration of the
-mark-up-loopscommand and applies to downstream analyses, such asCharacterization with Trip Counts and FLOP collection enabled, Dependencies, Memory Access Patterns.
Select Loops by Source File/Line Number
Minimize collection overhead.
Applicable analyses:
Characterization with Trip Counts and FLOP collection enabled
, Dependencies, Memory Access Patterns.
Use when...
- You want to perform a deeper analysis on only a few loops.
- CLI environment: You are analyzing a target application for which you have access to source code and can identify source file/line numbers.
Prerequisites:
- Run a Survey analysis.
- advisorCLI environment: If necessary, identify the source file and line number for the loops of interest.advisor --report=survey --project-dir=./myAdvisorProj -- ./bin/myTargetApplication
After performing the prerequisites, do one of the following:
- Mark the loop(s) of interest by enabling the associated
checkbox on the
Survey Report.Then run aCharacterization with Trip Counts and FLOP collection enabled, Dependencies, or Memory Access Patterns analysis. - Mark the loop(s) of interest using theadvisorCLI action--mark-up-loopsand action option--select=<string>. For example:advisor --mark-up-loops --select=foo.cpp:34,bar.cpp:192 --project-dir=./myAdvisorProj -- ./bin/myTargetApplicationThen run aCharacterization with Trip Counts and FLOP collection enabled, Dependencies, or Memory Access Patterns analysis.
- You can also append and remove source file/line numbers using theadvisorCLI action option--append=<string>and--remove=<string>respectively.
- There is essentially no difference between selecting loops by ID and selecting loops by source file/line in the GUI environment. The difference is in theadvisorCLI environment:
- TheadvisorCLI action option--mark-up-list=<string>merely simulates enabling a GUI
checkbox; therefore it persists only for the duration of the
--collectcommand. - TheadvisorCLI action--mark-up-loopsand action option--select=<string>actually enables a GUI
checkbox; therefore it persists beyond the duration of the
--mark-up-loopscommand and applies to downstream analyses, such asCharacterization with Trip Counts and FLOP collection enabled, Dependencies, and Memory Access Patterns.
Select Loops by Criteria
Minimize collection overhead.
Applicable analyses: Dependencies, Memory Access Patterns.
Use when you want to perform a deeper analysis on loops chosen by criteria instead of by human input, such as when you are running the
in batch mode or using automated scripts.
Intel® Advisor
To implement in the
advisor
CLI environment, create a script similar to the following examples, which produce the same outcome. Use the
--loops
option to select loops by criteria:
- Example 1:advisor --collect=survey --project-dir=./myAdvisorProj -- ./bin/myTargetApplication advisor --mark-up-loops --loops="scalar,has-issue" --project-dir=./myAdvisorProj -- ./bin/myTargetApplication advisor --collect=dependencies --project-dir=./myAdvisorProj -- ./bin/myTargetApplicaton
- Example 2:advisor --collect=survey --project-dir=./myAdvisorProj -- ./bin/myTargetApplication advisor --collect=dependencies --loops="scalar,has-issue" --project-dir=./myAdvisorProj -- ./bin/myTargetApplicaton