FrontISTR  5.9.0
Large-scale structural analysis program with finit element method
hecmw_precond_saamg_smoother Module Reference

Smoothed Aggregation AMG preconditioner : smoother building blocks. More...

Functions/Subroutines

subroutine, public hecmw_saamg_blockdiag_setup (A, D)
 Extract the nb x nb diagonal blocks of A, keep them, and store the explicit inverse D_i^{-1} of each via the BLAS-free block_inverse. Reads the block-CSR storage directly: the diagonal block of node inode is the stored block with bcol == inode (square operator, nb == mb), copied verbatim. The inverse is applied later as a small dense matmul (no per-block LAPACK call) AND computed here without LAPACK, so the whole block-diagonal setup is BLAS-free: no nested BLAS threading under OpenMP, and offloadable to OpenACC (no host-LAPACK call). Blocks are tiny (nb = 1/3/6) and well-conditioned (nodal stiffness diagonal). More...
 
subroutine, public hecmw_saamg_blockdiag_apply (D, x, y)
 Apply y = D^{-1} x (block-wise small dense matmul against the stored inverse). More...
 
subroutine, public hecmw_saamg_blockdiag_apply_bcsr (D, C, DC)
 Apply DC = D^{-1} C block-row-wise to a block-CSR matrix C (reusing the stored block LU). Each node block's nb rows are solved together by one multi-RHS triangular solve over the union of their columns, so a column present in any row of the block receives all nb output entries. Used for the SpGEMM-based prolongator smoothing P = P-hat - omega D^{-1}(A P-hat). More...
 
