Compiling the Source Code to Run on the CPU Only

In this step, you will compile the same source code into an application that runs only on the CPU. You can use the information in this step to compile an early version of your source code to ensure that the application runs correctly on just the CPU. Once you have your application running on just the CPU, you can compile the same code into an application that runs on both the CPU and coprocessor.

  1. In the sample code directory, compile the source code into the application with the following command:

    icc -openmp -no-offload tbo_sort.c -o tbo_exe_CPU

    The no-offload option sets the compiler to ignore the directive containing the __INTEL_OFFLOAD macro. This directive contains the code block to detect the coprocessor and other coprocessor specific directives.

  2. Run the application with the following command.

    ./tbo_exe_CPU

Just as before, the application displays the first 20 values in ascending order and the first ten even, odd, and prime numbers. However, this application does not display the number of running coprocessors because the compiler ignored the directive with __INTEL_OFFLOAD macro.

This step is the last step in the tutorial.

Open the Introduction to Coarray Fortran topic


Submit feedback on this help topic
Click here for more Getting Started Tutorials