JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Studio 12.3: C User's Guide     Oracle Solaris Studio 12.3 Information Library
search filter icon
search icon

Document Information


1.  Introduction to the C Compiler

2.  C-Compiler Implementation-Specific Information

3.  Parallelizing C Code

3.1 Overview of Parallelization

3.2 Parallelizing for OpenMP

3.2.1 Handling OpenMP Runtime Warnings

3.2.2 Environment Variables

3.2.3 Using restrict in Parallel Code

3.3 Data Dependence and Interference

3.3.1 Parallel Execution Model

3.3.2 Private Scalars and Private Arrays

3.3.3 Storeback

3.3.4 Reduction Variables

3.4 Speedups

3.4.1 Amdahl's Law Overheads Gustafson's Law

3.5 Load Balance and Loop Scheduling

3.5.1 Static or Chunk Scheduling

3.5.2 Self-Scheduling

3.5.3 Guided Self-Scheduling

3.6 Loop Transformations

3.6.1 Loop Distribution

3.6.2 Loop Fusion

3.6.3 Loop Interchange

3.7 Aliasing and Parallelization

3.7.1 Array and Pointer References

3.7.2 Restricted Pointers

3.8 Memory-Barrier Intrinsics

4.  lint Source Code Checker

5.  Type-Based Alias Analysis

6.  Transitioning to ISO C

7.  Converting Applications for a 64-Bit Environment

8.  cscope: Interactively Examining a C Program

A.  Compiler Options Grouped by Functionality

B.  C Compiler Options Reference

C.  Implementation-Defined ISO/IEC C99 Behavior

D.  Features of C99

E.  Implementation-Defined ISO/IEC C90 Behavior

F.  ISO C Data Representations

G.  Performance Tuning

H.  Oracle Solaris Studio C: Differences Between K&R C and ISO C


3.2 Parallelizing for OpenMP

The C compiler accepts the OpenMP API for shared memory parallelization natively. The API consists of a set of parallelization pragmas. Information on the OpenMP API specification is at the OpenMP web site at

To enable the compiler’s OpenMP support and recognition of the OpenMP pragmas, compile with the -xopenmp option. Without -xopenmp, the compiler treats the OpenMP pragmas as comments. See B.2.131 -xopenmp[=i].

See the Oracle Solaris Studio OpenMP API User’s Guide for details.

3.2.1 Handling OpenMP Runtime Warnings

The OpenMP runtime system can issue warnings for non-fatal errors. Use the following function to register a callback function to handle these warnings:

int sunw_mp_register_warn(void (*func) (void *) )

You can access the prototype for this function by issuing a #include preprocessor directive for <sunw_mp_misc.h>.

If you do not want to register a function, set the environment variable SUNW_MP_WARN to TRUE to send warning messages to stderr.

For information specific to this implementation of OpenMP, including pragmas, environment variables and runtime functions related to OpenMP, see the Oracle Solaris Studio OpenMP API User’s Guide.

3.2.2 Environment Variables

Some environment variables related to parallelized C are the following. There are additional environment variables defined by the OpenMP API specifications and others that are specific to the Oracle Solaris Studio implementation. See the Oracle Solaris Studio OpenMP API User's Guide for descriptions of all parallelization related environment variables.

3.2.3 Using restrict in Parallel Code

The keyword restrict can be used with parallelized C. The proper use of the keyword restrict helps the optimizer in evaluating the aliasing of data required to determine whether a code sequence can be parallelized. Refer to D.1.2 C99 Keywords for details.