Optimizing your SMP code

Most IBM processors are capable of shared-memory parallel processing. Compile with -qsmp to generate the threaded code needed to exploit this capability. The option implies a -O2 optimization level. The default behavior for the option without suboptions is to do automatic parallelization with optimization.

The most commonly used -qsmp suboptions are summarized in the following table.

Commonly used -qsmp suboptions
Suboption Behavior
auto Instructs the compiler to automatically generate parallel code where possible without user assistance. This option also recognizes all the SMP directives.
omp Enforces compliance with the OpenMP API for specifying explicit parallelism.
opt Instructs the compiler to optimize as well as parallelize. The optimization is equivalent to -O2 –qhot in the absence of other optimization options. The default setting of -qsmp is -qsmp=auto:noomp:opt.
suboptions Other values for the suboption provide control over thread scheduling, nested parallelism, locking, and so on.

Certain thread environment variables like MALLOCMULTIHEAP, SPINLOOPTIME, or YIELDLOOPTIME may improve application performance as well. For more information, see the information in the AIX® Information Center at http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp.

See the following topic for further information:



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