Predict Parallel Data Sharing Problems

Intel Advisor offers Vectorization Advisor, a vectorization optimization tool, and Threading Advisor, a threading design and prototyping tool, to help ensure your Fortran, C and C++ native/managed applications realize full performance potential on modern processors, such as Intel® Xeon Phi™ processors. This topic is part of a tutorial that shows how to use the Threading Advisor on a Windows* platform to find where to add parallelism to a C++ sample application.

The Dependencies Analysis predicts parallel data sharing problems based on the inserted annotations. Use this information to fix the data sharing problems if the predicted maximum speed-up benefit justifies the effort.

To predict parallel data sharing problems in your target, do the following.

Run a Dependencies Analysis

  1. Return to the Survey Report.

  2. In the column in the Survey Report, select the checkbox for the loop in setqueen at nqueens_serial.cpp:88.

  3. In the Threading Workflow pane, click the Intel Advisor control: Run analysis control under Check Dependencies to produce a Dependencies-focused Refinement Report.

  4. Click the Read after write dependency data row in the Problems and Messages pane.

Get to Know the Dependencies-Focused Refinement Report


Intel Advisor Dependencies-Focused Refinement Report
There are many controls available to help you focus on the data most important to you, including the following:

1

To display more information in the Dependencies Report about a loop of interest: Click the associated data row.

2

To display instruction addresses and code snippets for associated code locations in the Code Locations pane: Click a data row.

To choose a problem of interest to display in the Dependencies Source window: Right click a data row, then choose View Source.

To open your default editor in another tab/window: Right-click a data row, then choose Edit Source to open an editor tab.

To dig deeper into a data sharing problem: Double-click a data row to display a Dependencies Source window where you can:

  • See more source code than just a short code snippet.

  • Navigate through the call stack.

3

To choose a code location of interest to display in the Dependencies Source window:

  • Click a data row.

  • Right-click a data row, then choose View Source.

To open your default editor in another tab/window: Right-click a data row, then choose Edit Source to open an editor tab.

4

Use the Filter pane to:

  • Temporarily limit the items displayed in the Problems and Messages pane by clicking filter criteria in one or more filter categories.

  • Deselect filter criteria in one filter category, or deselect filter criteria in all filter categories.

  • Sort all filter criteria by name in ascending alphabetical order or by count in descending numerical order. (You cannot change the order in which filter categories are presented.

Assess Dependencies

In the top pane of the Refinement Reports window, notice the Threading Advisor reports a RAW, a WAR, and a WAW dependency in the loop in solve at nqueens_serial.cpp:139.

The Code Locations pane shows the source of the Read after write dependency: A race condition because multiple tasks may try to increment nrOfSolutions at the same time.

For more complete information about compiler optimizations, see our Optimization Notice.