PARDISO of Intel oneMKL (structsolve.pardiso)#

Interface to the sparse direct solver PARDISO of Intel oneMKL

Used by Analysis.linear_solver = 'pardiso', see static._factorize(). The shared library mkl_rt of oneMKL is given by the environment variable STRUCTSOLVE_MKL_RT, otherwise found by ctypes.util.find_library() or under sys.prefix or the user site, as installed by pip install mkl (the optional dependency structsolve[pardiso]) or by conda.

PardisoSolver calls the phases of PARDISO separately, in particular the phase 22, a numerical factorization that reuses the analysis (ordering and symbolic factorization) of the last phase 12 for a matrix of the same pattern.

structsolve.pardiso.MKL_RT_ENV = 'STRUCTSOLVE_MKL_RT'#

Environment variable with the path of the shared library mkl_rt

exception structsolve.pardiso.PardisoError(phase, error)#

Error code of PARDISO, error not 0

class structsolve.pardiso.PardisoSolver(mtype=-2)#

PARDISO solver of one real matrix, by default symmetric indefinite (mtype = -2), given by its upper triangle in CSR format with every diagonal term stored

iparm is the array of the parameters of PARDISO, indexed from 0, i.e. iparm[i - 1] is iparm(i) of the manual of oneMKL: all zeros, the default parameters, which PARDISO fills, or set by the user with iparm[0] = 1. After a factorization, iparm[13] is the number of perturbed pivots and iparm[21] and iparm[22] the numbers of positive and negative eigenvalues (mtype = -2).

The matrix of the last factorization is kept, not copied, for the iterative refinement of solve(), and must not be changed.

property analyzed#

Whether the solver holds an analysis, for the phase 22

factorize(A, phase=12)#

Factorization of the CSR matrix A, float64, with the phase 12 (analysis and numerical factorization) or 22 (numerical factorization with the analysis of the last phase 12, A having its pattern)

free(everything=False)#

Frees the memory of the factorization (phase 0), keeping the analysis for the phase 22, or all the memory of PARDISO (phase -1)

solve(b)#

Solution of the last factorization (phase 33), b of shape (n,) or (n, nrhs)

structsolve.pardiso.available()#

Whether PARDISO can be used, i.e. mkl_rt is found

structsolve.pardiso.load_mkl()#

The function pardiso of the shared library mkl_rt, loaded once; raises ImportError when it is not found