Skip to main content

Python bindings for MUMPS, a parallel sparse direct solver

Project description

PyMUMPS: A parallel sparse direct solver

Requirements

Installation

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 setup.py build_ext --help to get a list of all allowed options.

There is also conda recipe:

conda install -c conda-forge pymumps

Examples

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:
    ctx.set_centralized_sparse(A)
    x = b.copy()
    ctx.set_rhs(x) # Modified in place
ctx.run(job=6) # 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
ctx.run(job=1) # Analysis

if ctx.myid == 0:
    ctx.set_centralized_assembled_values(A.data)
ctx.run(job=2) # Factorization

if ctx.myid == 0:
    x = b1.copy()
    ctx.set_rhs(x)
ctx.run(job=3) # 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymumps-0.3.3.tar.gz (8.2 kB view details)

Uploaded Source

File details

Details for the file pymumps-0.3.3.tar.gz.

File metadata

  • Download URL: pymumps-0.3.3.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.2

File hashes

Hashes for pymumps-0.3.3.tar.gz
Algorithm Hash digest
SHA256 dfa9471f045f03aad133c60d4aaeffb211b568e85940fa5d44556adcaefbd76c
MD5 7423bc47e363c0e6a8e910afc98589f9
BLAKE2b-256 8d3675ff7ce99ff1f65132af5a310c10eeb6f80537ad352570a39f1c1eb239b7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page