Sun Studio 12: C User's Guide

3.2 Parallelizing for OpenMP

You can compile your code so that it complies with the OpenMP specification. For more information on the OpenMP specification for C, visit the web site at

To take advantage of the compiler’s OpenMP support, you need to issue the compiler’s -xopenmp option. See B.2.118 -xopenmp[=i].

See the OpenMP API User’s Guide for migration information to the directives of the standard.

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 call back 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 and the warning messages are sent to stderr. For more information on SUNW_MP_WARN, see SUNW_MP_WARN.

For information specific to this implementation of OpenMP, see the OpenMP API User’s Guide.