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?

New contributor
aqw is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
\$\endgroup\$
0

1 Answer 1

1
\$\begingroup\$

what I can do for you and give you suggestions

  1. Use library like Nuba 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\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.