Python bindings for MUMPS, a parallel sparse direct solver

pip install PyMUMPS==0.3.2


PyMUMPS: A parallel sparse direct solver



PyMUMPS can be installed from PyPI using pip:

pip install pymumps

Custom build flags, e.g. to specify the MUMPS installation location, can be specified using --global-option:

pip install pymumps --global-option="build_ext" \
    --global-option="-I$MUMPS_PREFIX/include" \
    --global-option="-L$MUMPS_PREFIX/lib" \

Use python build_ext --help to get a list of all allowed options.

There is also conda recipe:

conda install -c conda-forge pymumps


Centralized input & output. The sparse matrix and right hand side are input only on the rank 0 process. The system is solved using all available processes and the result is available on the rank 0 process.

from mumps import DMumpsContext
ctx = DMumpsContext()
if ctx.myid == 0:
    x = b.copy()
    ctx.set_rhs(x) # Modified in place # Analysis + Factorization + Solve
ctx.destroy() # Cleanup

Re-use symbolic or numeric factorizations.

from mumps import DMumpsContext
ctx = DMumpsContext()
if ctx.myid == 0:
    ctx.set_centralized_assembled_rows_cols(A.row+1, A.col+1) # 1-based # Analysis

if ctx.myid == 0:
    ctx.set_centralized_assembled_values( # Factorization

if ctx.myid == 0:
    x = b1.copy()
    ctx.set_rhs(x) # Solve

# Reuse factorizations by running `job=3` with new right hand sides
# or analyses by supplying new values and running `job=2` to repeat
# the factorization process.