Integrals.jl
Integrals.jl copied to clipboard
Specifying maxiters and CubaSUAVE in solve causes julia to crash (segmentation fault)
Specifying maxiters with CubaSUAVE() causes julia to crash, e.g.
using Integrals, IntegralsCuba
f(x,p) = sum(sin.(x))
prob = IntegralProblem(f,ones(2),3ones(2))
sol = solve(prob,CubaSUAVE(),reltol=1e-3,abstol=1e-3, maxiters=10)
Also I'd like to check - is maxiters meant to be a hard limit for the number of function calls? I would have expected the below to have very different results, but they give the exact same value.
using Integrals
f(x,p) = sum(sin.(x))
prob = IntegralProblem(f,ones(2),3ones(2))
sol1 = solve(prob,HCubatureJL(),reltol=1e-8,abstol=1e-8, maxiters=1).u
sol2 = solve(prob,HCubatureJL(),reltol=1e-8,abstol=1e-8, maxiters=10).u
sol1 == sol2
The exact interpretation of maxiters can depend on the integrator. Some can only do iterations in odd increments. For example, Gauss-Kronrad works in 15 function evaluation increments, so anything less than that would just be hard capped to not do the next 15.
If you change maxiters to a larger number, e.g. 1000, it does not crash. I think these Cuba methods are not meant for low evaluation numbers. You might want to report this issue to Cuba.jl .
@ChrisRackauckas return an error for maxiters<1000
for AbstractCubaAlgorithm
?
I guess so? It seems odd that it just crash though. But yeah that's an upstream issue.