Changes

Jump to: navigation, search

DPS921/Intel Parallel Studio Inspector

2 bytes added, 19:44, 30 November 2020
no edit summary
[[File:FalsePositiveEdited.png|800px]]
 
 
 
= How to use Intel Parallel Studio Inspector =
 
There are two ways to use the Intel Parallel Studio Inspector
 
== Run Inspector directly from Visual Studio ==
 
This is the '''easiest and fastest''' way that requires no additional configuration.
 
Once you downloaded intel Inspector application, you need to restart your Visual Studio for the feature to work.
 
Inside Visual Studio, there are two ways of accessing the inspector debugger.
 
The first way is to go to the tools drop down menu and locate “Intel Inspector”, then you should be able to click on what you want to debug.
 
[[File:VSInspector.png|800px]]
 
Second way is to locate the inspector icon, few directions right on tools. There will be a drop down menu that should lets you choice what choice of debugging you want to do or start a new analysis.
 
[[File:VSInspector2.png|800px]]
 
== Run the application via Inspector ==
 
Before we start, I want to be able to show you how the Inspector UI looks like as a whole.
 
[[File:InspectorUI2.png|900px]]
 
Working with intel inspector application requires passing it a compiled version of your program. Additionally, you may need to link some libraries (lib, dll, and etc.)
 
[[File:InspectorApp.png|500px]]
 
=== Configure a Project ===
 
Intel suggests using small data set sizes and load threads with small chunks of work.
 
This will reduce the run time and the speed of the analysis.
 
On the left side, right click on the project so that you get a drop-down menu and click “new analysis” to configure a project the way you want it.
 
[[File:analysis.png|500px]]
 
=== Choose Analysis Type ===
 
Inspector allows you to choose between predefined types of analysis.
 
[[File:ConfAnalysis.png|800px]]
 
Choose the type of analysis using a drop down menu
 
[[File:AnalysisType.png|200px]]
 
'''Memory Error Analysis:'''
 
• Detect Leaks
 
• Detect Memory Problems
 
• Locate Memory Problems
 
'''Threading Error Analysis:'''
 
• Detect Deadlocks
 
• Detect Deadlocks and Data Races
 
• Locate Deadlocks and Data Races
 
'''Custom Analysis types:''' users can create their own types based on selected preset type.
 
[[File:MemoryLevs.png|500px]]
 
In this screenshot, it show cases the different levels for memory error analysis.
 
Types at the top have smaller scope but faster in execution.
 
Types at the bottom have larger scope but they are considerably slower.
 
 
=== How it works ===
 
Inspector performs the analysis in multiple steps:
 
1. The program is executed
 
2. It identifies problems that may need to be resolved
 
3. Gathers problems
 
4. Converts symbol information into filenames and line numbers
 
5. Applies suppresion rules
 
6. Remove duplicates
 
7. Create problem sets
 
8. Opens a debugging session
 
 
=== Making it work ===
 
First you need an executable file. You get that building your solution on Visual Studio. Once you have your executable file, you import that to Intel Inspector by using “Project Properties” when you right click on the project located on the left side.
 
[[File:ProjectProperties.png|500px]]
 
Once you are in the Project Properties section, you need to locate the executable file.
 
[[File:ProjectProperties2.png|700px]]
 
Application section is the executable file. Application section is the command argument, if the application has a command argument.
 
 
=== Interpreting Results ===
 
After the analysis completes, IPS XE Inspector will show you information on 2 pages:
 
'''Collection Log'''
 
Gives a general information about the execution of the program.
From there you can see execution time, number of threads, the caller of threads, if they were active or not.
 
[[File:CollectionLogRes.png|700px]]
 
'''Summary'''
 
The summary window is divided into 4 parts:
 
'''1. Problems section'''
 
It shows problems (if any found) that we asked the inspector to look for.
It provides you with a name of the problem, the file where the problem is located, the executable module which contains it, and the state of problem (which changes when do you a rescan).
 
[[File:SummaryResults.png|800px]]
 
'''2. Filters''' (On the right side of the problems section)
 
Gives the summary of all problems (Sources file affect, total of problems by types, etc)
 
[[File:FiltersResults.png|800px]]
 
'''3. Code Locations'''
 
When we select a problem, code locations will show a preview of a source file and highlights and line on which the problems was detected.
 
[[File:CodeLocationResults.png|800px]]
 
Moreover, it shows the operation that is performed (Read, Write), including thread operations.
Source files can be opened and edited directly from the Inspector by double clicking the problem
 
'''4. Timeline'''
 
Shows threads that involved at the certain step.
There is a thread and timeline information for all code locations in one or all occurrences of the problem(s) highlighted in the Problems pane
 
