Intel® Advisor Help

Overview of Parallel Frameworks

Before you can add parallel code , you must first choose a parallel framework.

There are two popular mechanisms for using threads - either use high-level parallel frameworks or explicit threading APIs. Intel recommends using parallel frameworks for both ease of use and their ability to optimize for different situations.

This document shows how to use the widely-used parallel frameworks for native code, which are included with most Intel® Parallel Studio XE editions and may be included with other compilers:

Intel Threading Building Blocks (Intel® TBB) is a parallel programming framework for C++ code. Intel TBB is structured as a traditional C++ library, consisting of header files and a run-time library, so it can be used with any C++ compiler. Intel recommends that you consider using Intel TBB for introducing parallelism into C++ programs. Intel TBB programs can be run on any platform (OS/architecture pair) to which the Intel TBB library has been ported. For example, the Intel® C++ Compiler includes Intel TBB and supports Windows*, Linux*, and Apple OS X* operating systems. The open source version is available at http://www.threadingbuildingblocks.org.

Intel Cilk Plus is a high-level framework for parallel programming in C and C++ programs. For C programs, use Intel Cilk Plus or one of the other parallel frameworks described in Using Other Parallel Frameworks. Intel Cilk Plus is simpler to use than Intel TBB because it takes advantage of direct compiler support for the Intel Cilk Plus keywords. Unlike Intel TBB, Intel Cilk Plus programs must be compiled by a compiler that supports the Intel Cilk Plus keywords, such as the Intel C++ Compiler, certain versions of the GNU* gcc compiler with the Intel Cilk Plus branch, or other compilers (see http://www.cilkplus.org/which-license).

OpenMP is a high-level framework that supports C, C++, and Fortran. OpenMP is provided by compiler support, so you modify your sources by using compiler directives rather than using types, variables, and calls. An OpenMP program can often be changed from parallel execution to serial execution by setting an environment variable or omitting a compiler option so the compiler ignores the directives. OpenMP 2 is supported by the Microsoft, the Intel, and the GNU* C, C++ and Fortran compilers. The OpenMP 3.0 standard adds TASK support and is supported by the Intel compilers, which also support parts of OpenMP 4.0. For Microsoft and GNU compilers, consult your compiler documentation for the current level of OpenMP support.

You can also use a different parallel framework, as described in Using Other Parallel Frameworks.

Linux OS: Support for Parallel Frameworks by GNU* and Intel Compilers

With a Fortran program, the only high-level parallel framework available is OpenMP. The following table summarizes the support by GNU gcc* and Intel compilers for the recommended parallel frameworks for C/C++ programs on Linux OS systems.

Language and Compiler

Intel Cilk Plus

Intel TBB

OpenMP

C programs, Intel C++ Compiler (icc)

Supported

Supported

C++ programs, Intel C++ Compiler icc)

Supported

Supported

Supported

C programs, GNU gcc Compiler (gcc)

Supported if using the gcc Intel Cilk Plus branch

Supported

C++ programs, GNU gcc Compiler (gxx)

Supported if using the gcc Intel Cilk Plus branch

Supported

Supported

For more information about Intel TBB, OpenMP, and Intel Cilk Plus, see the following sections in this Intel Advisor help system. For detailed instructions, see your compiler documentation and the resources listed in Related Information.

See Also