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

Specifying maxiters and CubaSUAVE in solve causes julia to crash (segmentation fault) #91

Open
evrenmturan opened this issue Jul 28, 2022 · 3 comments

Comments

@evrenmturan
Copy link

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
@ChrisRackauckas
Copy link
Member

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.

@ArnoStrouwen
Copy link
Member

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?

@ChrisRackauckas
Copy link
Member

I guess so? It seems odd that it just crash though. But yeah that's an upstream issue.

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

No branches or pull requests

3 participants