Skip to content

Fix missing needs_concrete_A dispatch for HYPREAlgorithm#1115

Open
AJ0070 wants to merge 1 commit into
SciML:mainfrom
AJ0070:fix/277
Open

Fix missing needs_concrete_A dispatch for HYPREAlgorithm#1115
AJ0070 wants to merge 1 commit into
SciML:mainfrom
AJ0070:fix/277

Conversation

@AJ0070

@AJ0070 AJ0070 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

HYPREAlgorithm directly subtypes SciMLLinearSolveAlgorithm, so needs_concrete_A(::HYPREAlgorithm) was undefined. Downstream solvers (NonlinearSolveBase, OrdinaryDiffEq) call this trait for any SciMLLinearSolveAlgorithm, causing a MethodError and (with the old solve(cache) ↔ solve(cache, cache.alg) chain) a stack overflow when HYPRE is used as linsolve (#277).

  • ext/LinearSolveHYPREExt.jl: add needs_concrete_A(::HYPREAlgorithm) = true and update_tolerances_internal!.
  • src/extension_algs.jl: fix docstring — Pl is a solve/init keyword, not a constructor kwarg.
  • test/LinearSolveHYPRE/hypretests.jl: tests for the trait and update_tolerances!.

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the contributor guidelines, in particular the SciML Style Guide and COLPRAC.
  • Any new documentation only uses public API

Additional context

Fixes #277. The downstream path (needs_concrete_A → concrete WLinearProbleminitsolve! → update A/bsolve!) and the full test/LinearSolveHYPRE/hypretests.jl suite pass.

AI Disclosure: Kimi K3

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.

Using HYPRE solver in DifferentialEquations.jl causes stack overflow

1 participant