JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Studio 12.2: OpenMP API User's Guide
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

6.  Automatic Scoping of Variables

6.1 The Autoscoping Data Scope Clause

6.1.1 __auto Clause

6.1.2 default(__auto) Clause

6.2 Scoping Rules for a Parallel Construct

6.2.1 Scoping Rules For Scalar Variables

6.2.2 Scoping Rules for Arrays

6.3 Scoping Rules for a task Construct

6.3.1 Scoping Rules for Scalar Variables

6.3.2 Scoping Rules for Arrays

6.4 General Comments About Autoscoping

6.5 Restrictions

6.6 Checking the Results of Autoscoping

6.7 Autoscoping Examples

7.  Scope Checking

8.  Performance Considerations

A.  Placement of Clauses on Directives

B.  Converting to OpenMP

Index

6.4 General Comments About Autoscoping

Note that task autoscoping rules and autoscoping results could change in future releases. Also, the order that implicitly determined scoping rules and autoscoping rules are applied could change in future releases as well.

The programmer explicitly requests autoscoping with the _auto(list-of-variables) clause, or the default(_auto) clause.Specifying default(_auto) or _auto(list-of-variables) clause for a parallel construct doesn't imply that same clause applies to task constructs that are lexically or dynamically enclosed in the parallel construct.

When autoscoping a variable that does not have predetermined implicit scope, the compiler checks the use of the variable against the above rules in the given order. If a rule matches, the compiler will scope the variable according to the matching rule. If no rule matches, or if autoscoping cannot handle the variable (there are certain restrictions, described below), the compiler will scope the variable as SHARED and treat the parallel or task construct as if an IF (.FALSE.) or if(0) clause were specified.

There aregenerally two reasons why autoscoping fails. One is that the use of the variable does not match any of the rules. The other is that the source code is too complex for the compiler to do a sufficient analysis. Function calls, complicated array subscripts, memory aliasing, and user-implemented synchronizations are some typical causes.