diff --git a/Project.toml b/Project.toml index 14e90377..4084e4be 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ClimaTimeSteppers" uuid = "595c0a79-7f3d-439a-bc5a-b232dc3bde79" authors = ["Climate Modeling Alliance"] -version = "0.7.5" +version = "0.7.6" [deps] CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" diff --git a/docs/Manifest.toml b/docs/Manifest.toml index 4beff870..9d577632 100644 --- a/docs/Manifest.toml +++ b/docs/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.8.5" manifest_format = "2.0" -project_hash = "0445f0b63f403d783217e170583dfd95f7a70fe5" +project_hash = "8397e9864ab4184b6af749a437287a4a333e2a96" [[deps.ADTypes]] git-tree-sha1 = "dcfdf328328f2645531c4ddebf841228aef74130" @@ -204,7 +204,7 @@ version = "0.2.4" deps = ["CUDA", "ClimaComms", "DataStructures", "DiffEqBase", "DiffEqCallbacks", "KernelAbstractions", "Krylov", "LinearAlgebra", "LinearOperators", "SciMLBase", "StaticArrays"] path = ".." uuid = "595c0a79-7f3d-439a-bc5a-b232dc3bde79" -version = "0.7.4" +version = "0.7.5" [[deps.CloseOpenIntervals]] deps = ["Static", "StaticArrayInterface"] diff --git a/docs/Project.toml b/docs/Project.toml index 63d69088..791fe510 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,5 +1,6 @@ [deps] AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" +ClimaComms = "3a4d1b5c-c61d-41fd-a00a-5873ba7a1b0d" ClimaCore = "d414da3d-4745-48bb-8d80-42e94e092884" ClimaCorePlots = "cf7c7e5a-b407-4c48-9047-11a94a308626" ClimaTimeSteppers = "595c0a79-7f3d-439a-bc5a-b232dc3bde79" @@ -7,6 +8,7 @@ DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244" +Krylov = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7" LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" diff --git a/perf/Manifest.toml b/perf/Manifest.toml index 4d27e24d..2b213c81 100644 --- a/perf/Manifest.toml +++ b/perf/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.8.5" manifest_format = "2.0" -project_hash = "3a6b07d03bd1660efe1ad41af414e397bfedbd6f" +project_hash = "007561ccc3a937bb99d6d0831f5143e3c6352aac" [[deps.ADTypes]] git-tree-sha1 = "dcfdf328328f2645531c4ddebf841228aef74130" @@ -176,7 +176,7 @@ version = "0.10.34" deps = ["CUDA", "ClimaComms", "DataStructures", "DiffEqBase", "DiffEqCallbacks", "KernelAbstractions", "Krylov", "LinearAlgebra", "LinearOperators", "SciMLBase", "StaticArrays"] path = ".." uuid = "595c0a79-7f3d-439a-bc5a-b232dc3bde79" -version = "0.7.4" +version = "0.7.5" [[deps.CloseOpenIntervals]] deps = ["Static", "StaticArrayInterface"] diff --git a/perf/Project.toml b/perf/Project.toml index bd02235f..88dae0bd 100644 --- a/perf/Project.toml +++ b/perf/Project.toml @@ -2,6 +2,7 @@ ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63" BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" +ClimaComms = "3a4d1b5c-c61d-41fd-a00a-5873ba7a1b0d" ClimaCore = "d414da3d-4745-48bb-8d80-42e94e092884" ClimaTimeSteppers = "595c0a79-7f3d-439a-bc5a-b232dc3bde79" DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" diff --git a/src/nl_solvers/newtons_method.jl b/src/nl_solvers/newtons_method.jl index 0bd3f1be..7198d37c 100644 --- a/src/nl_solvers/newtons_method.jl +++ b/src/nl_solvers/newtons_method.jl @@ -415,12 +415,6 @@ end solver_type(::KrylovMethod{Val{T}}) where {T} = T -# TODO: should we make ClimaCore depend on Krylov.jl and overload -# Krylov.ktypeof for `FieldVector`s? -ct_ktypeof(x) = #= x::ClimaCore.Fields.FieldVector =# - ClimaComms.array_type(x){eltype(parent(x))} -ct_ktypeof(x::Vector) = Krylov.ktypeof(x) - function allocate_cache(alg::KrylovMethod, x_prototype) (; jacobian_free_jvp, forcing_term, args, kwargs, debugger) = alg type = solver_type(alg) @@ -429,7 +423,7 @@ function allocate_cache(alg::KrylovMethod, x_prototype) jacobian_free_jvp_cache = isnothing(jacobian_free_jvp) ? nothing : allocate_cache(jacobian_free_jvp, x_prototype), forcing_term_cache = allocate_cache(forcing_term, x_prototype), - solver = type(l, l, args..., ct_ktypeof(x_prototype); kwargs...), + solver = type(l, l, args..., Krylov.ktypeof(x_prototype); kwargs...), debugger_cache = isnothing(debugger) ? nothing : allocate_cache(debugger, x_prototype), ) end diff --git a/test/problems.jl b/test/problems.jl index eada55c2..944cef20 100644 --- a/test/problems.jl +++ b/test/problems.jl @@ -1,5 +1,6 @@ using DiffEqBase, ClimaTimeSteppers, LinearAlgebra, StaticArrays using ClimaCore +using ClimaComms import ClimaCore.Domains as Domains import ClimaCore.Geometry as Geometry import ClimaCore.Meshes as Meshes @@ -8,6 +9,9 @@ import ClimaCore.Spaces as Spaces import ClimaCore.Fields as Fields import ClimaCore.Operators as Operators +import Krylov +Krylov.ktypeof(x::Fields.FieldVector) = ClimaComms.array_type(x){eltype(parent(x)), 1} + """ Single variable linear ODE