PRIVATE Clause
Parallel Directive Clause: Declares specified variables to be private to each thread in a team.
Syntax
PRIVATE (list)
list
Is the name of one or more variables or common blocks that are accessible to the scoping unit. Subobjects cannot be specified. Each name must be separated by a comma, and a named common block must appear between slashes (/ /).
The following occurs when variables are declared in a PRIVATE clause:
- A new object of the same type is declared once for each thread in the team. The new object is no longer storage associated with the original object.
- All references to the original object in the lexical extent of the directive construct are replaced with references to the private object.
- Variables defined as PRIVATE are undefined for each thread on entering the construct and the corresponding shared variable is undefined on exit from a parallel construct.
- Contents, allocation state, and association status of variables defined as PRIVATE are undefined when they are referenced outside the lexical extent (but inside the dynamic extent) of the construct, unless they are passed as actual arguments to called routines.
See Also:
Optimizing Applications:
OpenMP*
Directives and Clauses Summary,
Optimizing Applications:
Data
Scope Attribute Clauses Overview