| Cray C and C++ Reference Manual - S-2179-51 | ||
|---|---|---|
| Prev Section | Next Section | |
This chapter describes the OpenMP directives that the Cray C Compiler supports. These directives are based on the OpenMP C and C++ Application Program Interface Version 2.0 March 2002 standard. Copyright © 1997-2002 OpenMP Architecture Review Board.
In addition to directives, the OpenMP C API describes several run time library routines and environment variables. For information on the library routines, see the omp_lock(3), omp_nested(3), omp_threads(3), and omp_timing(3) man pages. For information on the environment variables, see Section 2.25.
The sections in this chapter are as follows:
Using directives (Section 4.1)
Conditional compilation (Section 4.2)
parallel construct (Section 4.3)
Work-sharing constructs (Section 4.4)
Combined parallel work-sharing constructs (Section 4.5)
Master and synchronization directives (Section 4.6)
Data environment (Section 4.7)
Directive binding (Section 4.8)
Directive nesting (Section 4.9)
Using the schedule clause (Section 4.10)
OpenMP directives are based on #pragma directives. Directives are case-insensitive and are of the following form:
#pragma omp directive-name [clause[ [,] clause]... ] new-line |
Each directive starts with #pragma omp. The remainder of the directive follows the conventions of the C standard for compiler directives. In particular, white space can be used before and after the #, and sometimes white space must be used to separate the words in a directive. Preprocessing tokens following the #pragma omp are subject to macro replacement.
Directives are case sensitive. The order in which clauses appear in directives is not significant. Clauses in directives may be repeated as needed, subject to the restrictions listed in the description of each clause. If variable-list appears in a clause, it must specify only variables. Only one directive-name can be specified per directive. For example, the following directive is not allowed:
/* ERROR - multiple directive names not allowed */ #pragma omp parallel barrier |
An OpenMP directive applies to at most one succeeding statement, which must be a structured block.
| Prev Section | Table of Contents | Title Page | Index | Next Section |
| Inlining Directives | Up one level | Conditional Compilation |