In this step, you will compile the source code into an application that runs on both the host and target and then run the application. To compile the source code, run the specified command in the same terminal session from the previous step. If you open a new terminal session, you will have to set the environment variables in the new terminal session.
Compile the code using the following command:
ifort -openmp tbo_sort.F90 -o tbo_exe_MIC
By default, the compiler compiles the code into an application that can run on both the host and the target. The -openmp option sets the compiler to generate multi-threaded code based on OpenMP* directives.
Run the application using the following command.
./tbo_exe_MIC
The application displays the number of targets in the system, displays the first 20 values in ascending order, and then displays the first ten even, odd, and prime numbers.
While most of the code runs on the host, the code to find the first ten even, odd, and prime numbers runs on the target. Later in this tutorial, you will see the how these code sections are defined.
In the next step, you will look at the code to find the section that gives more information about the target.