-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alternate backend for sparse solver #2632
Comments
PARDISO is great, but it is not open source and hence that rules it out of Base. It would be great to have it as a package. |
I wonder if such wishlists should live as issues filed aganist METADATA. Just a thought. |
I'd suggest that, at least currently, wishlists (and other things) are more likely to be seen by more people here (or the mailing list). |
Actually, what I suggested is not to incorporate PARDISO into the base, but that we should allow user to register different sparse solver globally. Consider such a scenario, a package contributor Alice writes a data processing package that contains such a function function process_data(A, x)
...
y = A \ x; # A is sparse, so it calls underlying sparse solver
...
end Now, Bob is a user of this package, and he has a PARDISO license, and wants to use the PARDISO solver instead of UMFPACK when calling the functions in Alice's package. Then, Bob wishes to write Base.register_sparse_solver(pardiso_solve)
process_data(my_A, my_x); Here, |
This will require some reorganization but it's a good idea. There are some tricky issues like how to pass parameters. If you're interested in performance enough to switch the sparse solver, you probably also want to pass specific parameters to PARDISO; there are many different parameters to tune the solution method to the particular structure of the matrix. You may also want to separate the symbolic/numerical/solve phases. The interface will need to support all of this. |
What I thought was much easier than this.
I can just register a closure like |
I think there should not be a very huge change to the base. Here is basically all what it needs to make it work: change the implementation of function default_sparse_solve(A::SparseMatrixCSC, x::Vector)
... use the current implementation here ...
end
registered_sparse_solver = default_sparse_solve
\ ( a::SparseMatrixCSC, x::Vector) = registered_sparse_solver(A, x) and add a function to register a different solver. |
Seems reasonable to me. @dmbates? @JeffBezanson: will this cause problems for type inference? |
I just checked. it seemed that PETSc is not working with PARDISO though. |
@lindahua, you're right, although PETSc supports many linear solvers in its backend, PARDISO is not one of them for some reason. (Of course, PARDISO is not free/open-source software, but PETSc already supports several proprietary back-ends. But the main priority is to support free/open-source back-ends like UMFPACK and PaSTiX, probably. Probably you could get the data out of PETSc in a format that PARDISO supports, however, with enough work; sparse-matrix formats are pretty standardized.) |
At an interface level, I think we should do a little more refactoring of the sparse solver modules and abstract types so that it is easy to use one from a package. That said, I think it is not a good idea that Completely agree with @stevengj that we should not write any more sparse solver interfaces, and use PetSc so that we can get all of them. At least on debian systems and such, you can then get PetSc and all the other dependent solvers easily, in theory. |
I closed this. All relevant discussions should go to #2645 |
Unlike for dense matrices where BLAS & LAPACK are de facto standard, there are multiple competing implementation (with different interfaces) for sparse solvers.
Currently, Julia is using UMFPACK. PARDISO is also widely used (partly because it has been used by MKL for solving sparse systems).
A report (perhaps outdated) here: ftp://ftp.numerical.rl.ac.uk/pub/reports/ghsRAL200505.pdf
shows that PARDISO has superior performance in general.
We may implement PARDISO (and perhaps others) as an alternative solver and provide a way to allow users to set their preferred solver.
The text was updated successfully, but these errors were encountered: