Skip to content

feat: Improve linear solvers testing - #4108

Open
victorapm wants to merge 8 commits into
developfrom
feature/paludettomag1/hypredrive-testing
Open

feat: Improve linear solvers testing#4108
victorapm wants to merge 8 commits into
developfrom
feature/paludettomag1/hypredrive-testing

Conversation

@victorapm

@victorapm victorapm commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

This PR adds hypre/hypredrive tests to the regression suite. It adds _mgr smoke decks covering 25 out of 27 MGR strategies (mostly derived from existing decks by switching their direct solver to gmres+MGR; 25 registered in ATS). Baselines for these tests are always generated by ENABLE_HYPREDRV=OFF builds, so on a hypredrive-enabled build the same tests double as an equivalence check between the hypredrive and legacy hypre paths.

Some additional details:

  1. Add a rank-0 warning when hypredrive silently falls back to the legacy hypre-only path, ats_run_force_legacy CMake target (GEOS_HYPREDRV_FORCE_LEGACY=1 re-run against the same baselines), unit tests asserting numerical parity of both pure hypre and hypredrive paths,
  2. scripts/compareLinearSolverIterations.py assert iteration-count parity (so a quality regression with a still-correct answer cannot pass silently)
  3. CI plumbing (--enable-hypredrv, a GEOS_REQUIRE_HYPREDRV configure-time guard, and a hypredrive+legacy double pass in the integrated-tests job)
  4. Improvements to developer documentation.

Building these tests surfaced and fixed several real bugs:

  1. HypredriveSolver ran hypre preconditioner setup without the FPE guard the legacy path has always used, crashing a few test problems
  2. The generated ILU YAML omitted the local-reordering setting, silently configuring a different preconditioner than the legacy path.
  3. contact solvers assigned their MGR strategy after the base class had already downgraded mgr to amg, making MGR unreachable for the whole contact family. This needs further work on an upcoming PR.
  4. SinglePhaseReservoirHybridFVM had an inverted areWellsShut conditional, applying weak Jacobi relaxation to active well blocks;
  5. both compositional hybrid-FVM recipes were structurally invalid (True-IMPES restriction with face dofs in the C-space, segfaulting in hypre) and are rewritten as cell-block condensation reductions, backed by new MGRFRelaxationType::ilu support and an explicitly configured ILU F-solver (setILUFSolverAtLevel) so both paths use identical F-relaxation.

Known limitations:

  1. Two strategies (singlePhasePoromechanicsConformingFractures, thermalSinglePhasePoromechanicsReservoirFVM) have working decks included but not yet registered, pending cross-path tolerance calibration;
  2. The ALM_TFrac MGR recipe hits the iteration cap on its first few solves on both paths (pre-existing, flagged by the parity checker)
  3. Baselines for the new tests must be generated after merge via the usual rebaseline workflow (from an ENABLE_HYPREDRV=OFF` build).

Depends on GEOS-DEV/thirdPartyLibs#357

@victorapm victorapm self-assigned this Aug 1, 2026
@victorapm victorapm added ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI ci: run code coverage enables running of the code coverage CI jobs labels Aug 2, 2026
@victorapm victorapm changed the title [WIP] Improve linear solvers testing feat: Improve linear solvers testing Aug 2, 2026
@victorapm
victorapm marked this pull request as ready for review August 2, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci: run code coverage enables running of the code coverage CI jobs ci: run CUDA builds Allows to triggers (costly) CUDA jobs ci: run integrated tests Allows to run the integrated tests in GEOS CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant