phase 1: close the solver-choice gap (#256)#257
Merged
jameslehoux merged 1 commit intomasterfrom Apr 20, 2026
Merged
Conversation
Addresses the "potential vs what Colab users see" gap from the profiling notebook by making the already-implemented fast solvers reachable from Python and by wiring TinyProfiler capture into the wheel CI. B.1 — Expose HYPRE preconditioner choice to Python The C++ side already runs PCG/GMRES with SMG or PFMG as preconditioner (HypreStructSolver.cpp), but Python callers were locked to SMG. Adds a PrecondType enum binding and a new `preconditioner=` kwarg on oi.tortuosity(), defaulting to "smg" for backward compatibility. The PCG+PFMG combination is now reachable — the textbook-best pairing for Poisson-like problems and the one expected to overtake plain PCG as N grows. B.3 — Expose MLMG tuning knobs TortuosityMLMG now takes eps / maxiter / max_coarsening_level as ctor arguments with the same defaults as before. ParmParse [mlmg] block still overrides at runtime so the CLI path is unchanged. Facade surfaces these as mlmg_eps / mlmg_maxiter / mlmg_max_coarsening_level kwargs. C.1 — OPENIMPALA_ENABLE_TINY_PROFILE CMake option Defines AMREX_TINY_PROFILE at compile time when enabled. Both wheel workflows (CPU manylinux_2_28 and GPU manylinux_2_34_cuda) now build AMReX with AMReX_TINY_PROFILE=ON and pass the flag through SKBUILD_CMAKE_ARGS, so BL_PROFILE tables will render in wheel builds. AMReX cache keys bumped to force a rebuild. Notebook §9 — solver comparison Expanded from 4 standalone solvers to 10 combos including PCG+PFMG, GMRES+PFMG, FlexGMRES+PFMG, and MLMG. Has a TypeError fallback so older pip wheels that predate the `preconditioner` kwarg still partially run. Overlays iteration counts on a twin axis — a solver with few iterations but expensive per-iter cost (multigrid) can still be the right choice at larger N. https://claude.ai/code/session_011dJ5Bwq4Tnr8wxH597XJFf
Performance Benchmark Results
Fastest solver: bicgstab at 64³ (0.4023s) Benchmark: uniform block (analytical τ = (N-1)/N) |
Code Coverage ReportGenerated by CI — coverage data from gcovr |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses the "potential vs what Colab users see" gap from the profiling notebook by making the already-implemented fast solvers reachable from Python and by wiring TinyProfiler capture into the wheel CI.
B.1 — Expose HYPRE preconditioner choice to Python
The C++ side already runs PCG/GMRES with SMG or PFMG as preconditioner
(HypreStructSolver.cpp), but Python callers were locked to SMG. Adds a
PrecondType enum binding and a new
preconditioner=kwarg onoi.tortuosity(), defaulting to "smg" for backward compatibility. The
PCG+PFMG combination is now reachable — the textbook-best pairing for
Poisson-like problems and the one expected to overtake plain PCG as N
grows.
B.3 — Expose MLMG tuning knobs
TortuosityMLMG now takes eps / maxiter / max_coarsening_level as ctor
arguments with the same defaults as before. ParmParse [mlmg] block still
overrides at runtime so the CLI path is unchanged. Facade surfaces these
as mlmg_eps / mlmg_maxiter / mlmg_max_coarsening_level kwargs.
C.1 — OPENIMPALA_ENABLE_TINY_PROFILE CMake option
Defines AMREX_TINY_PROFILE at compile time when enabled. Both wheel
workflows (CPU manylinux_2_28 and GPU manylinux_2_34_cuda) now build
AMReX with AMReX_TINY_PROFILE=ON and pass the flag through
SKBUILD_CMAKE_ARGS, so BL_PROFILE tables will render in wheel builds.
AMReX cache keys bumped to force a rebuild.
Notebook §9 — solver comparison
Expanded from 4 standalone solvers to 10 combos including PCG+PFMG,
GMRES+PFMG, FlexGMRES+PFMG, and MLMG. Has a TypeError fallback so older
pip wheels that predate the
preconditionerkwarg still partially run.Overlays iteration counts on a twin axis — a solver with few iterations
but expensive per-iter cost (multigrid) can still be the right choice
at larger N.
https://claude.ai/code/session_011dJ5Bwq4Tnr8wxH597XJFf