Skip to content

util/hybrj: invalid xtol currently hard-aborts instead of returning solver status #1961

@zingale

Description

@zingale

Summary

For invalid xtol (xtol < 0), hybrj calls amrex::Error, which aborts execution. This differs from MINPACK-style status reporting and makes the solver harder to integrate in robust workflows.

Affected code

  • util/hybrj/hybrj.H: input validation path for xtol

Why this is a problem

A hard abort bypasses normal solver error handling and can terminate larger applications unexpectedly.

Expected behavior

The solver should return a non-success info code (e.g., improper input) and exit cleanly without process termination.

Suggested fix

  • Replace hard abort with status-based return (info = 0 / dedicated bad-input code).
  • Keep behavior consistent with other termination paths that set info and return.

Acceptance criteria

  • Invalid xtol does not abort process.
  • Caller can observe and handle the returned status code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-code-auditAI-generated code audit findings

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions