Sample Program Characteristics

The following table summarizes each sample. The Survey and Suitability tools running with the default data sets on a dual-core 2.0 GHz system with 2GB RAM take 10-60 seconds for different samples. For the Correctness tool, use a reduced data set (see below) to minimize sample target run times.

Sample Name

Characteristics

Where It is Described

mpi_sample (C++, Linux OS only)

Contains MPI code and assumes the mpiicpc compiler is in the PATH

Demonstrates: Adding parallelism to an MPI application

README

Also see the help topic About Analyzing MPI Workloads

mmult_Advisor (C/C++ version)

Performs matrix multiplication within the matrix_multiply function.

Demonstrates: Simple loop parallelism doing matrix multiplication. One parallel site.

Data conflicts: None.

Correctness tool: The variable num controls both dimensions of each allocated array. The default value of num is 1024, but specify a value of 128 using a command line argument when Correctness runs the sample's target. For example, in Visual Studio Solution Explorer for a Debug configuration build, the command line argument value of 128 is set in: Project > Properties > Configuration Properties > Debugging > Command Arguments. The default data set for a Release configuration build uses the value 1024 set by variable num (no command line argument is used).

mmult_Advisor.pdf in mmult_Advisor.zip in

mmult_Fortran (Fortran version)

Performs matrix multiplication within the matrix_multiply subroutine.

Demonstrates: Simple loop parallelism doing matrix multiplication. One parallel site.

Data conflicts: None.

Correctness tool: The variable size controls the dimensions of each allocatable array. The default value of size is 1024, but you should specify a reduced value of 128 using a command line argument when Correctness runs the sample's target. For example, in Visual Studio Solution Explorer for a Debug configuration build, specify a command line argument value of 128 in: Project > Properties > Configuration Properties > Debugging > Command Arguments. The data set for a Release configuration build uses the default value 1024 set by variable num (no command line argument is used).

mmult_Fortran.pdf in mmult_Fortran.zip

nqueens_Advisor (C/C++ version)

Solves placing N non-conflicting queens on a chessboard.

Demonstrates: Simple loop parallelism. One parallel site.

Data conflicts: A single, named global variable and an array allocated before the task boundary.

Correctness tool: Use the reduced data set of 8 queens for a Debug configuration build. To adjust the data set, change the debugging command-line argument for the board size: Project > Properties > Configuration Properties > Debugging > Command Arguments. The default data set for a Release configuration build is 14, and the default data set for a Debug configuration build is 14 but can be set to 8.

Intel Advisor Tutorial for C/C++

nqueens_Advisor.pdf in nqueens_Advisor.zip

nqueens (Fortran version)

Solves placing N non-conflicting queens on a chessboard.

Demonstrates: Simple loop parallelism. One parallel site.

Data conflicts: A single, named global variable and an array allocated before the task boundary.

Correctness tool: Use a reduced data set of 8 queens as a command-line argument.

Intel Advisor Tutorial for Fortran

nqueens.pdf in nqueens.zip

nqueens (C# version, Windows OS only)

Solves placing N non-conflicting queens on a chessboard.

Demonstrates: Simple loop parallelism. One parallel site.

Data conflicts: A single, named global variable and an array allocated before the task boundary.

Correctness tool: Use the default data set.

nqueens.pdf in nqueens.zip

primes (C/C++, Windows* OS only)

Counts number of prime numbers.

Demonstrates: Simple loop parallelism. One parallel site.

Data conflicts: A single, named global variable solved by synchronization.

Correctness tool: Use the default data set. To adjust the data set, open the source file primes.cpp and reduce the value of limit:

const int limit  = 3000000;

primes.pdf in primes.zip

stats (C++)

Performs basic statistical calculations on arrays of data. It uses a library of statistical functions, with debug info but no source code.

Demonstrates: task parallelism. Also, certain loops call library code whose source is not available.

Data conflicts: none

Correctness tool: Use the default data set. To adjust the data set, use ifdef _DEBUG :

#ifdef _DEBUG
  #define SIZE 500
#else
  #define SIZE 100000
#endif

stats.pdf in stats.zip

tachyon_Advisor (C++)

Performs 2-dimensional ray-tracing/rendering. After it computes and displays the image, it waits about five seconds before it closes.

Demonstrates: data parallelism. The goal is to parallelize the ray tracing of the picture's horizontal lines.

Data conflicts, multiple problems:

  • Incidental sharing conflicts of the m_storage structure. This is fixed by using copies local to each task.
  • A data race on global variable g_updates. This is fixed with synchronization by inserting a lock.

Correctness tool: Completes in 4-7 minutes on a dual-core system using the default data set. To reduce execution time, use a reduced (different) data set, by specify one of the .dat files in the tachyon\project\dat directory as a command argument. For example, in Visual Studio specify ..dat\820spheres.dat as an argument to the project properties: Project > Properties > Configuration Properties > Debugging > Command Arguments.. The default data set for a Release configuration build is balls.dat. To use the reduced data set for a Debug build for the Correctness tool, specify 3spheres.dat.

tachyon_Advisor.pdf in  tachyon_Advisor.zip

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