HOME
| OPENMP API Specification: "Version 5.2 -- GIT rev 95b2e3a44"

5.1.1  Variables Referenced in a Construct

The data-sharing attributes of variables that are referenced in a construct can be predetermined, explicitly determined, or implicitly determined, according to the rules outlined in this section.

Specifying a variable in a copyprivate clause or a data-sharing attribute clause other than the private clause on an enclosed construct causes an implicit reference to the variable in the enclosing construct. Specifying a variable in a map clause of an enclosed construct may cause an implicit reference to the variable in the enclosing construct. Such implicit references are also subject to the data-sharing attribute rules outlined in this section.

A type parameter inquiry or complex part designator that is referenced in a construct is treated as if its designator is referenced.

Certain variables and objects have predetermined data-sharing attributes for the construct in which they are referenced. The first matching rule from the following list of predetermined data-sharing attribute rules applies for variables and objects that are referenced in a construct.

Variables with predetermined data-sharing attributes may not be listed in data-sharing attribute clauses, except for the cases listed below. For these exceptions only, listing a predetermined variable in a data-sharing attribute clause is allowed and overrides the variable’s predetermined data-sharing attributes.

Additional restrictions on the variables that may appear in individual clauses are described with each clause in Section 5.4.

Variables with explicitly determined data-sharing attributes are those that are referenced in a given construct and are listed in a data-sharing attribute clause on the construct.

Variables with implicitly determined data-sharing attributes are those that are referenced in a given construct and do not have predetermined or explicitly determined data-sharing attributes in that construct.

Rules for variables with implicitly determined data-sharing attributes are as follows:

A program is non-conforming if a variable in a task generating construct is implicitly determined to be firstprivate according to the above rules but is not permitted to appear in a firstprivate clause according to the restrictions specified in Section 5.4.4.