smp (C Only)

Option Type Default Value #pragma options C C++
-qoption nosmp - x  

Syntax

    -qnosmp | -qsmp[=suboption[:suboption] [ ... ]]

Purpose
Specifies if and how parallelized object code is generated, according to suboption(s) specified:

Suboption Description

auto
noauto
Enables or disables automatic parallelization.

auto is the default if -qsmp is specified without the omp suboption. Otherwise, the default is noauto.

explicit
noexplicit
Enables or disables pragmas controlling explicit parallelization of countable loops.

explicit is the default.

If noexplicit is in effect, #pragma ibm omp parallel_loop is not honored by the compiler.

nested_par
nonested_par
Enables or disables parallelization of nested parallel constructs.

nonested_par is the default. If one parallel construct is run as part of another parallel construct, the execution of the nested construct is serialized by the compiler for better performance.

If nested_par is in effect, nested parallel constructs are not serialized.

Notes:
  1. nested_par does not provide true nested parallelism because it does not cause new team of threads to be created for nested parallel regions. Instead, threads that are currently available are re-used.
  2. This option should be used with caution. Depending on the number of threads available and the amount of work in an outer loop, inner loops could be executed sequentially even if this option is in effect. Parallelization overhead may not necessarily be offset by program performance gains.
omp
noomp
Enables or disables strict compliance with OpenMP C and C++ API specifications.

noomp is the default. This mode allows for maximum program parallelization, but may not be completely compliant to the OpenMP API specification.

If you specify the omp suboption, the compiler disables automatic parallelization and warns of directives that are not OpenMP-compliant. The _OPENMP macro is defined.

Certain other smp suboptions enable compiler parallelization features that do not comply with the OpenMP specification. If they are specified together with the omp suboption, a warning message issued. These suboptions are:

  • auto
  • nested_par
  • rec_locks
  • schedule=affinity=n
rec_locks
norec_locks
Specifies whether recursive locks are used to implement critical sections.

If rec_locks is in effect, recursive locks are used, and nested critical sections will not cause a deadlock.

The default is norec_locks, or regular locks.

schedule=sched_type[=n]
Specifies what kind of scheduling algorithms and chunking are used for loops to which no other scheduling algorithm has been explicitly assigned in the source code.

Valid options for sched_type are:

  • dynamic[=n]
  • guided[=n]
  • static[=n]
  • affinity[=n]
  • runtime

If sched_type is not specified, runtime is assumed as the default setting.

For more information about these scheduling algorithms, see schedule pragma.

Notes



Program Parallelization


Control Parallel Processing with Pragmas


List of Batch Compiler Options and Their Defaults
Options that Define the Compiler Object Code Produced
#pragma Preprocessor Directives for Parallel Processing
Run-time Options for Parallel Processing
Built-in Functions Used for Parallel Processing
-O Optimize Option
-qthreaded Option
Equivalent Batch Compile-Link and Incremental Build Options