Quantcast
Channel: C#
Viewing all articles
Browse latest Browse all 1853

4. Check Correctness

$
0
0

Predict data sharing problems for the annotated tasks. Fix the reported sharing problems.

The Correctness tool runs your annotated serial application program's executable and watches its memory access operations in great detail to predict possible parallel data sharing problems.

Instead of debugging a data sharing problem in a non-deterministic parallel program, you can use the Correctness tool to predict likely data sharing and related problems that may occur when you add parallelism to your serial program. This tool allows you to identify and fix the predicted data sharing problems - before you add parallelism.

If you have not used Intel Advisor previously, considering reading the Intel Advisor Tutorials while using the C/C++ or Fortran nqueens samples. If you are not familiar with parallel concepts like data race, please read the help topics in Key Concepts.

Using the Correctness Report

The Correctness tool performs extensive analysis of your running serial program's executable (target) to predict the likely data sharing and related problems, such as data races.

Specify a minimal data set or corresponding run-time parameters and build a Debug build target executable (no optimization and full debug information). Specify this target and run the Correctness tool. The Correctness tool takes significantly longer to analyze your program because it must observe all memory accesses within the parallel sites. If you provide a minimal input data set for the Correctness tool's target, you may be able to reduce the program's run-time (as described in Minimizing Data Collection, Result Size, and Execution Time (Correctness)). Once data collection completes, the data collected during analysis appears in the Correctness Report window in the Result tab. If the Correctness tool did not detect any Problems, a No Problems Detected message appears instead.

To view details about a specific problem or code location, double-click its data row or source line (or right click a row and select View Source from the context menu) to display the Correctness Source window. To return to the Correctness Report window, click the Correctness Report button.

To display and edit sources in a code editor, right-click a line and select Edit Source from the context menu. When using Visual Studio, the Visual Studio code editor appears with the file open at the corresponding location. When using the Intel Advisor GUI, the file type association determines the editor used. Later, to return to the Correctness Report or Correctness Source window, click the Result tab.

For help using the Correctness Report and Correctness Source windows, see Viewing Data from the Correctness Tool.

Next Steps

After you examine the data in the Correctness Report and Correctness Source windows, choose one of the following:

  • If the Correctness Report shows problems, you need to investigate them. Fix the problems by either restructuring your program's use of the shared data or by adding lock annotations. There are different types of problems, which are listed in About Message and Problem Types. A separate topic explains fixing sharing problems - see Check Correctness and Fix Problems.
  • If the Correctness Report does not identify any problems, view the high-level summary of annotations in the Annotation Report window to help you decide whether to modify or keep the annotations. In most cases, you should fix the sharing problems before you proceed to the add parallelism step.

Note

If you modify the sources to fix problems by restructuring code or by adding annotations, you need to rebuild the program and run the Correctness tool again. Once you fix all the problems, run the Suitability tool again.

Inglese

Viewing all articles
Browse latest Browse all 1853

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>