Using shared-memory parallelism (SMP)

Most IBM® pSeries machines are capable of shared-memory parallel processing. You can compile with -qsmp to generate the threaded code needed to exploit this capability. The -qsmp option implies the -qhot option and an optimization level of -O2 or higher.

The following table lists the most commonly used suboptions. Descriptions and syntax of all the suboptions are provided in -qsmp in the XL C/C++ Compiler Reference. An overview of automatic parallelization, as well as of IBM SMP and OpenMP directives is provided in Parallelizing your programs.

Table 1. Commonly used -qsmp suboptions
suboption Behavior
auto Instructs the compiler to automatically generate parallel code where possible without user assistance. Any SMP programming constructs in the source code, including IBM SMP and OpenMP directives, are also recognized. This is the default setting if you do not specify any -qsmp suboptions, and it also implies the opt suboption.
omp Instructs the compiler to enforce strict conformance to the OpenMP API for specifying explicit parallelism. Only language constructs that conform to the OpenMP standard are recognized. Note that -qsmp=omp is incompatible with -qsmp=auto.
opt Instructs the compiler to optimize as well as parallelize. The optimization is equivalent to -O2 -qhot in the absence of other optimization options.
noopt All optimization is turned off. During development, it can be useful to turn off optimization to facilitate debugging.
fine_tuning Other values for the suboption provide control over thread scheduling, locking, and so on.


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us