Sun Logo


OpenMP API User's Guide

Suntrademark Studio 9

817-6703-10



Contents

Tables

Before You Begin

Typographic Conventions

Shell Prompts

Accessing Sun Studio Software and Man Pages

Accessing Sun Studio Documentation

Accessing Related Solaris Documentation

Resources for Developers

Contacting Sun Technical Support

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 Constructs

1.6.2 SECTIONS Construct

1.6.3 SINGLE Construct

1.6.4 Fortran WORKSHARE Construct

1.7 Combined Parallel Work-sharing Constructs

1.7.1 PARALLEL DO and parallel for Constructs

1.7.2 PARALLEL SECTIONS Construct

1.7.3 PARALLEL WORKSHARE Construct

1.8 Synchronization Constructs

1.8.1 MASTER Construct

1.8.2 CRITICAL Construct

1.8.3 BARRIER Construct

1.8.4 ATOMIC Construct

1.8.5 FLUSH Construct

1.8.6 ORDERED Construct

1.9 Data Environment Directives

1.9.1 THREADPRIVATE Directive

1.10 OpenMP Directive Clauses

1.10.1 Data Scoping Clauses

1.10.2 Scheduling Clauses

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.4 Routines That Manage Synchronization Locks

1.11.5 Timing Routines

2. Implementation-Dependent Issues

3. Compiling for OpenMP

3.1 Compiler Options To Use

3.2 Fortran 95 OpenMP Validation

3.3 OpenMP Environment Variables

3.4 Processor Binding

3.5 Stacks and Stack Sizes

4. Converting to OpenMP

4.1 Converting Legacy Fortran Directives

4.1.1 Converting Sun-Style Fortran Directives

4.1.2 Converting Cray-Style Fortran Directives

4.2 Converting Legacy C Pragmas

4.2.1 Issues Between Legacy C Pragmas and OpenMP

5. Automatic Scoping in Fortran

5.1 The Autoscoping Data Scope Clause

5.1.1 __AUTO Clause

5.1.2 DEFAULT(__AUTO) Clause

5.2 Scoping Rules

5.2.1 Scoping Rules For Scalar Variables

5.2.2 Scoping Rules for Arrays

5.3 General Comments About Autoscoping

5.4 Checking the Results of Autoscoping

5.5 Known Limitations of the Current Implementation

6. Performance Considerations

6.1 Some General Recommendations

6.2 False Sharing And How To Avoid It

6.2.1 What Is False Sharing?

6.2.2 Reducing False Sharing

6.3 Operating System Tuning Features

Index