From f1726720aae524a71c9409108e1047f9cb490b0f Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Wed, 12 Feb 2025 06:46:59 -0800 Subject: [PATCH] Make RAT a hard dep --- Project.toml | 3 +-- ext/LinearSolveRecursiveArrayToolsExt.jl | 12 ------------ src/LinearSolve.jl | 1 + src/iterative_wrappers.jl | 6 ++++++ 4 files changed, 8 insertions(+), 14 deletions(-) delete mode 100644 ext/LinearSolveRecursiveArrayToolsExt.jl diff --git a/Project.toml b/Project.toml index 969837946..42b129e7b 100644 --- a/Project.toml +++ b/Project.toml @@ -19,6 +19,7 @@ MKL_jll = "856f044c-d86e-5d09-b602-aeab76dc8ba7" Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" Preferences = "21216c6a-2e73-6563-6e65-726566657250" +RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" Reexport = "189a3867-3050-52da-a836-e630ba90ab69" SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" SciMLOperators = "c0aeaf25-5076-4817-a8d5-81caf7dfa961" @@ -41,7 +42,6 @@ KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c" KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77" Metal = "dde4c033-4e86-420c-a63e-0dd931031962" Pardiso = "46dd5b70-b6fb-5a00-ae2d-e8fea33afaf2" -RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" RecursiveFactorization = "f2c3362d-daeb-58d1-803e-2bc74f2840b4" Sparspak = "e56a9233-b9d6-4f03-8d0f-1825330902ac" @@ -59,7 +59,6 @@ LinearSolveKernelAbstractionsExt = "KernelAbstractions" LinearSolveKrylovKitExt = "KrylovKit" LinearSolveMetalExt = "Metal" LinearSolvePardisoExt = "Pardiso" -LinearSolveRecursiveArrayToolsExt = "RecursiveArrayTools" LinearSolveRecursiveFactorizationExt = "RecursiveFactorization" LinearSolveSparseArraysExt = "SparseArrays" LinearSolveSparspakExt = "Sparspak" diff --git a/ext/LinearSolveRecursiveArrayToolsExt.jl b/ext/LinearSolveRecursiveArrayToolsExt.jl deleted file mode 100644 index 468f53e84..000000000 --- a/ext/LinearSolveRecursiveArrayToolsExt.jl +++ /dev/null @@ -1,12 +0,0 @@ -module LinearSolveRecursiveArrayToolsExt - -using LinearSolve, RecursiveArrayTools -import LinearSolve: init_cacheval - -# Krylov.jl tries to init with `ArrayPartition(undef, ...)`. Avoid hitting that! -function init_cacheval(alg::LinearSolve.KrylovJL, A, b::ArrayPartition, u, Pl, Pr, - maxiters::Int, abstol, reltol, verbose::Bool, ::LinearSolve.OperatorAssumptions) - return nothing -end - -end diff --git a/src/LinearSolve.jl b/src/LinearSolve.jl index 66dc0bafc..3330cde0a 100644 --- a/src/LinearSolve.jl +++ b/src/LinearSolve.jl @@ -19,6 +19,7 @@ using EnumX using Markdown using ChainRulesCore import InteractiveUtils +import RecursiveArrayTools import StaticArraysCore: StaticArray, SVector, MVector, SMatrix, MMatrix diff --git a/src/iterative_wrappers.jl b/src/iterative_wrappers.jl index 398f981a7..5b3c42a8b 100644 --- a/src/iterative_wrappers.jl +++ b/src/iterative_wrappers.jl @@ -237,6 +237,12 @@ function init_cacheval(alg::KrylovJL, A, b, u, Pl, Pr, maxiters::Int, abstol, re return solver end +# Krylov.jl tries to init with `ArrayPartition(undef, ...)`. Avoid hitting that! +function init_cacheval(alg::LinearSolve.KrylovJL, A, b::RecursiveArrayTools.ArrayPartition, u, Pl, Pr, + maxiters::Int, abstol, reltol, verbose::Bool, ::LinearSolve.OperatorAssumptions) + return nothing +end + function SciMLBase.solve!(cache::LinearCache, alg::KrylovJL; kwargs...) if cache.precsisfresh && !isnothing(alg.precs) Pl, Pr = alg.precs(cache.A, cache.p)