JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Studio 12.3: OpenMP API User's Guide     Oracle Solaris Studio 12.3 Information Library
search filter icon
search icon

Document Information

Preface

1.  Introducing the OpenMP API

2.  Compiling and Running OpenMP Programs

3.  Implementation-Defined Behaviors

4.  Nested Parallelism

5.  Tasking

5.1 Tasking Model

5.2 Data Environment

5.3 Tasking Example

5.4 Programming Considerations

5.4.1 THREADPRIVATE and Thread-Specific Information

5.4.2 Locks

5.4.3 References to Stack Data

6.  Automatic Scoping of Variables

7.  Scope Checking

8.  Performance Considerations

A.  Placement of Clauses on Directives

Index

5.2 Data Environment

The task directive takes the following data attribute clauses that define the data environment of the task:

All references within a task to a variable listed in the shared clause refer to the variable with that same name known immediately prior to the task directive.

For each private and firstprivate variable, new storage is created and all references to the original variable in the lexical extent of the task construct are replaced by references to the new storage. A firstprivate variable is initialized with the value of the original variable at the moment the task is encountered.

The OpenMP 3.0 specification version 3.0 (in section 2.9.1) describes how the data-sharing attributes of variables referenced in parallel, task, and worksharing regions are determined.

The data-sharing attributes of variables referenced in a construct may be one of the following: predetermined, explicitly determined, or implicitly determined. 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, do not have predetermined data-sharing attributes, and are not listed in a data-sharing attribute clause on the construct.

The rules for how the data-sharing attributes of variables are implicitly determined might not always be obvious. To avoid any surprises be sure to explicitly scope all variables that are referenced in a task construct using the data sharing attribute clauses rather than relying on the OpenMP implicit scoping rules.