Parallel processing
You can enable or disable parallel processing at link time or at runtime. A program does not use parallelism in VECLIB unless parallel processing is enabled at both link time and at runtime.
Linking for parallel or non parallel processing
To enable parallel processing at link time, your link step must produce a multithreaded executable. On
f90 [options including +O3 +Oparallel] file ...
cc[options including +O3 +Oopenmp] file ...
aCC [options including +Oopenmp] file ...
To disable VECLIB’s automatic parallelism at link time, omit the +Oparallel and +Oopenmp options:
f90 [options] file ...
cc[options] file ...
VECLIB for Linux is always multithreaded enabled.
Controlling VECLIB parallelism at runtime
When you enable parallelism at link time, three methods are available at runtime to specify the extent of parallel processing in MLIB.
•Use MLIB_NUMBER_OF_THREADS, a shell environment variable that allows you to enable parallelism within MLIB subprograms and to specify the maximum number of threads that can 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.
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
18HP MLIB User’s Guide