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 sample application:

  • Intel Advisor, including sample applications

  • .zip file extraction utility

  • Supported compiler (see Release Notes for more information). Intel Advisor samples require the Intel® Visual Fortran compiler included in Intel® Composer XE.

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

  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.sln file to display the nqueens solution in the Solution Explorer:
    Microsoft* Visual Studio, after opening nqueens 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.f90 by double-clicking its name.
  7. Verify that the following statement appears near the start of the nqueens_annotated.f90 file: use advisor_annotate.

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_annotated 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 > Fortran and:

    • General > Additional Include Directories as either: $(ADVISOR_XE_2013_DIR)\include\ia32 or $(ADVISOR_XE_2013_DIR)\include\intel64

    • General > Debug Information Format > Full (/debug=full)

    • Optimization > Inline Function Expansion > Only INLINE Directive (/Ob1)

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

    • Input > Additional Dependencies > libadvisor.lib

    • General > Additional Library Directories as either: $(ADVISOR_XE_2013_DIR)\lib32 or $(ADVISOR_XE_2013_DIR)\lib64

    • Debugging > Generate Debug Info > Yes (/DEBUG)

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

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_annotated.

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

  4. Choose Debug > Start Without Debugging.

  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: 7359 milliseconds (the time on your system will be different).

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

Verify the Application is Set to Build in Debug Mode and Build 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_annotated 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_annotated 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 > Fortran and specify:

    • General > Additional Include Directories as either: $(ADVISOR_XE_2013_DIR)\include\ia32 or $(ADVISOR_XE_2013_DIR)\include\intel64

    • General > Debug Information Format > Full (/debug=full)

    • Optimization > None

    • Code Generation > Runtime Library > either Multi-threaded Debug DLL (/MDd) or Multi-threaded DLL (/MD)

  5. In the left pane, choose Configuration Properties > Linker and specify:

    • Input > Additional Dependencies > libadvisor.lib

    • General > Additional Library Directories as either: $(ADVISOR_XE_2013_DIR)\lib32 or $(ADVISOR_XE_2013_DIR)\lib64

    • Debugging > Generate Debug Info > Yes (/DEBUG)

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

Key Terms

target, annotations

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