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

Fix Data Sharing Problems

Is the predicted maximum speedup benefit worth the effort to fix the data sharing problems? In this case, yes. But you may have a different answer when you use the Intel Advisor to find where to add parallelism in your own applications.

Each step is described more fully below.

Fix Memory Reuse and Data Communication Sharing Problems

  1. Click Correctness Report in the navigation toolbar to re-open the Correctness Report.

  2. In the Problems and Messages pane, right-click the Data communication data row and choose Edit Source to open the nqueens_serial.cpp source file in an editor.

  3. Search for ADVISOR CORRECTNESS EDIT and follow the directions in the sample code to fix the problems. Make six total edits: Uncomment two lock annotation lines, comment out the array declaration outside the loop, uncomment the array declaration within the loop, and similarly uncomment and comment out the delete [] queens; lines.

  4. Save your edits.

Rebuild Target in Debug Mode

In the terminal session:

  1. Change directory to the nqueens_Advisor/ directory (where the zipped sample files were extracted to).

  2. Type make 1_nqueens_serial_debug to rebuild the target in debug mode.

Rerun Correctness Tool

Under 4. Check Correctness in the Advisor Workflow, click the Collect Correctness Data button button to collect Correctness data again.

Notice the Correctness Report now reports No problems detected.

View Summary Window

Click Summary in the navigation toolbar to re-open the Summary window. Notice this dashboard now shows no Correctness problems.

Key Terms

data race, synchronization, target

Next Step

Add Parallelism


Submit feedback on this help topic