Intel® Advisor User Guide

ID 766448
Date 3/22/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*

OpenMP* is a parallel programming framework for C, C++, or Fortran code. Using OpenMP requires few source changes and is supported by multiple compilers. Because OpenMP is supported by OpenMP libraries, you modify your source code with compiler directives rather than using types, variables, and calls. An OpenMP program can often be changed from parallel execution to serial execution by omitting a compiler option so the compiler ignores the OpenMP directives.

OpenMP 2 is very good at using several cores on loops that process arrays, but does not support irregular parallelism through general tasking. It is supported by the Microsoft, the Intel, and the GNU* C, C++ and Fortran compilers. It is difficult to use OpenMP version 2 for situations other than simple divisions of statement sequences or complete loop bodies.

The OpenMP 3.0 specification adds TASK support. The TASK directives enable performing arbitrary pieces of an algorithm in parallel. The Intel® C++ Compiler Classic and Intel® Fortran Compiler Classic support OpenMP 3.0 and some parts of OpenMP 4.0. For Intel, Microsoft, and GNU* compilers, consult your compiler documentation for the level of OpenMP support.

If your application is written in Fortran, OpenMP is the only high-level parallel framework available.

TIP:
After you rewrite your code to use OpenMP* parallel framework, you can analyze its performance with Intel® Advisor perspectives. Use the Vectorization and Code Insights perspective to analyze how well you OpenMP code is vectorized or use the Offload Modeling perspective to model its performance on a GPU.