Skip to content
Projects

Distributed solve

The equations of patchwork.solvers.distributed, declared on the code that implements them and checked by the tests.

PetscSystem

classsource

Rows of a square sparse system on every rank, solved together with PETSc.

krylov
CG if symmetric, else GMRES,∥rk∥≤rtol ∥b∥ (10−10),ksp_max_it=2000\text{CG if symmetric, else GMRES}, \qquad \|r_k\| \le \texttt{rtol}\,\|b\| \ (10^{-10}), \quad \texttt{ksp\_max\_it} = 2000
preconditioner
M−1=BoomerAMG (hypre) if available, else GAMGM^{-1} = \text{BoomerAMG (hypre) if available, else GAMG}
fallback
on divergence: GMRES(100)+block Jacobi with ILU per block, from x0=0, 104 iterations\text{on divergence: GMRES}(100) + \text{block Jacobi with ILU per block, from } x_0 = 0, \ 10^4 \text{ iterations}
Assumes
  • each rank assembles the rows of the unknowns it owns, contiguous in the global numbering, into an MPIAIJ matrix
  • the previous solution is the initial guess (reset() zeroes it); the residual norm is PETSc's default for the method
  • options in code override the command line, which overrides the defaults; the solution is scattered to every rank
References