In Microsoft Visual Studio*, select Build > Build Solution. This builds the program. Run it by selecting Debug > Start Without Debugging. The console window contains the following program output:
To build the OpenMP* version, you will modify the sample application to use OpenMP* parallelization and then compile the modified code. You will then run the application and compare the time with the baseline performance time.
Remove all of the files that were created when you build the serial version by running the following command in a terminal session:
Coarrays are used to split the trials across multiple copies of the program. They are called images. Each image has its own local variables, plus a portion of any coarrays shared variables. A coarray can be a scalar. A coarray can be thought of as having extra dimensions, referred to as codimensions. To declare a coarray, either add the CODIMENSION attribute, or specify the cobounds alongside the variable name. The cobounds are always enclosed in square brackets. Some examples:
To build the Intel® Threading Building Blocks (Intel® TBB) version, you will modify the sample application to use Intel® TBB and then compile the modified code. You will then run the application and then compare the time with the baseline performance time.
In this tutorial, you will use the following files:
matrix_vector_multiplication_f.sln or matrix_vector_multiplication_f.vfproj
The compiler may be able to perform additional optimizations if it is able to optimize across source line boundaries. These may include, but are not limited to, function inlining. This is enabled with the -ipo option.
Recompile the program using the -ipo option to enable interprocedural optimization.
icc -std=c99 -qopt-report=2 -qopt-report-phase=vec -D NOALIAS -D ALIGNED -ipo Multiply.c Driver.c -o MatVector
The Intel® Fortran Compiler requires that the coarray features are enabled by specifying the /Qcoarray option. In Microsoft Visual Studio*, set the project property to Fortran > Language > Enable Coarrays to For Shared Memory and then click OK.