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

7.  Scope Checking

8.  Performance Considerations

A.  Placement of Clauses on Directives

B.  Converting to OpenMP

B.1 Converting Legacy Fortran Directives

B.1.1 Converting Sun-Style Fortran Directives

B.1.1.1 Issues Between Sun-Style Fortran Directives and OpenMP

B.1.2 Converting Cray-Style Fortran Directives

B.1.2.1 Issues Between Cray-Style Fortran Directives and OpenMP Directives

B.2 Converting Legacy C Pragmas

B.2.1 Issues Between Legacy C Pragmas and OpenMP

Index

B.1 Converting Legacy Fortran Directives

Legacy Fortran programs use either Sun or Cray style parallelization directives. A description of these directives can be found in the chapter Parallelization in the Fortran Programming Guide.

B.1.1 Converting Sun-Style Fortran Directives

The following tables give OpenMP near equivalents to Sun parallelization directives and their subclauses. These are only suggestions.

Table B-1 Converting Sun Parallelization Directives to OpenMP

Sun Directive
Equivalent OpenMP Directive
C$PAR DOALL [qualifiers]
!$omp parallel do [qualifiers]
C$PAR DOSERIAL
No exact equivalent. You can use:

!$omp master

loop

!$omp end master

C$PAR DOSERIAL*
No exact equivalent. You can use:

!$omp master

loopnest

!$omp end master

C$PAR TASKCOMMON block[,...]
!$omp threadprivate (/block/[,...])

The DOALL directive can take the following optional qualifier clauses.

Table B-2 DOALL Qualifier Clauses and OpenMP Equivalent Clauses

Sun DOALL Clause
OpenMP PARALLEL DO Equivalent Clauses
PRIVATE(v1,v2,...)
private(v1,v2,...)
SHARED(v1,v2,...)
shared(v1,v2,...)
MAXCPUS(n)
num_threads(n). No exact equivalent.
READONLY(v1,v2,...)
No exact equivalent. You can achieve the same effect by using firstprivate(v1,v2,...).
STOREBACK(v1,v2,...)
lastprivate(v1,v2,...).
SAVELAST
No exact equivalent. You can achieve the same effect by using lastprivate(v1,v2,...).
REDUCTION(v1,v2,...)
reduction(operator:v1,v2,...) Must supply the reduction operator as well as the list of variables.
SCHEDTYPE(spec)
schedule(spec) (See Table B-3)

The SCHEDTYPE(spec) clause accepts the following scheduling specifications.

Table B-3 SCHEDTYPE Scheduling and OpenMP schedule Equivalents

SCHEDTYPE(spec)
OpenMP schedule( spec) Clause Equivalent
SCHEDTYPE(STATIC)
schedule(static)
SCHEDTYPE(SELF(chunksize))
schedule(dynamic,chunksize)

Default chunksize is 1.

SCHEDTYPE(FACTORING(m))
No exact equivalent.
SCHEDTYPE(GSS(m))
schedule(guided, m)

Default m is 1.

B.1.1.1 Issues Between Sun-Style Fortran Directives and OpenMP

B.1.2 Converting Cray-Style Fortran Directives

Cray-style Fortran parallelization directives are identical to Sun-style except that the sentinel that identifies these directives is !MIC$. Also, the set of qualifier clauses on the !MIC$ DOALL is different.

Table B-4 OpenMP Equivalents for Cray-Style DOALL Qualifier Clauses

Cray DOALL Clause
OpenMP PARALLEL DO Equivalent Clauses
SHARED(v1,v2,...)
SHARED(v1,v2,...)
PRIVATE(v1,v2,...)
PRIVATE(v1,v2,...)
AUTOSCOPE
No equivalent. Scoping must be explicit, or with the DEFAULT clause, or with the __AUTO clause
SAVELAST
No exact equivalent. You can achieve the same effect by using lastprivate.
MAXCPUS(n)
num_threads(n). No exact equivalent.
GUIDED
schedule(guided, m)

Default m is 1.

SINGLE
schedule(dynamic,1)
CHUNKSIZE(n)
schedule(dynamic,n)
NUMCHUNKS(m)
schedule(dynamic,n/m) where n is the number of iterations
B.1.2.1 Issues Between Cray-Style Fortran Directives and OpenMP Directives

The differences are the same as for Sun-style directives, except that there is no equivalent for the Cray AUTOSCOPE.