Skip to content

Conversation

oscardssmith
Copy link
Member

This is a prototype of a replacement for FunctionWrappersWrappers specialization of ODEs. It works by not specializing the function, and wrapping the p and t fields to prevent them from needing to be boxed. This still has some overhead, and doesn't work for derivatives with respect to t or p, but it will work with arbitrary chunksizes for the jacobians.

julia> prob = ODEProblem{true}(lorenz!, [1.0; 0.0; 0.0], (0,100.0)) # FunctionWrapperWrapper
julia> @btime  solve(prob, Tsit5(), save_everystep=false);
  221.112 μs (74 allocations: 3.98 KiB)
julia> prob2 = ODEProblem(lorenz!, [1.0; 0.0; 0.0], (0,100.0)) # new wrapper
julia> @btime  solve(prob2, Tsit5(), save_everystep=false);
  254.728 μs (61 allocations: 3.48 KiB)

@oscardssmith oscardssmith changed the title trial better ode wrapper Draft: trial better ode wrapper Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant