Developer Guide and Reference

Contents

Adding OpenMP* Support to your Application

To add OpenMP* support to your application, do the following:
  1. Add the appropriate OpenMP*
    pragmas
    to your source code.
  2. Compile the application with the
    Qopenmp
    (Windows) or
    qopenmp
    (Linux*
    and
    macOS*
    ) option.
  3. 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 the
    OMP_STACKSIZE
    environment variable or by setting the corresponding library routines.
You can set other environment variables to control multi-threaded code execution.

OpenMP
Pragma
Syntax

To add OpenMP* support to your application, first
declare the OpenMP* header and then
add appropriate OpenMP*
pragmas
to your source code.
To declare the OpenMP* header, add the following in your code:
#include <omp.h>
OpenMP*
pragmas
use a specific format and syntax. Intel Extension Routines to OpenMP* describes the OpenMP* extensions to the specification that have been added to the Intel®
C++
Compiler.
The following syntax illustrates using the
pragmas
in your source.
Example
<prefix> <pragma> [<clause>, ...] <newline>
where:
  • <
    prefix
    > - Required for all OpenMP*
    pragmas. The prefix must be
    #pragma omp
    .
  • <