subroutine, public hecmw_saamg_blockdiag_apply_bcsr_inplace (D, C)
 Apply C <- D^{-1} C in place (each nb x mb block solved against the node's LU). Same as blockdiag_apply_bcsr but overwrites C, avoiding a full second operator (important for the large level-1 A P-hat product). More...
 
subroutine, public hecmw_saamg_blockdiag_matvec (D, x, y)
 Apply y = D x (block-wise dense matvec using the original blocks). More...
 
subroutine, public hecmw_saamg_blockdiag_free (D)
 
real(kind=kreal) function, public hecmw_saamg_tridiag_max_eig (diag, offd, m)
 Largest eigenvalue of a symmetric tridiagonal matrix (diagonal diag(1:m), sub/super-diagonal offd(1:m-1)) via LAPACK dsterf. Used by the Lanczos lambda_max estimators. Falls back to the largest diagonal entry (a Rayleigh quotient, hence a lower bound) if dsterf fails to converge. More...
 
real(kind=kreal) function, public hecmw_saamg_lanczos_lambda_max (A, D, niter)
 Estimate lambda_max(D^{-1}A) by D-inner-product Lanczos. M = D^{-1}A is self-adjoint in <u,v>_D = u^T D v, so a niter-step Lanczos builds a Krylov tridiagonal T whose largest eigenvalue (Ritz value) approximates lambda_max. Lanczos converges to the extreme eigenvalues far faster than power iteration, so a short run gives a reliable estimate even on large/ill-separated spectra (where power iteration underestimates and the Chebyshev smoother turns indefinite). Returns the RAW estimate; callers apply the safety factor. More...
 
subroutine, public hecmw_saamg_cheb_setup (lambda_hat, deg, alpha, cheb)
 Set Chebyshev interval [lmax/alpha, lmax] with lmax = 1.1 * lambda_hat. lambda_hat is the (already safety-scaled) shared estimate. More...
 
subroutine, public hecmw_saamg_cheb_apply_local (A, D, cheb, b, x, zero_init)
 Apply the Chebyshev smoother: x <- x + p_k(D^{-1}A)(b - A x). zero_init = .true. assumes x=0 on entry (skips the initial matvec). More...
 

Detailed Description

Smoothed Aggregation AMG preconditioner : smoother building blocks.

Provides, for one level:

  • the node-block diagonal preconditioner D (each nb x nb block inverted explicitly by the BLAS-free block_inverse; nb=1/2/3 use closed forms) – handles indefinite blocks (u-p) too; the original blocks are kept so that the action y = D x is also available;
  • a D-inner-product Lanczos estimate of lambda_max(D^{-1} A) (largest Ritz value of the Krylov tridiagonal), with a fixed-seed start for reproducibility (callers apply the safety factor);
  • the Chebyshev smoother (fixed polynomial of D^{-1}A), whose action is matvec + block-diagonal solves only (no sequential dependence -> MPI-safe).

lambda_max is computed once per level and shared by the prolongator smoothing (omega) and the Chebyshev interval.

Function/Subroutine Documentation

◆ hecmw_saamg_blockdiag_apply()

subroutine, public hecmw_precond_saamg_smoother::hecmw_saamg_blockdiag_apply ( type(hecmwst_saamg_blockdiag), intent(in)  D,
real(kind=kreal), dimension(:), intent(in)  x,
real(kind=kreal), dimension(:), intent(out)  y 
)

Apply y = D^{-1} x (block-wise small dense matmul against the stored inverse).

Definition at line 191 of file hecmw_precond_SAAMG_smoother.F90.

Here is the caller graph for this function:

◆ hecmw_saamg_blockdiag_apply_bcsr()

subroutine, public hecmw_precond_saamg_smoother::hecmw_saamg_blockdiag_apply_bcsr ( type(hecmwst_saamg_blockdiag), intent(in)  D,
type(hecmwst_saamg_bcsr), intent(in)  C,
type(hecmwst_saamg_bcsr), intent(out)  DC 
)

Apply DC = D^{-1} C block-row-wise to a block-CSR matrix C (reusing the stored block LU). Each node block's nb rows are solved together by one multi-RHS triangular solve over the union of their columns, so a column present in any row of the block receives all nb output entries. Used for the SpGEMM-based prolongator smoothing P = P-hat - omega D^{-1}(A P-hat).

Definition at line 230 of file hecmw_precond_SAAMG_smoother.F90.

Here is the call graph for this function:

◆ hecmw_saamg_blockdiag_apply_bcsr_inplace()

subroutine, public hecmw_precond_saamg_smoother::hecmw_saamg_blockdiag_apply_bcsr_inplace ( type(hecmwst_saamg_blockdiag), intent(in)  D,
type(hecmwst_saamg_bcsr), intent(inout)  C 
)

Apply C <- D^{-1} C in place (each nb x mb block solved against the node's LU). Same as blockdiag_apply_bcsr but overwrites C, avoiding a full second operator (important for the large level-1 A P-hat product).

Definition at line 277 of file hecmw_precond_SAAMG_smoother.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hecmw_saamg_blockdiag_free()

subroutine, public hecmw_precond_saamg_smoother::hecmw_saamg_blockdiag_free ( type(hecmwst_saamg_blockdiag), intent(inout)  D)

Definition at line 335 of file hecmw_precond_SAAMG_smoother.F90.

Here is the caller graph for this function:

◆ hecmw_saamg_blockdiag_matvec()

subroutine, public hecmw_precond_saamg_smoother::hecmw_saamg_blockdiag_matvec ( type(hecmwst_saamg_blockdiag), intent(in)  D,
real(kind=kreal), dimension(:), intent(in)  x,
real(kind=kreal), dimension(:), intent(out)  y 
)

Apply y = D x (block-wise dense matvec using the original blocks).

Definition at line 312 of file hecmw_precond_SAAMG_smoother.F90.

Here is the caller graph for this function:

◆ hecmw_saamg_blockdiag_setup()

subroutine, public hecmw_precond_saamg_smoother::hecmw_saamg_blockdiag_setup ( type(hecmwst_saamg_bcsr), intent(in)  A,
type(hecmwst_saamg_blockdiag), intent(out)  D 
)

Extract the nb x nb diagonal blocks of A, keep them, and store the explicit inverse D_i^{-1} of each via the BLAS-free block_inverse. Reads the block-CSR storage directly: the diagonal block of node inode is the stored block with bcol == inode (square operator, nb == mb), copied verbatim. The inverse is applied later as a small dense matmul (no per-block LAPACK call) AND computed here without LAPACK, so the whole block-diagonal setup is BLAS-free: no nested BLAS threading under OpenMP, and offloadable to OpenACC (no host-LAPACK call). Blocks are tiny (nb = 1/3/6) and well-conditioned (nodal stiffness diagonal).

Definition at line 70 of file hecmw_precond_SAAMG_smoother.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hecmw_saamg_cheb_apply_local()

subroutine, public hecmw_precond_saamg_smoother::hecmw_saamg_cheb_apply_local ( type(hecmwst_saamg_bcsr), intent(in)  A,
type(hecmwst_saamg_blockdiag), intent(in)  D,
type(hecmwst_saamg_chebyshev), intent(in)  cheb,
real(kind=kreal), dimension(:), intent(in)  b,
real(kind=kreal), dimension(:), intent(inout)  x,
logical, intent(in)  zero_init 
)

Apply the Chebyshev smoother: x <- x + p_k(D^{-1}A)(b - A x). zero_init = .true. assumes x=0 on entry (skips the initial matvec).

Definition at line 444 of file hecmw_precond_SAAMG_smoother.F90.

Here is the call graph for this function:

◆ hecmw_saamg_cheb_setup()

subroutine, public hecmw_precond_saamg_smoother::hecmw_saamg_cheb_setup ( real(kind=kreal), intent(in)  lambda_hat,
integer(kind=kint), intent(in)  deg,
real(kind=kreal), intent(in)  alpha,
type(hecmwst_saamg_chebyshev), intent(out)  cheb 
)

Set Chebyshev interval [lmax/alpha, lmax] with lmax = 1.1 * lambda_hat. lambda_hat is the (already safety-scaled) shared estimate.

Definition at line 427 of file hecmw_precond_SAAMG_smoother.F90.

Here is the caller graph for this function:

◆ hecmw_saamg_lanczos_lambda_max()

real(kind=kreal) function, public hecmw_precond_saamg_smoother::hecmw_saamg_lanczos_lambda_max ( type(hecmwst_saamg_bcsr), intent(in)  A,
type(hecmwst_saamg_blockdiag), intent(in)  D,
integer(kind=kint), intent(in)  niter 
)

Estimate lambda_max(D^{-1}A) by D-inner-product Lanczos. M = D^{-1}A is self-adjoint in <u,v>_D = u^T D v, so a niter-step Lanczos builds a Krylov tridiagonal T whose largest eigenvalue (Ritz value) approximates lambda_max. Lanczos converges to the extreme eigenvalues far faster than power iteration, so a short run gives a reliable estimate even on large/ill-separated spectra (where power iteration underestimates and the Chebyshev smoother turns indefinite). Returns the RAW estimate; callers apply the safety factor.

Definition at line 380 of file hecmw_precond_SAAMG_smoother.F90.

Here is the call graph for this function:

◆ hecmw_saamg_tridiag_max_eig()

real(kind=kreal) function, public hecmw_precond_saamg_smoother::hecmw_saamg_tridiag_max_eig ( real(kind=kreal), dimension(:), intent(in)  diag,
real(kind=kreal), dimension(:), intent(in)  offd,
integer(kind=kint), intent(in)  m 
)

Largest eigenvalue of a symmetric tridiagonal matrix (diagonal diag(1:m), sub/super-diagonal offd(1:m-1)) via LAPACK dsterf. Used by the Lanczos lambda_max estimators. Falls back to the largest diagonal entry (a Rayleigh quotient, hence a lower bound) if dsterf fails to converge.

Definition at line 351 of file hecmw_precond_SAAMG_smoother.F90.

Here is the caller graph for this function: