zoomy_jax.symsolver.hypre#
hypre through ctypes: FlexGMRES with one BoomerAMG V-cycle on the cell-block-scaled owned rows of
an operator; the JAX Chorin pressure solve on CPUs (pressure_linear_solver=LinearSolver.hypre,
zoomy_jax.symsolver.runtime). The library is the shared build of
containers/zoomy_amrex/build_hypre_cuda.sh cpu-env (or ZOOMY_HYPRE_LIB); it must link the
MPI that mpi4py uses.
References
Falgout, Yang 2002, https://doi.org/10.1007/3-540-47789-6_66
Henson, Yang 2002, https://doi.org/10.1016/S0168-9274(01)00115-5
Saad 1993, https://doi.org/10.1137/0914028
Module Contents#
Classes#
The owned rows of an operator on |
Functions#
The hypre shared library: |
|
Whether the hypre shared library exists. |
|
The hypre library, loaded and initialized once; ImportError when it is missing. |
Data#
API#
- zoomy_jax.symsolver.hypre.VERSION#
‘3.2.0’
- zoomy_jax.symsolver.hypre.PARCSR#
5555
- zoomy_jax.symsolver.hypre.STATS#
‘dict(…)’
- zoomy_jax.symsolver.hypre.library_path()#
The hypre shared library:
ZOOMY_HYPRE_LIB, else the cpu-env build underZOOMY_HYPRE_CACHE(default~/.cache/zoomy).
- zoomy_jax.symsolver.hypre.available()#
Whether the hypre shared library exists.
- zoomy_jax.symsolver.hypre.load()#
The hypre library, loaded and initialized once; ImportError when it is missing.
- class zoomy_jax.symsolver.hypre.BlockRows(comm, k, n_own, lo, rows, gcols, tol, restart, maxiter, rebuild=1, growth=2.0)#
The owned rows of an operator on
kunknowns per cell (rowc k + pof owned cellc), its columns by global unknown number, solved by hypre with matrix values given per call. Everyk x kblock of a (cell, stencil cell) pair must be present. Used byzoomy_jax.symsolver.runtime(pressure_linear_solver=LinearSolver.hypre).Args
comm: mpi4py communicator of the ranks (used as is; collective calls insolve)k: unknowns per celln_own: owned cells;lo: the global number of the firstrows,gcols: local row (< k n_own) and global column of every entrytol: target of the true relative residual|b - A x| / |b|restart,maxiter: FlexGMRES Krylov spacemin(restart, 50),restart * maxiteriterations at mostrebuild: rebuild the BoomerAMG hierarchy at least every this many solves (1: every solve; in between the lagged hierarchy preconditions the new matrix)growth: rebuild early once the iterations exceed this factor times those right after the last rebuild
Initialization
Index the
k x kblocks and the cell blocks; no hypre object yet.- solve(vals, b, transpose=False, nb=None)#
Solve
A x = b(transpose:A^T x = b) for the matrix valuesvalsand the owned right-hand sideb(global normnb, if known); collective oncomm. FlexGMRES onS = D^-1 A(Dthek x kcell blocks; transposed:S^T z = b,x = D^-T z) to 0.1tol, re-entered with a tighter tolerance until the true relative residual is belowtol.