Adding OpenMP* Support to your Application
To add OpenMP* support to your application, do the following:
- Add the appropriate OpenMP*pragmasto your source code.
- Compile the application with theQopenmp(Windows) orqopenmp(Linux*and) option.macOS*
- For applications with large local or temporary arrays, you may need to increase the stack space available at run-time. In addition, you may need to increase the stack allocated to individual threads by using theenvironment variable or by setting the corresponding library routines.OMP_STACKSIZE
You can set other environment variables to control multi-threaded code execution.
To add OpenMP* support to your application, first
declare the OpenMP* header and thenadd appropriate OpenMP*
pragmasto your source code.
To declare the OpenMP* header, add the following in your code:
pragmasuse a specific format and syntax. Intel Extension Routines to OpenMP* describes the OpenMP* extensions to the specification that have been added to the Intel®
The following syntax illustrates using the
pragmasin your source.
- <prefix> - Required for all OpenMP*pragmas. The prefix must be#pragma omp.