HP MLIB User's Guide Vol. 2 7th Ed.
Chapter 8 Introduction to LAPACK 643
Parallel processing
Parallel processing
Parallel processing is available on multi-processor HP platforms running the
HP-UX version 11i or greater operating system. These systems can divide a
single computational process into small streams of execution, called threads.
The result is that you can have more than one processor executing on behalf of
the same process. Also, refer to Appendix C, “Parallelized Subprograms,” for a
list of HP LAPACK parallelized subprograms.
You can enable or disable parallel processing at link time or at runtime. A
program does not use parallelism in LAPACK unless parallel processing is
enabled both at link time and at runtime.
Linking for parallel or nonparallel processing
To enable parallel processing at link time, your link step must produce a
multithreaded executable. You always get a multithreaded executable if you
link with the Fortran 77, Fortran 90, or C compiler using the +O3 and
+Oparallel flags:
f90 [options including +O3 +Oparallel] file... –Wl,–aarchive_shared −llapack
cc
[options including +O3 +Oparallel] file... –Wl,–aarchive_shared −llapack −lcl
−lm
To disable LAPACK’s automatic parallelism at link time, omit the +Oparallel
option:
f90 [options] file ... –Wl,–aarchive_shared −llapack
cc
[options] file ... –Wl,–aarchive_shared −llapack −lcl −lm
Controlling LAPACK parallelism at runtime
When you enable parallelism at link time, three methods are available at
runtime to specify the extent of parallel processing to be allowed in MLIB.
• Use MLIB_NUMBER_OF_THREADS, a shell environment variable which
allows you to enable parallelism within MLIB subprograms and to specify
the maximum number of threads that may be used in parallel regions.
Not setting MLIB_NUMBER_OF_THREADS has the same result as setting
it to 1; that is, parallel processing is disabled within MLIB subroutines.
Setting MLIB_NUMBER_OF_THREADS to the number of CPUs in the
system, or greater, allows parallelized MLIB subprograms to use as many
CPUs as are available to the process.