Introduction
Examples
1 Parallel Execution
1.1 A Simple Parallel Loop
1.2 The parallel Construct
1.3 Controlling the Number of Threads on Multiple Nesting Levels
1.4 Interaction Between the num_threads Clause and omp_set_dynamic
1.5 Fortran Restrictions on the do Construct
1.6 The nowait Clause
1.7 The collapse Clause
1.8 linear Clause in Loop Constructs
1.9 The parallel sections Construct
1.10 The firstprivate Clause and the sections Construct
1.11 The single Construct
1.12 The workshare Construct
1.13 The master Construct
1.14 Parallel Random Access Iterator Loop
1.15 The omp_set_dynamic and omp_set_num_threads Routines
1.16 The omp_get_num_threads Routine
2 OpenMP Affinity
2.1 The proc_bind Clause
2.1.1 Spread Affinity Policy
2.1.2 Close Affinity Policy
2.1.3 Master Affinity Policy
2.2 Affinity Query Functions
3 Tasking
3.1 The task and taskwait Constructs
3.2 Task Priority
3.3 Task Dependences
3.3.1 Flow Dependence
3.3.2 Anti-dependence
3.3.3 Output Dependence
3.3.4 Concurrent Execution with Dependences
3.3.5 Matrix multiplication
3.4 The taskgroup Construct
3.5 The taskyield Construct
3.6 The taskloop Construct
4 Devices
4.1 target Construct
4.1.1 target Construct on parallel Construct
4.1.2 target Construct with map Clause
4.1.3 map Clause with to/from map-types
4.1.4 map Clause with Array Sections
4.1.5 target Construct with if Clause
4.2 target data Construct
4.2.1 Simple target data Construct
4.2.2 target data Region Enclosing Multiple target Regions
4.2.3 target data Construct with Orphaned Call
4.2.4 target data Construct with if Clause
4.3 target enter data and target exit data Constructs
4.4 target update Construct
4.4.1 Simple target data and target update Constructs
4.4.2 target update Construct with if Clause
4.5 declare target Construct
4.5.1 declare target and end declare target for a Function
4.5.2 declare target Construct for Class Type
4.5.3 declare target and end declare target for Variables
4.5.4 declare target and end declare target with declare simd
4.5.5 declare target Directive with link Clause
4.6 teams Constructs
4.6.1 target and teams Constructs with omp_get_num_teams and omp_get_team_num Routines
4.6.2 target, teams, and distribute Constructs
4.6.3 target teams, and Distribute Parallel Loop Constructs
4.6.4 target teams and Distribute Parallel Loop Constructs with Scheduling Clauses
4.6.5 target teams and distribute simd Constructs
4.6.6 target teams and Distribute Parallel Loop SIMD Constructs
4.7 Asynchronous target Execution and Dependences
4.7.1 Asynchronous target with Tasks
4.7.2 nowait Clause on target Construct
4.7.3 Asynchronous target with nowait and depend Clauses
4.8 Array Sections in Device Constructs
4.9 Device Routines
4.9.1 omp_is_initial_device Routine
4.9.2 omp_get_num_devices Routine
4.9.3 omp_set_default_device and omp_get_default_device Routines
4.9.4 Target Memory and Device Pointers Routines
5 SIMD
5.1 simd and declare simd Constructs
5.2 inbranch and notinbranch Clauses
5.3 Loop-Carried Lexical Forward Dependence
6 Synchronization
6.1 The critical Construct
6.2 Worksharing Constructs Inside a critical Construct
6.3 Binding of barrier Regions
6.4 The atomic Construct
6.5 Restrictions on the atomic Construct
6.6 The flush Construct without a List
6.7 The ordered Clause and the ordered Construct
6.8 Doacross Loop Nest
6.9 Lock Routines
6.9.1 The omp_init_lock Routine
6.9.2 The omp_init_lock_with_hint Routine
6.9.3 Ownership of Locks
6.9.4 Simple Lock Routines
6.9.5 Nestable Lock Routines
7 Data Environment
7.1 The threadprivate Directive
7.2 The default(none) Clause
7.3 The private Clause
7.4 Fortran Private Loop Iteration Variables
7.5 Fortran Restrictions on shared and private Clauses with Common Blocks
7.6 Fortran Restrictions on Storage Association with the private Clause
7.7 C/C++ Arrays in a firstprivate Clause
7.8 The lastprivate Clause
7.9 The reduction Clause
7.10 The copyin Clause
7.11 The copyprivate Clause
7.12 C++ Reference in Data-Sharing Clauses
7.13 Fortran ASSOCIATE Construct
8 Memory Model
8.1 The OpenMP Memory Model
8.2 Race Conditions Caused by Implied Copies of Shared Variables in Fortran
9 Program Control
9.1 Conditional Compilation
9.2 Internal Control Variables (ICVs)
9.3 Placement of flush, barrier, taskwait and taskyield Directives
9.4 Cancellation Constructs
9.5 Nested Loop Constructs
9.6 Restrictions on Nesting of Regions
A Document Revision History
A.1 Changes from 4.0.2 to 4.5.0
A.2 Changes from 4.0.1 to 4.0.2
A.3 Changes from 4.0 to 4.0.1
A.4 Changes from 3.1 to 4.0