Tutorial: Where to Add Parallelism with Intel® Advisor 2015 and a C/C++ Sample

Discover Parallel Opportunities

To discover parallel opportunities in serial code:

Each step is described more fully below.

Collect Survey Data

To start a Survey analysis:

  1. If the Advisor Workflow is not currently displayed, click the Open Advisor Workflow button icon on the Intel Advisor toolbar to open it.

  2. Under 1. Survey Target in the Advisor Workflow, click the Collect Survey Data button icon to collect Survey data while the target executes.

During the Survey analysis, the Intel Advisor displays a window similar to the following.
Collect Survey Data window

Note

You can ignore any warnings about missing debugging symbols during this tutorial.

1

The navigation toolbar lets you navigate among various result tab windows. If you see >> and << scroll controls, click them to see more window options.

2

During collection, the main area of the Survey Report shows collection progress and milestones, and runtime performance characteristics. The Collection Log pane shows collection informational, warning, and error messages. Notice you can redirect non-GUI application output to the Application Output pane.

3

The command toolbar lets you control collection and analysis. For example: You can skip uninteresting code regions by temporarily stopping data collection while the target continues to run and then resuming data collection (Pause and Resume buttons); stop target execution, analysis, and data collection, finalize the partially collected data, and display the result (Stop button); cancel target execution, analysis, and data collection, discard the collected data, and skip finalization (Cancel button). You can also use the Command Line button to view and copy the equivalent advixe-cl command and options to run this Survey analysis.

Note

This tutorial explains only how to use Intel Advisor tools from the Intel Advisor GUI.

View Survey Report

After the Survey tool finalizes the data, the Intel Advisor displays the Survey Report and an infotip in the top left corner. Close the infotip to display a window similar to the following.
Survey Report window

1

The Function Call Sites and Loops column shows an extended top-down call tree of our target, starting with the main entry point. Each function or loop appears on a separate row. A loop is indicated by a Loop icon icon under the function/procedure that executes it. You can scroll up and down as well as show or hide functions and loops.

The Total Time % column starts in the top line with a value of 100%. The Total Time column shows the time spent in a function or loop and all functions called from it. A row with a large Total Time % and multiple children with smaller total times is a possible candidate for parallelism.

The Self Time column shows how much time was spent in the function or loop. Loops or functions with significant self time values are possible candidates for distributing work.

The Source Location column shows the source file and line number associated with the location in the call tree.

The Hot Loops column and Hot Loop icon icons identify time-consuming loops from a Total Time perspective. These hotspots are often good candidates for parallelism.

2

Our target spends the most time in the setQueen() function, which is called from the solve() function, so it is not surprising to find the top time-consuming hot loop there. Notice the setQueen() function calls itself recursively.

3

The Survey Report toolbar helps you quickly locate hot loops and view the Survey Source window for the currently selected row.

4

The Show/Hide control control shows/hides the command toolbar. Try clicking it now.

5

The Annotations Example (annotations assistant) area, which is closed in this screenshot, shows various annotation samples and build settings you can copy directly into your editor. We will discuss annotation examples later in this tutorial.

View Survey Source

To dig deeper into the first hot loop, double-click the associated row to display a Survey Source window similar to the following.
Survey Source window

1

The File pane initially shows the source code and time values for the first hot loop.

2

The Call Stacks and Loops pane shows the call stack for the first hot loop. Clicking a row in the Call Stack with Loops pane displays the associated code in the File pane. Try clicking a row in this pane now.

3

The Annotations Example (annotations assistant) area, which is open in this screenshot, shows an annotation code snippet for a simple loop structure. We will discuss annotation examples later in this tutorial.

Click the X beside Survey Source on the navigation toolbar to close the Survey Source window.

View Summary Window

Click Summary on the navigation toolbar to open a Summary window similar to the following. Think of this window as a dashboard to which the Intel Advisor adds data each time you run Intel Advisor tools.
Summary window

1

This area summarizes possible loops where you might add parallelism. It also provides easy access to the Survey Report window and your sources. Try clicking a Loop link now. Then return to the Summary window and try clicking a Source Location link.

2

You currently have collection data from only one of the three Intel Advisor analysis tools. That will change very soon.

Key Terms

annotation, hotspot, target

Next Step

Mark Best Parallel Opportunities With Annotations


Submit feedback on this help topic