1. Introduction to the C Compiler
2. C-Compiler Implementation-Specific Information
3.2.1 Handling OpenMP Runtime Warnings
3.3.1 PARALLEL or OMP_NUM_THREADS
3.3.5 Using restrict in Parallel Code
3.4 Data Dependence and Interference
3.4.1 Parallel Execution Model
3.4.2 Private Scalars and Private Arrays
3.6 Load Balance and Loop Scheduling
3.6.1 Static or Chunk Scheduling
3.8 Aliasing and Parallelization
3.8.1 Array and Pointer References
3.8.3 Explicit Parallelization and Pragmas
Default Scoping Rules for private and shared Variables
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
E. Implementation-Defined ISO/IEC C90 Behavior
H. The Differences Between K&R Solaris Studio C and Solaris Studio ISO C
The C compiler generates parallel code for those loops that it determines are safe to parallelize. Typically, these loops have iterations that are independent of each other. For such loops, it does not matter in what order the iterations are executed or if they are executed in parallel. Many, though not all, vector loops fall into this category.
Because of the way aliasing works in C, it is difficult to determine the safety of parallelization. To help the compiler, Solaris Studio C offers pragmas and additional pointer qualifications to provide aliasing information known to the programmer that the compiler cannot determine. See Chapter 5, Type-Based Alias Analysis for more information.
The following example illustrates how to enable and control parallelized C:
% cc -fast -xO4 -xautopar example.c -o example
This generates an executable called example, which can be executed normally. If you wish to take advantage of multiprocessor execution, see B.2.75 -xautopar.