Skip to content

Return ODE step-limit failures through status#391

Merged
krystophny merged 1 commit into
mainfrom
fix/odeint-step-limit-status
Jul 13, 2026
Merged

Return ODE step-limit failures through status#391
krystophny merged 1 commit into
mainfrom
fix/odeint-step-limit-status

Conversation

@krystophny

@krystophny krystophny commented Jul 13, 2026

Copy link
Copy Markdown
Member

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 and ierr=1, matching the existing step-underflow path. A later successful call resets both statuses.

Verification

Failing before, with the behavioral test applied to main:

fo: test failed: Error: There is no specific subroutine for the generic odeint_allroutines

Passing after:

test_odeint_allroutines_context PASS 0.06s
Static: OK (228 modules, 228 changed, 228 affected)
Build: OK
Tests: OK
Lint: OK
Fmt: WARN (two touched Fortran files)
All stages passed

The test forces a one-step exhaustion, checks both failure interfaces, then runs a successful solve and verifies that both statuses recover.

@krystophny krystophny enabled auto-merge July 13, 2026 08:55
@krystophny krystophny force-pushed the fix/odeint-step-limit-status branch from 992fe89 to e162cfe Compare July 13, 2026 09:03
@krystophny krystophny force-pushed the fix/odeint-step-limit-status branch from e162cfe to 3ee8f7c Compare July 13, 2026 09:58
@krystophny krystophny force-pushed the fix/odeint-step-limit-status branch from 3ee8f7c to 5904b11 Compare July 13, 2026 10:25
@krystophny krystophny merged commit e451e0a into main Jul 13, 2026
6 checks passed
@krystophny krystophny deleted the fix/odeint-step-limit-status branch July 13, 2026 11:22
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

Successfully merging this pull request may close these issues.

1 participant