HP MLIB User's Guide Vol. 2 7th Ed.

Chapter 7 Miscellaneous Routines 607
Determine permitted extent of parallelism MLIB_GETNUMTHREADS
Name MLIB_GETNUMTHREADS
Determine permitted extent of parallelism
Purpose This subprogram is used by all parallelized MLIB subprograms to determine
the extent to which they may use shared-memory parallelism.
If companion subroutine MLIB_SETNUMTHREADS has not been called, or if
it was last called with value zero as its argument, MLIB_GETNUMTHREADS
uses the environment variable MLIB_NUMBER_OF_THREADS to determine
the maximum number of threads that are allowed to execute parallelized MLIB
subprograms called by the application. If MLIB_NUMBER_OF_THREADS is
not set, only one thread is allowed; that is, MLIB subprograms are not run with
parallelism.
If MLIB_SETNMTHREADS has been called and the argument for its last call
was nonzero, MLIB_GETNUMTHREADS ignores
MLIB_NUMBER_OF_THREADS and bases its return value on the last
MLIB_SETNUMTHREADS call.
Usage VECLIB. LAPACK, SCALAPACK:
INTEGER*4 MLIB_GETNUMTHREADS, nthread
nthread = MLIB_GETNUMTHREADS()
VECLIB8, LAPACK8, SCALAPACK8:
INTEGER*8 MLIB_GETNUMTHREADS, nthread
nthread = MLIB_GETNUMTHREADS()
Output nthread
The maximum number of threads that can be used at
this time. nthread = 1 if any of the following apply:
The machine has only one CPU
The operating system or version of MLIB does
not support thread-based parallelism
The program is running on a single CPU
The executable file is not marked for parallel
execution
The default maximum number of threads is one
The program currently is multi-threaded