HP MLIB User's Guide Vol. 2 7th Ed.
644 HP MLIB User’s Guide
Parallel processing
The following command lines show the C shell syntax and Korn shell syntax
to use when setting the variable to eight processors:
For C shell:
setenv MLIB_NUMBER_OF_THREADS 8
For Korn shell:
export MLIB_NUMBER_OF_THREADS=8
MLIB_NUMBER_OF_THREADS is examined upon the first call to a
parallelized LAPACK subprogram to establish the default parallel action
within LAPACK.
Use MLIB_SETNUMTHREADS to restore LAPACK parallel processing to
its run-time default that was specified by MLIB_NUMBER_OF_THREADS.
Refer to the mlib_setnumthreads(3m) man page for usage information.
• Use the subroutine MLIB_SETNUMTHREADS.
You can call this subroutine at any time to set the maximum number of
parallel threads used in subsequent VECLIB or LAPACK calls. The
specified value overrides the absence of the
MLIB_NUMBER_OF_THREADS environment variable or any value
assigned to it.
• To modify the effect of the MLIB_NUMBER_OF_THREADS and
MLIB_SETNUMTHREADS, you can also use
MP_NUMBER_OF_THREADS at runtime. When
MP_NUMBER_OF_THREADS is set to a value smaller than
MLIB_NUMBER_OF_THREADS and MLIB_SETNUMTHREADS, the
value of MP_NUMBER_OF_THREADS takes precedence and limits the
amount of parallelism to MP_NUMBER_OF_THREADS.
These controls set the maximum amount of parallelism that your program can
use, and the LAPACK-specific mechanisms offer finer control within that
maximum. Refer to “Performance benefits” on page 644 for more information.
Performance benefits
If LAPACK parallelism is enabled, each parallelized LAPACK subprogram
determines at runtime whether multiple processors are available. If so, it
detects whether the program is already using multiple threads. It uses this
information to choose automatically between a single- or parallel-processor
algorithm.
If you are using an HP server with multiple processors, you can realize the
performance benefits of parallel processing in three ways: