Skip to content

fix: return non-zero status on solver errors - #83

Merged
msleigh merged 2 commits into
mainfrom
fix/nonzero-error-exits
Nov 14, 2026
Merged

msleigh merged 2 commits into
mainfrom
fix/nonzero-error-exits

Conversation

@msleigh

@msleigh msleigh commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • replace every bare STOP in snes.f90 and readline.f90 with STOP 1, so input, data, and allocation errors return a non-zero exit status
  • add an errstat argument to iterate and abort with STOP 1 when outers do not converge, the fission source is zero everywhere, or inners do not converge in a fixed-source run
  • make qa/jcf record the solver's exit status, still write qa/<test>.out, and then exit with that status, so a failed test keeps its diagnostics
  • fix the "Aborting,.." typo

Unconverged runs now stop before writing flux output, where previously they carried on.

Fixed-source runs leave the outer loop with outer_exit_stat = -1, so they are unaffected; the zero-fission check only applies to eigenvalue runs.

Testing

  • make tests and make testl: build cleanly and pass
  • snestp001 with imaxouter 1 (SNEL): prints "Convergence not achieved within 1 outer iterations" and exits 1
  • the same run through qa/jcf: exits 1 and writes the .out file with the solver messages
  • pre-commit run --files qa/jcf (shellcheck): pass

🤖 Generated with Claude Code

Propagate iteration failures so scripts and CI can detect unsuccessful runs.
With non-zero exit codes from the solver, set -e made jcf exit before
writing qa/<test>.out, leaving the diagnostics in a temporary directory.
Record the solver's status, write the output as usual, then exit with it.
@msleigh
msleigh merged commit 6c8bc27 into main Nov 14, 2026
4 checks passed
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