ODE solver takes 10x more steps without tstops

Hi everyone,

I’m experiencing what seems like counterintuitive performance behavior with RDPK3Sp35() and I’m wondering if this is expected or worth investigating as a potential bug.

I’m solving the same ODE with RDPK3Sp35(), reltol = 1.0e-12, and saveat = range(2010.0, 2015.0, 50). What’s confuses me is that when I set tstops to the same points as saveat, the solver takes way fewer steps than when I leave tstops empty.

Unfortunately I can’t easily provide a MWE, but here is the logs from my experiments:

┌ Info: Solver parameters
│   solver = RDPK3Sp35(; stage_limiter! = trivial_limiter!, step_limiter! = trivial_limiter!, thread = static(false),)
│   reltol = 1.0e-12
│   saveat = Float64[]
│   save_everystep = true
│   tstops = Float64[]
└   maxiters = 100000
[ Info: SciMLBase.DEStats(1212, 0, 0, 0, 0, 0, 0, 0, 0, 236, 236, 6, 0.0)

┌ Info: Solver parameters
│   solver = RDPK3Sp35(; stage_limiter! = trivial_limiter!, step_limiter! = trivial_limiter!, thread = static(false),)
│   reltol = 1.0e-12
│   saveat =
│    50-element Vector{Float64}:
│     2010.0
│     2010.1020408163265
│        ⋮
│     2015.0
│   save_everystep = true
│   tstops =
│    50-element Vector{Float64}:
│     2010.0
│     2010.1020408163265
│        ⋮
│     2015.0
└   maxiters = 100000
[ Info: SciMLBase.DEStats(1472, 0, 0, 0, 0, 0, 0, 0, 0, 289, 289, 5, 0.0)

┌ Info: Solver parameters
│   solver = RDPK3Sp35(; stage_limiter! = trivial_limiter!, step_limiter! = trivial_limiter!, thread = static(false),)
│   reltol = 1.0e-12
│   saveat =
│    50-element Vector{Float64}:
│     2010.0
│     2010.1020408163265
│        ⋮
│     2015.0
│   save_everystep = false
│   tstops =
│    50-element Vector{Float64}:
│     2010.0
│     2010.1020408163265
│        ⋮
│     2015.0
└   maxiters = 100000
[ Info: SciMLBase.DEStats(1472, 0, 0, 0, 0, 0, 0, 0, 0, 289, 289, 5, 0.0)

┌ Info: Solver parameters
│   solver = RDPK3Sp35(; stage_limiter! = trivial_limiter!, step_limiter! = trivial_limiter!, thread = static(false),)
│   reltol = 1.0e-12
│   saveat =
│    50-element Vector{Float64}:
│     2010.0
│     2010.1020408163265
│        ⋮
│     2015.0
│   save_everystep = true
│   tstops = Float64[]
└   maxiters = 100000
[ Info: SciMLBase.DEStats(11182, 0, 0, 0, 0, 0, 0, 0, 0, 2221, 2221, 15, 0.0)

┌ Info: Solver parameters
│   solver = RDPK3Sp35(; stage_limiter! = trivial_limiter!, step_limiter! = trivial_limiter!, thread = static(false),)
│   reltol = 1.0e-12
│   saveat =
│    50-element Vector{Float64}:
│     2010.0
│     2010.1020408163265
│        ⋮
│     2015.0
│   save_everystep = false
│   tstops = Float64[]
└   maxiters = 100000
[ Info: SciMLBase.DEStats(25137, 0, 0, 0, 0, 0, 0, 0, 0, 5016, 5016, 11, 0.0)

As you can see, going from 1472 to 25137 function evaluations when removing tstops seems quite unexpected. Has anyone encountered similar behavior or have ideas about what might be causing this?

Any insights would be appreciated!

Definitely odd. Would need an MWE to investigate.

Ok, I’ll try to create a MWE when I have some time to isolate the issue.