JuliaSparse / KLU.jl

Julia Wrapper for the KLU sparse matrix solver from SuiteSparse
https://klu.juliasparse.org/
MIT License
26 stars 6 forks source link

Parallel solver with KLU #7

Closed Amuri44 closed 1 year ago

Amuri44 commented 1 year ago

Is there any parallel solver for KLU sofar, such as that for MKLPardisoSolver?

rayegun commented 1 year ago

For the solve step? You mean like parallelizing over a matrix solve (one thread per vector for instance)?

I may be able to implement that. The factor step is not parallel IIRC. We'd have to wrap Basker or something like that for multithreaded factors.

Amuri44 commented 1 year ago

Yes, exactly. Which would be wonderful. Cause I did not know how to start and what are the steps.

mzy2240 commented 1 year ago

Definitely nice to have! This new one may be similar to Basker as well. Frankly speaking, factorization in KLU is already fast enough, however everytime when I try to use the same factorized matrix across multiple threads it already slow down the whole process.

Amuri44 commented 1 year ago

Frankly speaking, factorization in KLU is already fast enough, however everytime when I try to use the same factorized matrix across multiple threads it already slow down the whole process.

Excuse me, if we need to make the solution of the linear equation Ax=b on two threads, so what is the steps you do with the factorized matrix? In other words, after the factor step (on serial) what do you do? cause I did not know how to solve this x=(LU+F)\b comparing with x=U\L\b in LU factorization.

mzy2240 commented 1 year ago

In my use case, b is multi-vector or 2D matrix whatever you name it, so apparently the solve process could be paralleled.

Amuri44 commented 1 year ago

In my use case, b is multi-vector or 2D matrix whatever you name it, so apparently the solve process could be paralleled.

I see. So, each thread will work on one vector of b but with the same A, right?

mzy2240 commented 1 year ago

Yes

Amuri44 commented 1 year ago

@Wimmerer Your help here is very appreciated. Given a linear equation `Ax=b:

ViralBShah commented 1 year ago

KLU is just a simple left-looking sparse solver. For speed, you need to look at SuperLU, other SuiteSparse solvers, etc.