From 7f54a303cfcb0c0f5be49700223c546de6ce83e3 Mon Sep 17 00:00:00 2001 From: Joshua Lampert Date: Fri, 14 Jun 2024 16:12:50 +0200 Subject: [PATCH] remove PreallocationTools again --- Project.toml | 2 -- ext/SummationByPartsOperatorsOptimForwardDiffExt.jl | 13 ++----------- test/aqua.jl | 2 +- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/Project.toml b/Project.toml index 34914199..5299f448 100644 --- a/Project.toml +++ b/Project.toml @@ -12,7 +12,6 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" LoopVectorization = "bdcacae8-1622-11e9-2a5c-532679323890" MuladdMacro = "46d2c3a1-f734-5fdb-9937-b9b9aeba4221" PolynomialBases = "c74db56a-226d-5e98-8bb0-a6049094aeea" -PreallocationTools = "d236fae5-4411-538c-8e31-a6e3d9e00b46" PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" Reexport = "189a3867-3050-52da-a836-e630ba90ab69" @@ -51,7 +50,6 @@ LoopVectorization = "0.12.22" MuladdMacro = "0.2" Optim = "1" PolynomialBases = "0.4.15" -PreallocationTools = "0.4" PrecompileTools = "1.0.1" RecursiveArrayTools = "2.11, 3" Reexport = "0.2, 1.0" diff --git a/ext/SummationByPartsOperatorsOptimForwardDiffExt.jl b/ext/SummationByPartsOperatorsOptimForwardDiffExt.jl index 920ad83d..8aa4be77 100644 --- a/ext/SummationByPartsOperatorsOptimForwardDiffExt.jl +++ b/ext/SummationByPartsOperatorsOptimForwardDiffExt.jl @@ -5,7 +5,6 @@ using ForwardDiff: ForwardDiff using SummationByPartsOperators: SummationByPartsOperators, GlaubitzNordströmÖffner2023, MatrixDerivativeOperator using LinearAlgebra: Diagonal, LowerTriangular, dot, diag, norm, mul! -using PreallocationTools: DiffCache, get_tmp using SparseArrays: spzeros function SummationByPartsOperators.function_space_operator(basis_functions, nodes::Vector{T}, @@ -120,13 +119,9 @@ function construct_function_space_operator(basis_functions, nodes, A = zeros(eltype(nodes), N, K) SV = zeros(eltype(nodes), N, K) PV_x = zeros(eltype(nodes), N, K) - S_cache = DiffCache(S) - A_cache = DiffCache(A) - SV_cache = DiffCache(SV) - PV_x_cache = DiffCache(PV_x) daij_dsigmak = zeros(eltype(nodes), N, K, L) daij_drhok = zeros(eltype(nodes), N, K, N) - p = (V, V_x, R, x_length, S_cache, A_cache, SV_cache, PV_x_cache, daij_dsigmak, daij_drhok) + p = (V, V_x, R, x_length, S, A, SV, PV_x, daij_dsigmak, daij_drhok) x0 = zeros(L + N) fg!(F, G, x) = optimization_function_and_grad!(F, G, x, p) @@ -144,11 +139,7 @@ function construct_function_space_operator(basis_functions, nodes, end @views function optimization_function_and_grad!(F, G, x, p) - V, V_x, R, x_length, S_cache, A_cache, SV_cache, PV_x_cache, daij_dsigmak, daij_drhok = p - S = get_tmp(S_cache, x) - A = get_tmp(A_cache, x) - SV = get_tmp(SV_cache, x) - PV_x = get_tmp(PV_x_cache, x) + V, V_x, R, x_length, S, A, SV, PV_x, daij_dsigmak, daij_drhok = p (N, _) = size(R) L = div(N * (N - 1), 2) sigma = x[1:L] diff --git a/test/aqua.jl b/test/aqua.jl index e4487da8..ec31e437 100644 --- a/test/aqua.jl +++ b/test/aqua.jl @@ -4,5 +4,5 @@ using SummationByPartsOperators Aqua.test_all(SummationByPartsOperators; ambiguities = false, # a lot of false positives from dependencies unbound_args = false, # TODO: a strange problem I do not understand right now - stale_deps = (; ignore = [:PrecompileTools, :PreallocationTools]), + stale_deps = (; ignore = [:PrecompileTools]), )