API
MUMPS.MUMPS — Module
module MUMPSBoth low-level interface with MUMPS 5.8.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 — Constant
Default single precision real parameters
MUMPS.default_cntl64 — Constant
Default double precision real parameters
MUMPS.default_icntl — Constant
Default integer parameters.
MUMPS.mumps_definite — Constant
const mumps_definiteConstant indicating that a symmetric definite matrix will be analyzed and factorized
MUMPS.mumps_symmetric — Constant
const mumps_symmetricConstant indicating that a general symmetric matrix will be analyzed and factorized
MUMPS.mumps_unsymmetric — Constant
const mumps_unsymmetricConstant indicating that a general unsymmetric matrix will be analyzed and factorized
MUMPS.MUMPSException — Type
mutable struct MUMPSExceptionException type raised in case of error.
MUMPS.MUMPS_JOB — Type
Enumeration of MUMPS job types; see MUMPS documentation for details.
MUMPS.Mumps — Type
Mirror of structre in [sdcz]mumps_c.h.
Base.finalize — Method
finalize(mumps)Terminate a Mumps instance.
MUMPS.associate_matrix! — Method
associate_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! — Method
associate_matrix!(mumps,A; unsafe=false)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.
Note that by default this function makes a copy of A. If you do not want to make a copy, pass unsafe=true. If the type of A needs to be converted, this function may copy A twice - to avoid this use unsafe=true.
When unsafe=true is passed, if the type of A is already consistent with the type of mumps, then pointers to A's memory are passed directly to MUMPS, so modifying A will modify the matrix in mumps. If A is not already consistent, a copy will be made when the type is converted. Warning: A dense, symmetric matrix will always be copied when it is converted to MUMPS's internal representation.
See also: associate_rhs!
MUMPS.associate_rhs! — Method
associate_rhs!(mumps, rhs; unsafe=false)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.
Note that this function makes a copy of rhs. If you do not want to make a copy, pass unsafe=false. If the type of rhs needs to be converted, this function may copy rhs twice - to avoid this use unsafe=false.
When unsafe=false is passed, if the type of rhs is already consistent with the type of mumps, then pointers to rhs's memory are passed directly to MUMPS, so modifying rhs will modify the rhs in mumps. If rhs is not already consistent, a copy will be made when the type is converted.
See also: associate_matrix!
MUMPS.default_icntl! — Method
default_icntl!(mumps)reset ICNTL to its default
MUMPS.display_cntl — Function
MUMPS.display_icntl — Function
display_icntl(mumps)Show the complete ICNTL integer array of mumps, with descriptions
See also: set_icntl!
MUMPS.factorize! — Method
factorize!(mumps,A)Combined associate_matrix / factorize. Presume that A is available on all nodes.
MUMPS.factorize! — Method
factorize!(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! — Method
MUMPS.get_icntl — Method
get_icntl(;det=false,verbose=false,ooc=false,itref=0,user_perm=false)Obtain an array of integer control parameters.
MUMPS.get_rhs! — Method
get_rhs!(x,mumps)Retrieve right hand side from mumps, storing it in pre-allocated x
MUMPS.get_rhs — Method
MUMPS.get_schur_complement! — Method
get_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 — Method
get_schur_complement(mumps) -> SRetrieve Schur complement matrix S from mumps
See also: get_schur_complement!, mumps_schur_complement!, mumps_schur_complement
MUMPS.get_sol! — Method
get_sol!(x,mumps)Retrieve solution x from mumps into pre-allocated array.
MUMPS.get_sol — Method
MUMPS.get_solution — Function
get_solution(mumps) -> xRetrieve 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! — Method
MUMPS.invoke_mumps! — Method
invoke_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! — Function
invoke_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! — Method
mumps_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 — Method
MUMPS.mumps_factorize! — Method
mumps_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 — Method
mumps_factorize(A) -> mumpsLU 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! — Function
mumps_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 — Method
mumps_schur_complement(A,schur_inds) -> S
mumps_schur_complement(A,x) -> Sschur_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 — Function
mumps_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! — Function
mumps_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 — Function
mumps_solve(A,y) -> x
mumps_solve(mumps,y) -> x
mumps_solve(mumps) -> xSolve 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! — Function
mumps_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! — Method
set_cntl!(mumps,i,val; [displaylevel=1])Set the real/complex control parameters according to CNTL[i]=val
See also: display_cntl
MUMPS.set_icntl! — Method
set_icntl!(mumps,i,val; [displaylevel=1])Set the integer control parameters according to ICNTL[i]=val
See also: display_icntl
MUMPS.set_job! — Method
set_job!(mumps,job::Integer)Reverse compatible version of set_job! that accepts an integer job code.
MUMPS.set_job! — Method
set_job!(mumps,job)Set the phase to job. See MUMPS manual for options.
MUMPS.set_save_dir! — Method
set_save_dir!(mumps,dir)set name of directory in which to store out-of-core files.
MUMPS.set_save_prefix! — Method
set_save_prefix!(mumps,dir)prefix for out-of-core files.
MUMPS.set_schur_centralized_by_column! — Method
set_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.set_user_perm! — Method
set_user_perm!(mumps, perm; unsafe=false)Provide a user-supplied permutation vector perm to the mumps object for reordering during analysis. This sets ICNTL[7] = 1 to indicate that a user-provided permutation should be used.
The permutation vector perm should be a 1-based integer vector of length n (the matrix dimension) containing a permutation of the integers 1 through n.
If needed, it tries to convert element type of perm to be consistent with MUMPS_INT type, throwing a warning in this case.
Note that by default this function makes a copy of perm. If you do not want to make a copy, pass unsafe=true. If the type of perm needs to be converted, this function may copy perm twice - to avoid this use unsafe=true.
When unsafe=true is passed, if the type of perm is already consistent with MUMPS_INT, then pointers to perm's memory are passed directly to MUMPS, so modifying perm will modify the permutation in mumps. If perm is not already consistent, a copy will be made when the type is converted.
See also: associate_matrix!, set_icntl!
MUMPS.solve! — Method
solve!(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 — Method
solve(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 — Method
solve(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 — Method
solve(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.