Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 6/24/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

OpenMP* Fortran Compiler Directives

Intel® Fortran supports OpenMP* Fortran compiler directives that comply with OpenMP Fortran Application Program Interface (API) specification 5.0, most of the OpenMP Version 5.1 and OpenMP Version 5.2 specifications, and some of the OpenMP 6.0 Version TR12 specification.

To use these directives, you must specify compiler option -qopenmp (Linux*) or /Qopenmp (Windows*). Offloading directives are enabled with option -fopenmp-targets (Linux) or /Qopenmp-targets (Windows).

OpenMP directives are specially formatted Fortran comment lines embedded in the source file which provide the compiler with hints and suggestions for parallelization, optimization, vectorization, and offloading code to accelerator hardware. The compiler uses the information specified in the directives with compiler heuristic algorithms to generate more efficient code. At times, these heuristics may choose to ignore or override the information provided by a directive. If the directive is ignored by the compiler, no diagnostic message is issued.

Options that use OpenMP 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 vs. non-Intel microprocessors includes: locks (internal and user visible), the SINGLE construct, barriers (explicit and implicit), parallel loop scheduling, reductions, memory allocation, thread affinity, and binding.

Unless denoted as a pure directive, OpenMP directives are not allowed in Fortran procedures declared to be PURE.

The following is an alphabetical list of supported OpenMP Fortran directives:

ALLOCATE

Specifies memory allocators to use for object allocation and deallocation. This feature is only available for ifx.

ALLOCATORS

Specifies memory allocators to use for object allocation in Fortran ALLOCATE statements and for their deallocation. This feature is only available for ifx.

ASSUMES

Provides hints to the optimizer about the current compilation unit and all the code it can reach through procedure calls. It is a pure directive. This feature is only available for ifx.

ATOMIC

Specifies that a specific memory location is to be updated atomically.

BARRIER

Synchronizes all the threads in a team.

The OpenMP Fortran directives can be grouped into categories. For more information about the categories for these directives, see Categories for OpenMP* Fortran Directives.

Product and Performance Information

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

Notice revision #20201201