Visual Studio* IDE: Choose Project and Build Application

To create an application the Intel Advisor tools can analyze to predict its parallel behavior, you need to:

Get Software Tools and Unpack the Sample

If you completed this step in the previous part of this tutorial, skip to Open a Visual Studio solution that contains Intel Advisor annotations.

You need the following tools to try tutorial steps yourself using the nqueens_Advisor sample application:

  • Intel Advisor, including sample applications

  • .zip file extraction utility

  • Supported compiler (see Release Notes for more information)

Acquire Intel Advisor

If you do not already have access to the Intel Advisor, you can download an evaluation copy from http://software.intel.com/en-us/articles/intel-software-evaluation-center/.

Install and Set Up Intel Advisor Sample Applications

  1. Copy the nqueens_Advisor.zip file from the <install-dir>\samples\<locale>\C++\ directory to a writable directory or share on your system. The default installation path is C:\Program Files\Intel\Advisor XE 2013\ (on certain systems, instead of Program Files, the directory name is Program Files (x86)).

  2. Extract the sample from the .zip file.

Open a Visual Studio* Solution

  1. Launch Visual Studio.

  2. Choose File > Open > Project/Solution.

  3. In the Open Project dialog box, open the nqueens_Advisor.sln file to display the nqueens_Advisor solution in the Solution Explorer:
    Microsoft* Visual Studio, after opening nqueens_Advisor sample solution

Choose a Startup Project

  1. Right-click the 2_nqueens_annotated project.

  2. Choose Set as StartUp Project.

Verify that the Application Includes Annotations Definitions

  1. Right-click the 2_nqueens_annotated project in the Solution Explorer.

  2. Choose Properties to display the Property Pages dialog box.

  3. In the left pane, choose Configuration Properties > C/C++ > General.

  4. Verify the Additional Include Directories is set to $(ADVISOR_XE_2013_DIR)\include.

  5. Click OK to close the Property Pages dialog box.

  6. In the Solution Explorer, under the 2_nqueens_annotated project and Source Files, open nqueens_annotated.cpp by double-clicking its name.
  7. Verify that the following statement appears near the start of the nqueens_annotated.cpp file: #include "advisor-annotate.h".

Verify the Application is Set to Build in Release Mode for the Suitability Tool

  1. Display the Configuration Manager dialog box. For example, click Build > Configuration Manager....

  2. Verify the Active solution configuration drop-down list is set to Release.

  3. Click the Close button to close the Configuration Manager dialog box.

Verify Optimal Compiler/Linker Options for the Suitability Tool

To predict the parallel performance of your annotated application, use the Suitability tool.

Applications compiled/linked in release mode using the following options produce the most accurate, complete results.

  1. Right-click the 2_nqueens_Advisor project in the Solution Explorer.

  2. Choose Properties to display the Property Pages dialog box.

  3. Verify the Configuration drop-down list is set to Release or Active(Release).

  4. In the left pane, choose Configuration Properties > C/C++ and:

    • Select General and verify the Debug Information Format is set to Program Database (/Zi) or Program Database for Edit & Continue (/ZI).

    • Select Optimization and verify the Optimization field is set to Maximize Speed (/O2)

    • Select Optimization and verify the Inline Function Expansion field is set to Only __inline (/Ob1). .

    • Select Code Generation and verify the Runtime Library field is set to Multi-threaded DLL (/MD) or Multi-threaded Debug DLL (/MDd).

  5. In the left pane, choose Configuration Properties > Linker > Debugging.

  6. Verify the Generate Debug Info field is set to Yes (/DEBUG).

  7. Click the OK button to close the Property Pages dialog box.

When using a C# or Fortran application, the build options are different (see the Intel Advisor help).

Build and Test the Application's Target Executable

  1. Verify that a Release build is selected (for example, select Build > Configuration Manager...).

  2. Choose Build > Build 2_nqueens_Advisor.

  3. Choose Debug > Start Without Debugging.

  4. If the Visual Studio* IDE responds that a project is out of date, click Yes to build.

  5. Check for a display similar to the following:


    Application output

    Notice this application output window displays:

    • The board size: 14.
    • The total time it took to run the application, such as: 6172 milliseconds.

    Press Enter (or any key) to dismiss the application output window.

Verify the Application is Set to Build in Debug Mode for the Correctness Tool

  1. Display the Configuration Manager dialog box. For example, click Build > Configuration Manager....

  2. Verify the Active solution configuration drop-down list is set to Debug.

  3. Click Close to close the Configuration Manager dialog box.

  4. From the Project menu, select Properties.

  5. Choose Configuration Properties > Debugging.

  6. Set the Command Arguments to 8. This reduces the size of the chess board to minimize the execution time:



  7. You can view other project properties at this time.

  8. Click the OK button to close the Property Pages dialog box.

  9. Choose Build > Build 2_nqueens_Advisor to build the debug version.

Verify Optimal Compiler/Linker Options for the Correctness Tool

To predict the parallel data sharing problems of your annotated application, use the Correctness tool:

Applications compiled/linked in debug mode using the following options produce the most accurate, complete results.

  1. Right-click the 2_nqueens_Advisor project in the Solution Explorer.

  2. Choose Properties to display the Property Pages dialog box.

  3. Verify the Configuration drop-down list is set to Debug or Active(Debug).

  4. In the left pane, choose Configuration Properties > C/C++ and:

    • Select General and verify the Debug Information Format is set to Program Database (/Zi) or Program Database for Edit & Continue (/ZI).

    • Select Optimization and verify the Optimization field is set to Disabled (/Od).

    • Select Code Generation and verify the Runtime Library field is set to Multi-threaded DLL (/MD) or Multi-threaded Debug DLL (/MDd).

  5. In the left pane, choose Configuration Properties > Linker > Debugging.

  6. Verify the Generate Debug Info field is set to Yes (/DEBUG).

  7. Click the OK button to close the Property Pages dialog box.

When using a C# or Fortran application, the build options are different (see the Intel Advisor help).

Key Terms

target, annotations

Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione