LAPACK
Description
LAPACK is a public domain library of subroutines for solving dense linear algebra problems, including the following:
Systems of linear equations
Linear least squares problems
Eigenvalue problems
Singular value decomposition (SVD) problems
LAPACK is the successor to the older LINPACK and EISPACK packages. It extends the functionality of these packages by including equilibration, iterative refinement, error bounds, and driver routines for linear systems, routines for computing and reordering the Schur factorization, and condition estimation routines for eigenvalue problems.
Performance issues are addressed by implementing the most computationally‐intensive algorithms by using the Level 2 and 3 Basic Linear Algebra Subprograms (BLAS).
The LAPACK Fortran programs are described in the LAPACK User’s Guide, which is available at http://www.netlib.org/lapack/lug/.
LAPACK Routines Contained in LibSci
The routines from LAPACK 3.10.1 are contained in LibSci.
Tuning parameters for the block algorithms that are provided in LibSci
are set within the LAPACK routine ILAENV
. ILAENV
is an integer
function subprogram that accepts information about the problem type
and dimensions, and it returns one integer parameter, such as the
optimal block size, the minimum block size for which a block algorithm
should be used, or the crossover point (the problem size at which it
becomes more efficient to switch to an unblocked algorithm). The
setting of tuning parameters occurs without user intervention, but
users may call ILAENV
directly to discover the values that will be
used (for example, to determine how much workspace to provide).
Naming Scheme
The name of each LAPACK routine is a coded specification of its
function. All driver and computational routines have five‐ or six‐
character names of the form xyyzz
or xyyzzz
.
The first letter in each name, x
, indicates the data type, as follows:
S: REAL (single precision)
C: COMPLEX
D: DOUBLE PRECISION
Z: COMPLEX*16
The next two letters, yy
, indicate the type of matrix (or the most‐
significant matrix). Most of these two‐letter codes apply to both real
and complex matrices, but a few apply specifically to only one or the
other. The matrix types are as follows:
BD BiDiagonal
GB General Band
GE GEneral (nonsymmetric)
GG General matrices, Generalized problem
GT General Tridiagonal
HB Hermitian Band (complex only)
HE Hermitian (possibly indefinite) (complex only)
HG Hessenberg matrix, Generalized problem
HP Hermitian Packed (possibly indefinite) (complex only)
HS upper HeSsenberg
OP Orthogonal Packed (real only)
OR ORthogonal (real only)
PB Positive definite Band (symmetric or Hermitian)
PO POsitive definite (symmetric or Hermitian)
PP Positive definite Packed (symmetric or Hermitian)
PT Positive definite Tridiagonal (symmetric or Hermitian)
SB Symmetric Band (real only)
SP Symmetric Packed (possibly indefinite)
ST Symmetric Tridiagonal
SY SYmmetric (possibly indefinite)
TB Triangular Band
TG Triangular matrices, Generalized problem
TP Triangular Packed
TR TRiangular
TZ TrapeZoidal
UN UNitary (complex only)
UP Unitary Packed (complex only)
The LAPACK auxiliary routines use the special yy designation:
LA LAPACK Auxiliary routine
For example, ILAENV
is the auxiliary routine that determines the
block size for a particular algorithm and problem size.
The last two or three letters, zz
or zzz
, indicate the computation
performed. For example, SGETRF
performs a TRiangular Factorization of
a Single‐precision (real) GEneral matrix; CGETRF
performs the
factorization of a Complex GEneral matrix.
User‐selectable 3M Complex Matrix Multiply
Additionally, the LAPACK solver routines ZPOSV
, CPOSV
, ZGESV
, and
CGESV
, and the LAPACK factorization routines ZPOTRF
, CPOTRF
, ZGETRF
,
and CGETRF
, have been adapted so that the underlying complex matrix
multiply routine called internally within those routines can be user‐
selected to be either the standard complex matrix multiply or the 3M
algorithmic variant of complex matrix multiply.
To use the 3M algorithm, append 3M to the name of the subroutine. For
example, to use the 3M variant of ZPOSV
instead of the standard
routine, call ZPOSV3M
instead of ZPOSV
.
Alternatively, to use the 3M variant without changing source code, set
the environment variable LIBSCI_USE_3M
at run time.
Note: Use care when using the 3M algorithms, as the resulting numerical stability of the computation may be affected.
Environment Variables
LIBSCI_USE_3M
If set, LAPACK routines use the 3M algorithmic variant of
complex matrix multiply instead of the standard complex
matrix multiply, if 3M variant routines are available.
Default: not set
LIBSCI_QR_TBLOCKING
By default, the threaded LibSci real precision LAPACK GEQRF
routines set block size at run time based on the OpenMP
threads available, in order to improve performance. To
disable this optimization, set LIBSCI_QR_TBLOCKING to FALSE.
Default: not set (enabled)
LIBSCI_OPT_DGESVD
If set, replaces the standard dgesvd qr algorithm with an
alternate algorithm for the JOBU=A and JOBVT=A case that may
be more optimal. Allocates and frees its own temporary
scratch workspaces for the alternate algorithm without user
intervention.
Default: not set
LIBSCI_OPT_DLARTG
If set, LAPACK routines use an optimized (but less
numerically robust) version of the LAPACK DLARTG auxiliary
routine, which can lead to improved performance with
spectral decomposition routines that call DLARTG to
calculate vector rotations.
Default: not set
LIBSCI_OPT_DSYEV
If set, LAPACK routines replace the default dsyev algorithm
(real symmetric eigensolver) with a divide‐and‐conquer
algorithm for optimized performance for the case where both
eigenvectors and eigenvalues are calculated. This
optimization temporarily sets some additional memory scratch
space internally. It does not require users to change their
existing dsyev calls.
Default: not set
LIBSCI_OPT_ZHEEV
If set, LAPACK routines replace the default zheev algorithm
(complex Hermitian eigensolver) with a divide‐and‐conquer
algorithm for optimized performance for the case where both
eigenvectors and eigenvalues are calculated. This
optimization temporarily sets some additional memory scratch
space internally. It does not require users to change their
existing zheev calls.
LIBSCI_OPT_ZUNMQX
If set, LAPACK ZUNMQR and ZUNMQL create additional temporary
workspaces for these routines to function optimally. If not
set, these additional temporary workspaces are not created.
Default: not set