API
MUMPS.MUMPS
— Modulemodule MUMPS
Both low-level interface with MUMPS 5.6.2 parallel direct solver C-library as well as convenient wrappers for some common uses for MUMPS.
The central work is done by the Mumps
struct, which mirrors the internal structure used in MUMPS. Manipulations can be done directly on this object and then passed to Mumps via the function invoke_mumps!
This mode of operation gives the user complete control as described in the MUMPS manual, though it exposes unsafe operations, so beware.
More convenient are the use of the functions mumps_solve
, mumps_factorize
, mumps_det
, mumps_schur_complement
, and mumps_select_inv
, which all have mutating counterparts (such as mumps_solve!
). These can take matrices and right hand sides directly, so, for example, the equation A*x=y
, solved in Base by x=A\y
or LinearAlbegra.ldiv!(x,A,y)
, can be solved with MUMPS as x=mumps_solve(A,y)
, or mumps_solve!(x,A,y)
.
The package also extends Base.det, Base.\, LinearAlgebra.ldiv! and LinearAlgebra.inv to work with mumps objects.
Note, unless working with the low-level interace, we discourage setting the JOB
parameter manually, as this can lead to unsafe operation.
The goal is to give the advanced user low-level access to MUMPS, while simultaneously giving the ordinary user safe functions that grant access to most of what MUMPS has to offer.
MUMPS.default_cntl32
— ConstantDefault single precision real parameters
MUMPS.default_cntl64
— ConstantDefault double precision real parameters
MUMPS.default_icntl
— ConstantDefault integer parameters.
MUMPS.mumps_definite
— Constantconst mumps_definite
Constant indicating that a symmetric definite matrix will be analyzed and factorized
MUMPS.mumps_symmetric
— Constantconst mumps_symmetric
Constant indicating that a general symmetric matrix will be analyzed and factorized
MUMPS.mumps_unsymmetric
— Constantconst mumps_unsymmetric
Constant indicating that a general unsymmetric matrix will be analyzed and factorized
MUMPS.MUMPSException
— Typemutable struct MUMPSException
Exception type raised in case of error.
MUMPS.Mumps
— TypeMirror of structre in [sdcz]mumps_c.h
.
Base.finalize
— Methodfinalize(mumps)
Terminate a Mumps instance.
MUMPS.associate_matrix!
— Methodassociate_matrix!(mumps, n, irow, jcol, vals)
Register the sparse matrix given in coordinate format with the Mumps
object mumps
. This function makes it possible to define the matrix on the host only. If the matrix is defined on all nodes, there is no need to use this function.
MUMPS.associate_matrix!
— Methodassociate_matrix!(mumps,A)
Register the square matrix A
to a mumps
object. It internally converts A
to be consistent with the ICNTL[5] setting.
If needed, it tries to convert element type of A
to be consistent with type of mumps
, throwing a warning in this case.
See also: associate_rhs!
MUMPS.associate_rhs!
— Methodassociate_rhs!(mumps, rhs)
Register a dense or sparse RHS matrix or vector rhs
to a mumps
object. It internally converts rhs
to be consistent with the ICNTL[20] setting, and additionally allocates mumps.rhs
according to the ICNTL[21] setting.
If needed, it tries to convert element type of rhs
to be consistent with type of mumps
, throwing a warning in this case.
See also: associate_matrix!
MUMPS.default_icntl!
— Methoddefault_icntl!(mumps)
reset ICNTL to its default
MUMPS.display_cntl
— FunctionMUMPS.display_icntl
— Functiondisplay_icntl(mumps)
Show the complete ICNTL integer array of mumps
, with descriptions
See also: set_icntl!
MUMPS.factorize!
— Methodfactorize!(mumps,A)
Combined associate_matrix / factorize. Presume that A
is available on all nodes.
MUMPS.factorize!
— Methodfactorize!(mumps)
Factorize the matrix registered with the Mumps
instance. The matrix must have been previously registered with associate_matrix()
. After the factorization, the determinant, if requested, is stored in mumps.det
. The MUMPS error code is stored in mumps.err
.
MUMPS.finalize!
— MethodMUMPS.get_icntl
— Methodget_icntl(;det=false,verbose=false,ooc=false,itref=0)
Obtain an array of integer control parameters.
MUMPS.get_rhs!
— Methodget_rhs!(x,mumps)
Retrieve right hand side from mumps
, storing it in pre-allocated x
MUMPS.get_rhs
— MethodMUMPS.get_schur_complement!
— Methodget_schur_complement!(S,mumps)
Retrieve Schur complement matrix from mumps
into pre-allocated S
See also: get_schur_complement
, mumps_schur_complement!
, mumps_schur_complement
MUMPS.get_schur_complement
— Methodget_schur_complement(mumps) -> S
Retrieve Schur complement matrix S
from mumps
See also: get_schur_complement!
, mumps_schur_complement!
, mumps_schur_complement
MUMPS.get_sol!
— Methodget_sol!(x,mumps)
Retrieve solution x
from mumps
into pre-allocated array.
MUMPS.get_sol
— MethodMUMPS.get_solution
— Functionget_solution(mumps) -> x
Retrieve the solution of the system solved by solve()
. This function makes it possible to ask MUMPS to assemble the final solution on the host only, and to retrieve it there.
MUMPS.initialize!
— MethodMUMPS.invoke_mumps!
— Methodinvoke_mumps!(mumps)
Call the appropriate mumps C-library, passing to it the Mumps object mumps
, but checking to make sure mumps
has been initialized first, so that it's safe.
This is a low-level function, meaning that you have complete control over what operations are done, based on the MUMPS manual.
Be warned, a direct call can crash Julia if mumps
is not appropriately initialized.
See also: invoke_mumps_unsafe!
MUMPS.invoke_mumps_unsafe!
— Functioninvoke_mumps_unsafe!(mumps)
Call the appropriate mumps C-library, passing to it the Mumps object mumps
.
This is a low-level function, meaning that you have complete control over what operations are done, based on the MUMPS manual.
Be warned, a direct call can crash Julia if mumps
is not appropriately initialized.
See also: invoke_mumps!
MUMPS.mumps_det!
— Methodmumps_det!(mumps; discard=true)
Compute determinant of A
, which has been previously provided to mumps
.
Determinant can be computed from mutated mumps
by just det(mumps)
[must have loaded LinearAlgebra].
Optional keyward discard
controls whether LU factors are discarded via ICNTL[31]. This is useful if you only care about the determinant and don't want to do any further computation with mumps
. Use discard=2
to throw away only L.
See also: mumps_det
MUMPS.mumps_det
— MethodMUMPS.mumps_factorize!
— Methodmumps_factorize!(mumps)
LU factorize A
previously provided to mump
. LU stored in mumps
, but not in a particularly accessible way. Useful for doing repeated solves downstream.
See also: mumps_factorize
MUMPS.mumps_factorize
— Methodmumps_factorize(A) -> mumps
LU factorize A
. LU stored in mumps
, but not in a particularly accessible way. Useful for doing repeated solves downstream.
See also: mumps_factorize!
MUMPS.mumps_schur_complement!
— Functionmumps_schur_complement!(mumps, schur_inds)
mumps_schur_complement!(mumps, x)
schur_inds
is integer array of Schur indices. If x
is sparse, Schur indices determined from populated rows of x
See also: mumps_schur_complement
, get_schur_complement!
, get_schur_complement
MUMPS.mumps_schur_complement
— Methodmumps_schur_complement(A,schur_inds) -> S
mumps_schur_complement(A,x) -> S
schur_inds
is integer array x
is sparse, populated rows are Schur indices S
is Schur complement matrix.
See also: mumps_schur_complement!
MUMPS.mumps_select_inv
— Functionmumps_select_inv(A,x) -> A⁻¹
mumps_select_inv(A,I,J) -> A⁻¹
Compute selected elements of A⁻¹. If two arguments are passed, the second must be sparse, and its sparsity pattern determines the entries of the inverse. If three arguments are passed, the integer arrays I
and J
specify which entries via i(k),j(k) = I[k],J[k]
.
See also: mumps_select_inv!
MUMPS.mumps_select_inv!
— Functionmumps_select_inv!(x,mumps)
mumps_select_inv!(x,A)
Compute selected elements of A⁻¹ with same sparsity pattern as x
, stored in x
. If passed mumps
, must have previously been provided with matrix A
.
See also: mumps_select_inv
, get_rhs!
, get_rhs
MUMPS.mumps_solve
— Functionmumps_solve(A,y) -> x
mumps_solve(mumps,y) -> x
mumps_solve(mumps) -> x
Solve A*x=y
If mumps
is given, must have previously been provided a matrix A
. If only input is mumps
must also have been provided y
.
See also: mumps_solve!
MUMPS.mumps_solve!
— Functionmumps_solve!(x,A,y; kwargs...)
mumps_solve!(x,mumps)
mumps_solve!(x,mumps,y)
Solve A*x=y
, saving result in pre-allocated x. If mumps
is given, must have previously been provided a matrix A
. If y
is not given, mumps
must have previously been provided y
See also: mumps_solve
, get_sol!
, get_sol
MUMPS.set_cntl!
— Methodset_cntl!(mumps,i,val; [displaylevel=1])
Set the real/complex control parameters according to CNTL[i]=val
See also: display_cntl
MUMPS.set_icntl!
— Methodset_icntl!(mumps,i,val; [displaylevel=1])
Set the integer control parameters according to ICNTL[i]=val
See also: display_icntl
MUMPS.set_job!
— Methodset_job!(mumps,job)
Set the phase to job
. See MUMPS manual for options.
MUMPS.set_save_dir!
— Methodset_save_dir!(mumps,dir)
set name of directory in which to store out-of-core files.
MUMPS.set_save_prefix!
— Methodset_save_prefix!(mumps,dir)
prefix for out-of-core files.
MUMPS.set_schur_centralized_by_column!
— Methodset_schur_centralized_by_column!(mumps,schur_inds)
Set up Schur complement matrix calculation for the "centralized by column" method suggested in the MUMPS manual
See also: mumps_schur_complement!
, mumps_schur_complement
MUMPS.solve!
— Methodsolve!(mumps;transposed=false)
Solve the system registered with the Mumps
object mumps
. The matrix and right-hand side(s) must have been previously registered with associate_matrix()
and associate_rhs()
. The optional keyword argument transposed
indicates whether the user wants to solve the forward or transposed system. The solution is stored internally and must be retrieved with get_solution()
.
MUMPS.solve
— Methodsolve(mumps, A, rhs; transposed=false)
Combined analyze / factorize / solve. Presume that A
and rhs
are available on all nodes. The optional keyword argument transposed
indicates whether the user wants to solve the forward or transposed system. The solution is retrieved and returned.
MUMPS.solve
— Methodsolve(mumps, rhs; transposed=false)
Combined associate_rhs / solve. Presume that rhs
is available on all nodes. The optional keyword argument transposed
indicates whether the user wants to solve the forward or transposed system. The solution is retrieved and returned.
MUMPS.solve
— Methodsolve(A, rhs; sym=mumps_unsymmetric)
Combined initialize / analyze / factorize / solve. Presume that A
and rhs
are available on all nodes. The optional keyword argument sym
indicates the symmetry of A
. The solution is retrieved and returned.