[[File:TimelineResults.png|800px]]
= Code for Intel Inspector =
[[File:OMPFixed.jpg]]
 
= How to use Intel Parallel Studio Inspector =
 
There are two ways to use the Intel Parallel Studio Inspector
 
== Run Inspector directly from Visual Studio ==
 
This is the '''easiest and fastest''' way that requires no additional configuration.
 
Once you downloaded intel Inspector application, you need to restart your Visual Studio for the feature to work.
 
Inside Visual Studio, there are two ways of accessing the inspector debugger.
 
The first way is to go to the tools drop down menu and locate “Intel Inspector”, then you should be able to click on what you want to debug.
 
[[File:VSInspector.png|800px]]
 
Second way is to locate the inspector icon, few directions right on tools. There will be a drop down menu that should lets you choice what choice of debugging you want to do or start a new analysis.
 
[[File:VSInspector2.png|800px]]
 
== Run the application via Inspector ==
 
Before we start, I want to be able to show you how the Inspector UI looks like as a whole.
 
[[File:InspectorUI2.png|900px]]
 
Working with intel inspector application requires passing it a compiled version of your program. Additionally, you may need to link some libraries (lib, dll, and etc.)
 
[[File:InspectorApp.png|500px]]
 
=== Configure a Project ===
 
Intel suggests using small data set sizes and load threads with small chunks of work.
 
This will reduce the run time and the speed of the analysis.
 
On the left side, right click on the project so that you get a drop-down menu and click “new analysis” to configure a project the way you want it.
 
[[File:analysis.png|500px]]
 
=== Choose Analysis Type ===
 
Inspector allows you to choose between predefined types of analysis.
 
[[File:ConfAnalysis.png|800px]]
 
Choose the type of analysis using a drop down menu
 
[[File:AnalysisType.png|200px]]
 
'''Memory Error Analysis:'''
 
• Detect Leaks
 
• Detect Memory Problems
 
• Locate Memory Problems
 
'''Threading Error Analysis:'''
 
• Detect Deadlocks
 
• Detect Deadlocks and Data Races
 
• Locate Deadlocks and Data Races
 
'''Custom Analysis types:''' users can create their own types based on selected preset type.
 
[[File:MemoryLevs.png|500px]]
 
In this screenshot, it show cases the different levels for memory error analysis.
 
Types at the top have smaller scope but faster in execution.
 
Types at the bottom have larger scope but they are considerably slower.
 
 
=== How it works ===
 
Inspector performs the analysis in multiple steps:
 
1. The program is executed
 
2. It identifies problems that may need to be resolved
 
3. Gathers problems
 
4. Converts symbol information into filenames and line numbers
 
5. Applies suppresion rules
 
6. Remove duplicates
 
7. Create problem sets
 
8. Opens a debugging session
 
 
=== Making it work ===
 
First you need an executable file. You get that building your solution on Visual Studio. Once you have your executable file, you import that to Intel Inspector by using “Project Properties” when you right click on the project located on the left side.
 
[[File:ProjectProperties.png|500px]]
 
Once you are in the Project Properties section, you need to locate the executable file.
 
[[File:ProjectProperties2.png|700px]]
 
Application section is the executable file. Application section is the command argument, if the application has a command argument.
 
 
=== Interpreting Results ===
 
After the analysis completes, IPS XE Inspector will show you information on 2 pages:
 
'''Collection Log'''
 
Gives a general information about the execution of the program.
From there you can see execution time, number of threads, the caller of threads, if they were active or not.
 
[[File:CollectionLogRes.png|700px]]
 
'''Summary'''
 
The summary window is divided into 4 parts:
 
'''1. Problems section'''
 
It shows problems (if any found) that we asked the inspector to look for.
It provides you with a name of the problem, the file where the problem is located, the executable module which contains it, and the state of problem (which changes when do you a rescan).
 
[[File:SummaryResults.png|800px]]
 
'''2. Filters''' (On the right side of the problems section)
 
Gives the summary of all problems (Sources file affect, total of problems by types, etc)
 
[[File:FiltersResults.png|800px]]
 
'''3. Code Locations'''
 
When we select a problem, code locations will show a preview of a source file and highlights and line on which the problems was detected.
 
[[File:CodeLocationResults.png|800px]]
 
Moreover, it shows the operation that is performed (Read, Write), including thread operations.
Source files can be opened and edited directly from the Inspector by double clicking the problem
 
'''4. Timeline'''
 
Shows threads that involved at the certain step.
There is a thread and timeline information for all code locations in one or all occurrences of the problem(s) highlighted in the Problems pane
 
[[File:TimelineResults.png|800px]]
= Reference =
150
edits

Navigation menu