Return ODE step-limit failures through status#391
Merged
Conversation
992fe89 to
e162cfe
Compare
e162cfe to
3ee8f7c
Compare
3ee8f7c to
5904b11
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the terminal error stop on adaptive-step exhaustion with the existing per-call failure status. Context-aware callers may also supply a positive step limit and receive an optional integer status, so long constructions can bound the work and handle an exhausted solve without terminating the process. The default remains one million steps.
The failure flag is thread-private, matching the integrator state and preventing one OpenMP caller from observing another caller status. Successful trajectories, tolerances, Runge-Kutta coefficients, event handling, and returned states are unchanged. On exhaustion, the last accepted state is returned with
odeint_has_failed()true andierr=1, matching the existing step-underflow path. A later successful call resets both statuses.Verification
Failing before, with the behavioral test applied to main:
Passing after:
The test forces a one-step exhaustion, checks both failure interfaces, then runs a successful solve and verifies that both statuses recover.