Sun Logo


OpenMP API User's Guide

Forte Developer 7

816-2468-10



Contents

Before You Begin

Typographic Conventions

Shell Prompts

Accessing Forte Developer Development Tools and Man Pages

Accessing Forte Developer Documentation

Accessing Related Solaris Documentation

Sending Your Comments

1. OpenMP API Summary

1.1 Where to Find the OpenMP Specifications

1.2 Special Conventions Used Here

1.3 Directive Formats

1.4 Conditional Compilation

1.5 PARALLEL - Parallel Region Construct

1.6 Work-Sharing Constructs

1.6.1 DO and for

1.6.2 SECTIONS

1.6.3 SINGLE

1.6.4 Fortran WORKSHARE

1.7 Combined Parallel Work-sharing Constructs

1.7.1 PARALLEL DO and parallel for

1.7.2 PARALLEL SECTIONS

1.7.3 PARALLEL WORKSHARE

1.8 Synchronization Constructs

1.8.1 MASTER

1.8.2 CRITICAL

1.8.3 BARRIER

1.8.4 ATOMIC

1.8.5 FLUSH

1.8.6 ORDERED

1.9 Data Environment Directives

1.9.1 THREADPRIVATE

1.10 OpenMP Directive Clauses

1.10.1 Data Scoping Clauses

1.10.1.1 PRIVATE

1.10.1.2 SHARED

1.10.1.3 DEFAULT

1.10.1.4 FIRSTPRIVATE

1.10.1.5 LASTPRIVATE

1.10.1.6 COPYIN

1.10.1.7 COPYPRIVATE

1.10.1.8 REDUCTION

1.10.2 Scheduling Clauses

1.10.2.1 STATIC Scheduling

1.10.2.2 DYNAMIC Scheduling

1.10.2.3 GUIDED Scheduling

1.10.2.4 RUNTIME Scheduling

1.10.3 NUM_THREADS Clause

1.10.4 Placement of Clauses on Directives

1.11 OpenMP Runtime Library Routines

1.11.1 Fortran OpenMP Routines

1.11.2 C/C++ OpenMP Routines

1.11.3 Run-time Thread Management Routines

1.11.3.1 OMP_SET_NUM_THREADS

1.11.3.2 OMP_GET_NUM_THREADS

1.11.3.3 OMP_GET_MAX_THREADS

1.11.3.4 OMP_GET_THREAD_NUM

1.11.3.5 OMP_GET_NUM_PROCS

1.11.3.6 OMP_IN_PARALLEL

1.11.3.7 OMP_SET_DYNAMIC

1.11.3.8 OMP_GET_DYNAMIC

1.11.3.9 OMP_SET_NESTED

1.11.3.10 OMP_GET_NESTED

1.11.4 Routines That Manage Synchronization Locks

1.11.4.1 OMP_INIT_LOCK and OMP_INIT_NEST_LOCK

1.11.4.2 OMP_DESTROY_LOCK and OMP_DESTROY_NEST_LOCK

1.11.4.3 OMP_SET_LOCK and OMP_SET_NEST_LOCK

1.11.4.4 OMP_UNSET_LOCK and OMP_UNSET_NEST_LOCK

1.11.4.5 OMP_TEST_LOCK and OMP_TEST_NEST_LOCK

1.11.5 Timing Routines

1.11.5.1 OMP_GET_WTIME

1.11.5.2 OMP_GET_WTICK

2. Implementation Dependent Issues

3. Compiling for OpenMP

3.1 Fortran 95

3.1.1 Validation of OpenMP Directives With -XlistMP

3.2 C and C++

3.3 OpenMP Environment Variables

3.4 Stacks and Stack Sizes

4. Converting to OpenMP

4.1 Converting Legacy Fortran Directives

4.1.1 Converting Sun-Style Directives

4.1.1.1 Issues Between Sun-Style Directives and OpenMP

4.1.2 Converting Cray-Style Directives

4.1.2.1 Issues Between Cray-Style Directives and OpenMP Directives

4.2 Converting Legacy C Pragmas

4.2.1 Issues Between Legacy C Pragmas and OpenMP