Sun Studio 12: C User's Guide

B.2.123 -xparallel

(SPARC) Obsolete, do not use. Use -xopenmp instead.


Note –

-xparallel does not accept OpenMP parallelization directives. However, the Sun-specific MP pragmas have been deprecated and are no longer supported. The OpenMP API is the preferred and supported parallelization model. See the Sun Studio 12: OpenMP API User’s Guide for migration information to the directives of the standard.


Parallelizes loops both automatically by the compiler and explicitly specified by the programmer. The -xparallel option is a macro, and is equivalent to specifying all three of -xautopar, -xdepend, and -xexplicitpar. With explicit parallelization of loops, there is a risk of producing incorrect results. If optimization is not at -xO3 or higher, optimization is raised to -xO3 and a warning is issued.

Avoid -xparallel if you do your own thread management. Do not use -xparallel if you are issuing -xopenmp. -xparallel sets -xexplicitpar which should not be used if you specify -xopenmp.

To get faster code, this option requires a multiprocessor system. On a single-processor system, the generated code usually runs slower.

If you compile and link in one step, -xparallel links with the microtasking library and the threads-safe C runtime library. If you compile and link in separate steps, and you compile with -xparallel, then link with -xparallel. For a complete list of all compiler options that must be specified at both compile time and at link time, see Table A–2.