SMP | NOSMP

Category

Optimization and tuning

Pragma equivalent

None.

Purpose

Enables parallelization of program code.

Syntax

Read syntax diagramSkip visual syntax diagramNOSMPSMP(,EXPLICITNOEXPLICITOPTNOOPT)

Defaults

NOSMP. Code is produced for a uniprocessor machine.

Parameters

EXPLICIT | NOEXPLICIT
Enables or disables directives controlling explicit parallelization of loops.
OPT | NOOPT
Enables or disables optimization of parallelized program code. When SMP(NOOPT) is in effect, the compiler will do the smallest amount of optimization that is required to parallelize the code. This is useful for debugging because SMP enables the OPTIMIZE(2) and HOT options by default, which might result in the movement of some variables into registers that are inaccessible to the debugger.

Specifying SMP without suboptions is equivalent to specifying SMP(EXPLICIT, OPT).

Usage

When SMP is in effect, program code with OpenMP directives, compliant to the OpenMP API 3.1 standard, is explicitly parallelized.

Object files generated with the SMP(OPT) option can be linked with object files generated with the SMP(NOOPT) option. The visibility within the debugger of the variables in each object file will not be affected by linking.

Specifying the SMP option implicitly sets OPTIMIZE(2). The SMP option overrides NOOPTIMIZE, but does not override OPTIMIZE(3). When debugging parallelized program code, you can disable optimization in parallelized program code by specifying SMP(NOOPT).

The SMP(NOOPT) suboption overrides performance optimization options anywhere on the command line unless SMP appears after SMP(NOOPT). For example, specifying SMP(NOOPT) with OPTIMIZE(3) is equivalent to specifying SMP(NOOPT), while specifying SMP(NOOPT) with OPTIMIZE(3) and SMP is equivalent to specifying SMP and OPTIMIZE(3).

Specifying the NOOPTIMIZE option with SMP(OPT) implies SMP(NOOPT).

The SMP option is supported only when the LP64 option is specified, and it must not be specified with the METAL option. The executable that is generated by specifying the SMP option is supported only under z/OS® UNIX System Services. The thread-safe version of system library routines should be used inside the parallel regions.

The usage status of this option is inserted in the object file to aid you in diagnosing a problem with your program.

Predefined macros

None.

Related information

For more information about related compiler options, see:

For a detailed description of the OpenMP directives, see Pragma directives for parallel processing in z/OS XL C/C++ Language Reference.

For information about the OpenMP runtime functions for parallel processing, see OpenMP runtime functions for parallel processing in z/OS XL C/C++ Programming Guide.

For information about optimizing your application by parallelization, see Parallelizing your programs in z/OS XL C/C++ Programming Guide.

For information about setting environment variables for OpenMP, see Environment variables for OpenMP.