Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type instability when specifying solver options #2558

Open
densmojd opened this issue Dec 13, 2024 · 1 comment
Open

Type instability when specifying solver options #2558

densmojd opened this issue Dec 13, 2024 · 1 comment
Assignees
Labels

Comments

@densmojd
Copy link

Solving an ODE with default options is fine, specifying an option results in a type instability. Perhaps related to #2530.

using OrdinaryDiffEq

prob = ODEProblem{false}((u, p, t) -> -u, 1.0, (0.0, 1.0))

@code_warntype solve(prob) # type stable
@code_warntype solve(prob, reltol = 1E-3) # type unstable

I see similar behavior when specifying abstol and dt.

I'm using Julia 1.11.2 and OrdinaryDiffEq.jl v6.90.1

@oscardssmith
Copy link
Member

The problem here is that the automatic algorithm detection isn't written in the best way. To fix it, we likely want to move the OrdinaryDiffEq automatic alg detection to use the same mechanism NonlinearSolve uses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants