Skip Navigation Links | |
Exit Print View | |
![]() |
Oracle Solaris Studio 12.3: C User's Guide Oracle Solaris Studio 12.3 Information Library |
1. Introduction to the C Compiler
2. C-Compiler Implementation-Specific Information
3.2.1 Handling OpenMP Runtime Warnings
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.5 Load Balance and Loop Scheduling
3.5.1 Static or Chunk Scheduling
3.7 Aliasing and Parallelization
3.7.1 Array and Pointer References
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. Oracle Solaris Studio C: Differences Between K&R C and 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, the order in which iterations are executed or if they are executed in parallel, does not matter. Many, though not all, vector loops fall into this category.
Because of the way aliasing works in C, determining the safety of parallelization is difficult. 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 compiler command generates an executable called example, which can be executed normally. To find out how to take advantage of multiprocessor execution, see B.2.80 -xautopar.