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

2.1 Compiler Options To Use

2.2 OpenMP Environment Variables

2.2.1 Common OpenMP Environment Variables

2.2.2 Solaris Studio Specific Environment Variables

2.3 Processor Binding

2.3.1 Virtual Processor IDs

2.3.2 Logical IDs

2.3.3 Interpreting the Value Specified for SUNW_MP_PROCBIND

2.3.4 Interaction with OS Processor Sets

2.4 Stacks and Stack Sizes

2.5 Checking and Analyzing 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

Index

2.1 Compiler Options To Use

To enable explicit parallelization with OpenMP directives, compile your program with the cc, CC, or f95 option flag -xopenmp. (The f95 compiler accepts both -xopenmp and -openmp as synonyms.)

The -xopenmp flag accepts the following keyword sub-options.

-xopenmp=parallel
Enables recognition of OpenMP pragmas.

The minimum optimization level for -xopenmp=parallel is -xO3.

The compiler changes the optimization from a lower level to -xO3 if necessary, and issues a warning.

-xopenmp=noopt
Enables recognition of OpenMP pragmas.

The compiler does not raise the optimization level if it is lower than -xO3.

If you explicitly set the optimization level lower than -xO3, as in -xO2 -openmp=noopt the compiler will issue an error.

If you do not specify an optimization level with -openmp=noopt, the OpenMP pragmas are recognized, the program is parallelized accordingly, but no optimization is done.

-xopenmp=stubs
This option is no longer supported.

An OpenMP stubs library is provided for users’ convenience.

To compile an OpenMP program that calls OpenMP library routines but ignores the OpenMP pragmas, compile the program without an -xopenmp option, and link the object files with the libompstubs.a library.

For example, % cc omp_ignore.c -lompstubs

Linking with both libompstubs.a and the OpenMP runtime library libmtsk.so is unsupported and may result in unexpected behavior.

-xopenmp=none
Disables recognition of OpenMP pragmas and does not change the optimization level.

Additional Notes: