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

Choosing a Small, Representative Data Set for the Correctness Tool

$
0
0

When using the Correctness tool, Intel recommends that you use a Debug build. Visual Studio allows different build configurations to set unique values for the properties. By using #ifdef preprocessor directives in your source code and modifying your project's Debugging properties, you can set up your application to control how your program behaves, so that:

  • A Release build behaves like a full customer workload.
  • A Debug build behaves like a small testing workload.

When you run the Correctness tool, it executes the target against the supplied data set. If you supplied a full data set for the Correctness tool, this would require a runtime of 50 to several hundred times longer than the normal execution time of the target executable.

Data set size and workload have a direct impact on target execution time and analysis speed.

For example, it takes longer to process a 1000x1000 pixel image than a 100x100 pixel image. A possible reason: You may have loops with an iteration space of 1...1000 for the larger image, but only 1...100 for the smaller image. The exact same code paths may be executed in both cases. The difference is the number of times these code paths are repeated.

You can control analysis cost without sacrificing completeness by minimizing this kind of unnecessary repetition from your target's execution.

Instead of choosing large, repetitive data sets, choose small, representative data sets that fully create tasks with minimal to moderate work per task. Minimal to moderate means just enough work to demonstrate all the different behaviors a task can perform.

Your objective: In as short a runtime period as possible, execute as many paths and the maximum number of tasks (parallel activities) as you can afford, while minimizing the repetitive computation within each task to the bare minimum needed for good code coverage.

Data sets that run in about ten seconds or less are ideal. You can always create additional data sets to ensure all your code is checked.

To modify the input data set in Visual Studio, do one of the following:

  • In Visual Studio, specify Properties for the project or configuration. For example, right-click the startup project's name to display the context menu:
    1. Choose Properties> Configuration properties> Debugging.
    2. Select the type of configuration this change will apply to by selecting the type under Configuration, such as Active(Debug), Debug, Release, or All Configurations. By default, properties for Debug and Release configuration are maintained separately.
    3. Edit the Command Arguments to select the appropriate data set.
    4. Click OK.
  • Specifying a different startup project that already has a reduced data set.
  • Modifying the program's sources (perhaps using #ifdef directives) and rebuilding the target.
  • When using the Intel Advisor standalone GUI, specify the project properties for the target:
    1. Either click File > Project properties... or the icon on the Intel Advisor toolbar. This displays the Project Properties dialog box.

    2. If needed, click the Analysis Target tab.

    3. In the Target type drop-down list, choose Correctness Analysis.

    4. In the Application parameters, if your target's main entry point accepts command-line arguments, specify a value in this field. Either type a value, or click the Modify... button.

    5. Check other fields in this dialog box - see Specifying Project Properties Using the Intel Advisor GUI.

    6. When done, click OK.

  • When using Visual Studio, consider specifying a different startup project that already has a reduced data set.

  • Modifying the program's sources (perhaps using #ifdef directives) and rebuilding the target.

Tip

If you run this configuration often, consider creating a new configuration perhaps called Correctness for this small data set.

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>