Repository navigation
Description
Summary
While debugging the spherical Kramer benchmark, case1 with free-slip Nitsche boundary conditions failed on Gadi when the Stokes fieldsplit sub-solves used non-flexible Krylov methods. The failure is in the Schur/fieldsplit solve path for the internal-boundary/delta forcing case.
This was observed in the downstream spherical benchmark driver:
- benchmark script:
benchmarks/spherical/ex_stokes_kramer.pyingthyagi/UW3_Annulus_Spherical_Benchmarks - case:
case1 - parameters:
l=2,m=2,k=3,P2/P1,pcont=true - boundary mode:
-uw_freeslip_type nitsche - platform: Gadi, OpenMPI/PETSc UW3 environment
Observed failures
The original solver path used fieldsplit_velocity_ksp_type=fcg and left the pressure fieldsplit KSP on PETSc/default settings. For case1 this failed on Gadi.
Observed failure modes:
fcgfieldsplit subsolve failed with PETSc reporting an indefinite matrix /DIVERGED_PC_FAILEDpath.gmresavoided the FCG indefinite-matrix failure, but failed with a GMRES residual-recursion mismatch on Gadi.- The same configuration can converge on macOS, so this is not simply a benchmark-formulation failure or a broken PETSc install. It appears to be a robustness issue exposed by the Gadi partitioning, multigrid, and Schur fieldsplit path.
The issue is specific to the combination that stresses the fieldsplit solve:
- free-slip Nitsche boundaries
- Kramer
case1internal-boundary/delta forcing - Schur fieldsplit Stokes solve
Other nearby cases were checked:
case2free-slip Nitsche + smooth forcing converged.case3no-slip essential + internal-boundary/delta forcing converged.case4no-slip essential + smooth forcing converged.
This isolates the problematic path to free-slip Nitsche plus the internal-boundary/delta forcing case, rather than all Nitsche runs or all internal-boundary runs.
Validated fix
A debug version of the Kramer benchmark was run with flexible GMRES for both velocity and pressure fieldsplit sub-solves:
fieldsplit_velocity_ksp_type = fgmres
fieldsplit_velocity_ksp_pc_side = right
fieldsplit_velocity_ksp_max_it = 200
fieldsplit_pressure_ksp_type = fgmres
fieldsplit_pressure_ksp_pc_side = right
fieldsplit_pressure_ksp_max_it = 200
Gadi results for case1, l=2, m=2, free-slip Nitsche:
| cellsize | CPUs | exit | SNES reason | KSP reason | SNES iters | KSP iters | final true residual ratio | memory used | walltime |
|---|---|---|---|---|---|---|---|---|---|
1/8 |
8 | 0 | 5 | 2 | 1 | 1 | 5.3887e-07 |
7.14GB |
00:04:26 |
1/16 |
32 | 0 | 5 | 2 | 1 | 1 | 3.4574e-08 |
40.42GB |
00:25:59 |
1/32 |
144 | 0 | 5 | 2 | 1 | 1 | 3.5783e-09 |
308.53GB |
00:23:59 |
The .e logs for these successful FGMRES runs contain only OpenMPI LOG_CAT_ML warnings and no PETSc solver error.
Downstream benchmark fix
The downstream benchmark fix is to use FGMRES only for free-slip Nitsche fieldsplit sub-solves:
- keep the existing outer
ksp_type=fgmres - keep existing velocity GAMG/Kaskade settings
- for
freeslip and uw_freeslip_type == "nitsche":- set velocity fieldsplit KSP to
fgmres - set pressure fieldsplit KSP to
fgmres - use right preconditioning for both
- set a bounded subsolve max iteration count
- set velocity fieldsplit KSP to
- leave penalty and essential cases on their previous settings
This keeps the change targeted to the unstable solver path while preserving existing behaviour for cases that were already stable.
Request
This issue is to document the solver robustness problem and the validated downstream fix. It may also be useful for UW3 examples/defaults: Nitsche free-slip Stokes problems using Schur fieldsplit preconditioning can require flexible fieldsplit subsolves, especially when the preconditioner is effectively variable due to multigrid/coarse-grid behaviour.
Activity
Default Stokes velocity subsolve to FGMRES (#147)
lmoresi commentedon Apr 28, 2026
@gthyagi — proposed UW3-side fix in PR #149.
Credit for this one is yours: you found the failure mode, isolated the trigger conditions (free-slip Nitsche + Schur fieldsplit + internal-boundary delta forcing on Gadi), and validated FGMRES as the working configuration up to np=144 / cellsize=1/32. PR #149 just promotes that configuration to the UW3 default so other users hit the working path automatically — the analytical and validation work that made the fix possible was all done in this issue.
What PR #149 does
Reset path (in case it's useful for downstream code):
Diagnosis summary (so it's recorded alongside the fix)
The Schur fieldsplit's velocity preconditioner is GAMG with bounded but variable-iteration `mg_levels` solves (`mg_levels_ksp_max_it=3`, `_converged_maxits=true`). That makes the preconditioner application non-linear. CG/FCG and standard GMRES build their residual recurrence assuming a linear preconditioner, so under non-stationary preconditioning the recurrence drifts from the true residual. Layered on top: GAMG can produce weakly-indefinite coarse operators on partition-stressed problems with sharp internal sources (which is exactly Kramer case1's internal-boundary delta forcing), and CG/FCG report this as DIVERGED_PC_FAILED. FGMRES fixes both — it stores the preconditioned vectors explicitly (no m-term recurrence) and tolerates a weakly-indefinite preconditioner application.
Notably this is not about Nitsche introducing asymmetry — UW3's Nitsche default is symmetric (`theta=1`). The non-stationarity comes from GAMG, which is why the same fix works for all Stokes problems, not just Nitsche ones.
Once #149 lands I'll close this issue. Thanks for the careful at-scale validation work that made it cheap to land.
Underworld development team with AI support from Claude Code
Merge pull request #149 from underworldcode/bugfix/stokes-fgmres-defa…
lmoresi commentedon Apr 28, 2026
Fixed in #149 (merged to development at 575d0d8). Credit to @gthyagi for diagnosing the failure mode and validating the FGMRES configuration at scale on Gadi. Closing manually since the PR merged to development, not main.
solvers: adopt native sub-solve tolerances on the rotated path; docum…
The Stokes OUTER Krylov is fgmres: the flexible-outer rule reached th…
Fault ribbons from the fault's own surface, and the fault-patch multi…
3-D fault networks in parallel: one redistribution for the whole netw…