-
-
Notifications
You must be signed in to change notification settings - Fork 77
Add API to update iterative solver tolerances #819
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
Add API to update iterative solver tolerances #819
Conversation
|
There is some issue on master (see e.g. https://github.com/SciML/LinearSolve.jl/actions/runs/19331508201/job/55295492581#step:6:341 ) where the Krylov.jl solvers report that the solve failed, but the solution looks fine, which is unrelated to this PR. |
|
It only hits that message if the retcode is also being set to Failure, which only happens if the solver stats LinearSolve.jl/src/iterative_wrappers.jl Line 311 in 5df1b29
|
|
Rebase this. |
906ec54 to
52f2191
Compare
|
Looks like tests are failing. |
| iters = stats.niter, retcode, stats) | ||
| end | ||
|
|
||
| update_tolerances_internal!(cache, alg::KrylovJL, atol, rtol) = nothing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this not supported? Since this is the only one people actually use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All Krylov packages are supported. This was was in particular easy, because you pass the tolerance into the solve call. The relevant lines for the transfer are these
LinearSolve.jl/src/iterative_wrappers.jl
Lines 268 to 269 in d53ba71
| atol = float(cache.abstol) | |
| rtol = float(cache.reltol) |
LinearSolve.jl/src/iterative_wrappers.jl
Lines 290 to 291 in d53ba71
| kwargs = (atol = atol, rtol, itmax, verbose = krylovJL_verbose, | |
| ldiv = true, history = true, alg.kwargs...) |
LinearSolve.jl/src/iterative_wrappers.jl
Line 297 in d53ba71
| Krylov.krylov_solve!(args...; M, kwargs...) |
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
Add any other context about the problem here.