diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index d50417cec..707a92bde 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -36,6 +36,10 @@ jobs: - "LinearSolveHYPRE" - "LinearSolvePardiso" - "NoPre" + os: + - ubuntu-latest + - macos-latest + - windows-latest uses: "SciML/.github/.github/workflows/tests.yml@v1" with: group: "${{ matrix.group }}" diff --git a/ext/LinearSolveBLISExt.jl b/ext/LinearSolveBLISExt.jl index e816c8d5f..cb2bcf938 100644 --- a/ext/LinearSolveBLISExt.jl +++ b/ext/LinearSolveBLISExt.jl @@ -10,6 +10,7 @@ using LinearAlgebra: BlasInt, LU using LinearAlgebra.LAPACK: require_one_based_indexing, chkfinite, chkstride1, @blasfunc, chkargsok using LinearSolve: ArrayInterface, BLISLUFactorization, @get_cacheval, LinearCache, SciMLBase +using SciMLBase: ReturnCode const global libblis = blis_jll.blis const global liblapack = LAPACK_jll.liblapack @@ -224,27 +225,27 @@ function SciMLBase.solve!(cache::LinearCache, alg::BLISLUFactorization; res = getrf!(A; ipiv = cacheval[1].ipiv, info = cacheval[2]) fact = LU(res[1:3]...), res[4] cache.cacheval = fact + + if !LinearAlgebra.issuccess(fact[1]) + return SciMLBase.build_linear_solution( + alg, cache.u, nothing, cache; retcode = ReturnCode.Failure) + end cache.isfresh = false end - y = ldiv!(cache.u, @get_cacheval(cache, :BLISLUFactorization)[1], cache.b) - SciMLBase.build_linear_solution(alg, y, nothing, cache) - - #= A, info = @get_cacheval(cache, :BLISLUFactorization) - LinearAlgebra.require_one_based_indexing(cache.u, cache.b) + require_one_based_indexing(cache.u, cache.b) m, n = size(A, 1), size(A, 2) if m > n Bc = copy(cache.b) getrs!('N', A.factors, A.ipiv, Bc; info) - return copyto!(cache.u, 1, Bc, 1, n) + copyto!(cache.u, 1, Bc, 1, n) else copyto!(cache.u, cache.b) getrs!('N', A.factors, A.ipiv, cache.u; info) end - SciMLBase.build_linear_solution(alg, cache.u, nothing, cache) - =# + SciMLBase.build_linear_solution(alg, cache.u, nothing, cache; retcode = ReturnCode.Success) end end \ No newline at end of file diff --git a/src/mkl.jl b/src/mkl.jl index 189c1ab75..270e7ed7d 100644 --- a/src/mkl.jl +++ b/src/mkl.jl @@ -227,22 +227,17 @@ function SciMLBase.solve!(cache::LinearCache, alg::MKLLUFactorization; cache.isfresh = false end - y = ldiv!(cache.u, @get_cacheval(cache, :MKLLUFactorization)[1], cache.b) - SciMLBase.build_linear_solution(alg, y, nothing, cache; retcode = ReturnCode.Success) - - #= A, info = @get_cacheval(cache, :MKLLUFactorization) - LinearAlgebra.require_one_based_indexing(cache.u, cache.b) + require_one_based_indexing(cache.u, cache.b) m, n = size(A, 1), size(A, 2) if m > n Bc = copy(cache.b) getrs!('N', A.factors, A.ipiv, Bc; info) - return copyto!(cache.u, 1, Bc, 1, n) + copyto!(cache.u, 1, Bc, 1, n) else copyto!(cache.u, cache.b) getrs!('N', A.factors, A.ipiv, cache.u; info) end - SciMLBase.build_linear_solution(alg, cache.u, nothing, cache) - =# + SciMLBase.build_linear_solution(alg, cache.u, nothing, cache; retcode = ReturnCode.Success) end