2
\$\begingroup\$

I would like to know if there are any multithreaded sparse linear solvers for LU decomposed sparse matrices.

I want to increase the solving speed of a system like:

import numpy as np
from scipy.sparse import diags
import scipy.sparse.linalg as spla

n = 1_000_000  
diagonals = [-0.01*np.ones(n-1), np.ones(n), -0.01*np.ones(n-1)]
offsets = [-1, 0, 1]  

mat = diags(diagonals, offsets, shape=(n, n), format='csc')

LU_mat = spla.splu(mat)  

b = np.random.randn(n)

for i in range(654):
    b = LU_mat.solve(b) 

Where LU decomposition is performed once, and solved "n" times.

On my machine, this example appears to be single threaded.

Are there any Python libraries with multithreaded solvers, so that I can take advantage of the resources of my machine?

\$\endgroup\$
0

1 Answer 1

2
\$\begingroup\$

What I can do for you and give you suggestions

  1. Use library like Numba or similar;
  2. try to use superlu_dist, uses optimize algorithms (install it using conda);
  3. try Pypy is a JIT compiler;
  4. prefer if is possible numpy.
\$\endgroup\$
0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.