Intel® Advisor GUI: Build Application and Open the Project

To create an application the Intel® Advisor tools can use to predict parallel performance and possible parallel data sharing problems, you need to:

Get Software Tools and Unpack the Sample

If you completed this step in the previous part of this tutorial, skip to Verify optimal compiler/linker options.

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

  • Intel Advisor, including sample applications
  • .tgz file extraction utility
  • Supported compiler (see Release Notes for more information). Intel Advisor samples require the Intel® Fortran (ifort) compiler included in Intel® Composer XE.
  • Source code editor

Acquire Intel Advisor XE

If you do not already have access to the Intel Advisor XE, 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.tgz file from the samples/<locale>/Fortran/ directory to a writable directory or share on your system. The default installation path is /opt/intel/advisor_xe_2013/).

  2. Extract the sample from the .tgz file.

  3. Ensure you have set the VISUAL or EDITOR environment variable to your editor.

Verify Optimal Compiler/Linker Options

You can use the Intel Advisor Suitability and Correctness tools to predict parallel performance and possible parallel data sharing problems.

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

Compiler/Linker Settings

Release Build for Suitability

Debug Build for Correctness

Compiler: Debug information

-g

-g

Compiler: Optimization

-O2 and -fno-inline-functions

-O0

Compiler: Code Generation

-threads -shared-intel

Compiler: search an additional include directory

-I${ADVISOR_XE_2013_DIR}/include

-I${ADVISOR_XE_2013_DIR}/include

Linker Options

-g and -ldl

-g and -ldl

The linker should search for unresolved references in a multithreaded, shared object run-time library. If needed, specify -threads or -Bdynamic.

Build the Target Executable

  1. In a terminal session, locate the Intel Advisor installation directory root on your system. The default installation location is /opt/intel/advisor_xe_2013.

  2. Type source /opt/intel/advisor_xe_2013/advixe-vars.sh (or equivalent path) to set up your bash shell environment. With a different shell, source the advixe-vars.csh script.

  3. If you need to set up your compiler environment, do so now.

  4. Verify that the ADVISOR_XE_2013_DIR environment variable is set - for example, type: env | grep ADVISOR_XE_2013_DIR. If it is not set, define it by using an export command: export ADVISOR_XE_2013_DIR=/opt/intel/advisor_xe_2013.
  5. Change directory to the nqueens/ directory .
  6. Type:
    • make 2_nqueens_annotated to build a release version of the annotated nqueens sample application for Suitability (or Survey) tool analysis. If you get compiler errors, make sure the ADVISOR_XE_2013_DIR environment variable is defined (use an export command).
    • make 2_nqueens_annotated_debug to build a debug version of the annotated nqueens sample application for Correctness tool analysis. If you get compiler errors, make sure the ADVISOR_XE_2013_DIR environment variable is defined.

Verify the Target Executable Runs Outside the Intel Advisor XE

  1. In the same terminal session, change directory (cd) to the nqueens directory that you created when you extracted the nqueens_Fortran.tgz file.

  2. Type ./2_nqueens_annotated to execute the sample application.

  3. Check for output similar to the following:

     Usage: 2_nqueens_annotated[_debug] boardSize
     Using default size of 14
    Starting serial recursive solver for size 14
    Number of solutions: 365596
    Calculations took 7159ms.
    Correct Result!
    

    Type ./2_nqueens_annotated_debug to run the debug build version, which takes longer to execute than a release build.

Tip

Keep the command prompt window open.

Open the Intel Advisor GUI

  1. If you have not already done so, type source /opt/intel/advisor_xe_2013/advixe-vars.sh (or equivalent path) to set up your command-line environment.

  2. Type advixe-gui to open the Intel Advisor GUI.

    The previously opened project should be re-opened and its name should appear in the title bar and in the Project Navigator:
    Intel Advisor GUI after opening a project

If the project was closed, either click the nqueens_fortran link below Recent Projects: in the Welcome page, or choose File > Recent Projects... and select the recently created project name.

Note

If you did not complete the first part of this tutorial, you need to create a project, not open one. Select File > New > Project... and specify the project name as nqueens_fortran. Use Project Properties... (next step) to specify the target executable and other properties.

Modify Project Properties

  1. Verify that the project is open by viewing its name in the title bar.

  2. Click File > Project Properties... or click the toolbar icon to display a dialog box similar to the following (shown with Suitability release build values):
    Project Properties dialog box

  3. For the selected Target type of Survey/Suitability, click the Browse... button next to the Application field and select the .../nqueens/2_nqueens_annotated executable file.

  4. For the selected Target type of Correctness:

    • Click the Browse... button next to the Application field and select the nqueens/2_nqueens_annotated_debug file.

    • To the right of Application parameters, type a value of 8. This reduces the board size to minimize execution time.

  5. Click the Binary/Symbol Search tab. In this tab:

    • Click the line labeled Add new search location.
    • Click the button on the right of that line.
    • Navigate to and select the nqueens directory.
    • Click Open to add the line.
    • With your own application, repeat the above steps if you need to include other directories. You can move the current line up, down, and delete lines using the buttons on the lower-right.

  6. Click the Source Search tab. In this tab:

    • Locate the line labeled Add new search location.
    • Click the button on the right of that line.
    • Navigate to and select the nqueens directory.
    • Click Open to add the line.
    • With your own application, repeat the above steps if you need to include other local directories. You can also use wildcard characters (*.f90) or specific file names to be included or excluded. You can move the current line up, down, and delete lines using the buttons on the lower-right.

  7. When all directories are complete, click OK.

Key Terms

target

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