qopenmp, Qopenmp

Enables recognition of OpenMP* features and tells the parallelizer to generate multi-threaded code based on OpenMP* directives.

Syntax

Linux:

-qopenmp

-qno-openmp

macOS:

-qopenmp

-qno-openmp

Windows:

/Qopenmp

/Qopenmp-

Arguments

None

Default

-qno-openmp or /Qopenmp-

No OpenMP* multi-threaded code is generated by the compiler.

Description

This option enables recognition of OpenMP* features and tells the parallelizer to generate multi-threaded code based on OpenMP* directives. The code can be executed in parallel on both uniprocessor and multiprocessor systems.

If you use this option, multithreaded libraries are used, but option fpp is not automatically invoked.

This option sets option automatic.

This option works with any optimization level. Specifying no optimization (-O0 on Linux* or /Od on Windows*) helps to debug OpenMP applications.

To ensure that a threadsafe and/or reentrant run-time library is linked and correctly initialized, option [q or Q]openmp should also be used for the link step and for the compilation of the main routine.

Note

To enable offloading to a specified GPU target, specify option fopenmp-targets (Linux*) or /Qopenmp-targets (Windows).

Note

The -qopenmp, -fopenmp, and /Qopenmp options enable an OpenMP* implementation that generates OpenMP* code in the compiler front end. The compiler back end can then optimize the OpenMP* code the same way as any other code, but the back end does not see any of the parallelism exposed by OpenMP*.

As a result, the backend cannot do SIMD vectorization or offload code to an accelerator based on the OpenMP* directives in the source code. If you want to do SIMD vectorization or offloading, you must use option -fiopenmp (Linux*) or /Qiopenmp (Windows*).

Note

Options that use OpenMP* API are available for both Intel® microprocessors and non-Intel microprocessors, but these options may perform additional optimizations on Intel® microprocessors than they perform on non-Intel microprocessors. The list of major, user-visible OpenMP constructs and features that may perform differently on Intel® microprocessors versus non-Intel microprocessors include: locks (internal and user visible), the SINGLE construct, barriers (explicit and implicit), parallel loop scheduling, reductions, memory allocation, thread affinity, and binding.

Product and Performance Information

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.

Notice revision #20201201

IDE Equivalent

Visual Studio: Language > Process OpenMP Directives

Alternate Options

Linux and macOS*: -fopenmp

Windows: /openmp

See Also