SciML / LinearSolve.jl

LinearSolve.jl: High-Performance Unified Interface for Linear Solvers in Julia. Easily switch between factorization and Krylov methods, add preconditioners, and all in one interface.
https://docs.sciml.ai/LinearSolve/stable/
Other
244 stars 52 forks source link

Add support for cktso #392

Open mzy2240 opened 11 months ago

mzy2240 commented 11 months ago

https://github.com/chenxm1986/cktso

In my preliminary comparison, it is much faster than KLU on solving multi-vector rhs.

ChrisRackauckas commented 11 months ago

That sounds like a good idea. Do you have a code using it from Julia? I don't know of a Julia wrapper.

mzy2240 commented 11 months ago

I am currently calling the C-API directly like this. From my experience it is quite straightforward to get it supported in Julia.

using CEnum

mutable struct __cktso_l_dummy end

const ICktSo_L = Ptr{__cktso_l_dummy}

const _libcktso = joinpath(dirname(@__FILE__),"libcktso_l.so")

function CKTSO_L_CreateSolver(inst, iparm, oparm)
    ccall((:CKTSO_L_CreateSolver, _libcktso), Cint, (Ptr{ICktSo_L}, Ptr{Ptr{Cint}}, Ptr{Ptr{Clonglong}}), inst, iparm, oparm)
end
ChrisRackauckas commented 11 months ago

Could you try making a first version similar to https://github.com/SciML/LinearSolve.jl/blob/main/ext/LinearSolveMetalExt.jl ? I'd be happy to finish it, though I don't know how to set this solver up well, so your expertise of how to call it could help get this done quickly. Does this already have a Yggdrasil JLL?

mzy2240 commented 11 months ago

No it does not have a JLL yet. I don’t have any experience creating a JLL unfortunately.

mzy2240 commented 11 months ago

Also just saw this news from Dr. Davis: https://github.com/DrTimothyAldenDavis/SuiteSparse/discussions/448. Might worth to add the support for ParU since UMFPACK is already supported.

ChrisRackauckas commented 11 months ago

oh that's great news. That should be a separate issue though.