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

Smoothed Aggregation AMG preconditioner : internal block-CSR matrix. More...

Functions/Subroutines

subroutine, public hecmw_saamg_bcsr_free (A)
 Release the storage held by a hecmwST_saamg_bcsr. More...
 
subroutine, public hecmw_saamg_bcsr_copy (A, B)
 Copy: B = A. More...
 
subroutine, public hecmw_saamg_bcsr_move (A, B)
 Move: B = A, transferring A's storage (move_alloc, no copy); A is emptied. Use when the source is no longer needed – avoids holding the operator twice. More...
 
subroutine, public hecmw_saamg_bcsr_from_dense (dense, n, nb, A, mb)
 Build a block-CSR matrix from a dense n x n array. A block is stored when any of its entries is nonzero (the full nb x mb block is kept, in-block zeros and all). Intended for unit tests and small reference matrices, not production. More...
 
subroutine, public hecmw_saamg_matvec (A, x, y)
 Sparse matrix-vector product : y = A x. More...
 
subroutine, public hecmw_saamg_matvec_d (cmt, A, x, y)
 Distributed matvec y = A x : refresh x's halo region from the owning ranks (via the level comm table), then run the local product. x must have length nb*nnode (internal + halo room); y has length An = nb*nint (internal rows). Reduces to hecmw_saamg_matvec when the comm table has no neighbors (serial). More...
 
real(kind=kreal) function, public hecmw_saamg_is_symmetric (A)
 Relative asymmetry ||A - A^T||_F / ||A||_F (debug / verification helper). Returns 0 for a structurally and numerically symmetric matrix. Square only. More...
 
subroutine, public hecmw_saamg_bcsr_from_triplets (nrow, ncol, nb, ti, tj, tv, nt, A, mb)
 Assemble a block-CSR (nrow x ncol) from a scalar triplet list (i,j,v): each entry is scattered into its block (block row (i-1)/nb+1, block col (j-1)/mb+1, in-block position), duplicate entries summed. Used by the distributed operator assembly (routed scalar triplets -> owned block rows). More...
 
subroutine, public hecmw_saamg_bcsr_from_block_triplets (nbrow, nbcol, nb, mb, bi, bj, bv, nt, A)
 Assemble a block-CSR (nbrow x nbcol block grid, nb x mb blocks) from a list of block triplets (bi, bj, block); duplicate (bi,bj) blocks are summed. Each block bv(:,t) is the nb*mb column-major entries of block t. The block-native assembler used by the operator producers (adapter, tentative, smoothed prolongator). More...
 
subroutine, public hecmw_saamg_bcsr_transpose (A, At)
 Transpose: At = A^T (At is ncol x n). More...
 
subroutine, public hecmw_saamg_spgemm (A, B, C)
 Sparse matrix-matrix product C = A * B. Requires Amb == Bnb. More...
 
subroutine, public hecmw_saamg_galerkin_local (A, P, mblk, Ac)
 Galerkin coarse operator Ac = P^T A P. mblk = coarse block size. More...
 
subroutine, public hecmw_saamg_bcsr_to_dense (A, dense)
 Densify a matrix into a (n x ncol) array (verification helper). More...
 
subroutine, public hecmw_saamg_to_dense_blk (A, dense)
 Densify from the block-CSR storage. More...
 
subroutine, public hecmw_saamg_matvec_blk (A, x, y)
 Block matvec y = A x (x indexed by column blocks, y by row blocks). More...
 
subroutine, public hecmw_saamg_transpose_blk (A, At)
 Block transpose At = A^T : swap block dims and transpose each block. More...
 
subroutine, public hecmw_saamg_spgemm_blk (A, B, C)
 Block SpGEMM C = A * B : block Gustavson with dense block GEMM accumulation. Requires Amb == Bnb (inner block dimension). More...
 
subroutine, public hecmw_saamg_galerkin_blk (A, P, mblk, Ac)
 Block Galerkin Ac = P^T A P (block transpose + two block SpGEMM). mblk = coarse block size, tagged on Acnb / Acmb. More...
 
subroutine, public hecmw_saamg_transpose_blk_rows (A, nbrow_keep, At)
 Transpose only the first nbrow_keep block rows of A : At = (A[1:nbrow_keep])^T. Used to form the restriction P^T from the internal rows of the halo-extended prolongator without first copying out those rows. More...
 
subroutine, public hecmw_saamg_triple_blk (L, A, R, Ac)
 FUSED block triple product Ac = L * A * R, computed WITHOUT materializing the intermediate A*R (or L*A): the i -> j(L) -> k(A) -> l(R) loop accumulates the block products L(i,j) A(j,k) R(k,l) directly into Ac(i,l) (modelled on the FrontISTR T^t K T product). Only a small per-(i,j,k) temporary L*A is held, so the large A*R intermediate is never formed – critical for the level-1 Galerkin P^T A P on huge meshes. Requires Lmb==Anb, Amb==Rnb (and matching counts). More...
 

Detailed Description

Smoothed Aggregation AMG preconditioner : internal block-CSR matrix.

Mesh-independent block-CSR matrix used at every level of the SA-AMG hierarchy. Each stored nonzero is an nb x mb block (column major), with nb = row-block size (dofs per row node) and mb = column-block size (dofs per column node). For a square operator nb == mb; for a prolongator P the row block is the fine node size and the column block is the coarse near-kernel size m (nb /= mb). matvec, SpGEMM, transpose and the Galerkin product all run as block algorithms, so the node-block structure is exploited directly (dense per-block GEMM/GEMV). Indices are 1-based to match Fortran/FrontISTR conventions.

Function/Subroutine Documentation

◆ hecmw_saamg_bcsr_copy()

subroutine, public hecmw_precond_saamg_matrix::hecmw_saamg_bcsr_copy ( type(hecmwst_saamg_bcsr), intent(in)  A,
type(hecmwst_saamg_bcsr), intent(out)  B 
)

Copy: B = A.

Definition at line 74 of file hecmw_precond_SAAMG_matrix.F90.

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

◆ hecmw_saamg_bcsr_free()

subroutine, public hecmw_precond_saamg_matrix::hecmw_saamg_bcsr_free ( type(hecmwst_saamg_bcsr), intent(inout)  A)

Release the storage held by a hecmwST_saamg_bcsr.

Definition at line 63 of file hecmw_precond_SAAMG_matrix.F90.

Here is the caller graph for this function:

◆ hecmw_saamg_bcsr_from_block_triplets()

subroutine, public hecmw_precond_saamg_matrix::hecmw_saamg_bcsr_from_block_triplets ( integer(kind=kint), intent(in)  nbrow,
integer(kind=kint), intent(in)  nbcol,
integer(kind=kint), intent(in)  nb,
integer(kind=kint), intent(in)  mb,
integer(kind=kint), dimension(:), intent(in)  bi,
integer(kind=kint), dimension(:), intent(in)  bj,
real(kind=kreal), dimension(:,:), intent(in)  bv,
integer(kind=kint), intent(in)  nt,
type(hecmwst_saamg_bcsr), intent(out)  A 
)

Assemble a block-CSR (nbrow x nbcol block grid, nb x mb blocks) from a list of block triplets (bi, bj, block); duplicate (bi,bj) blocks are summed. Each block bv(:,t) is the nb*mb column-major entries of block t. The block-native assembler used by the operator producers (adapter, tentative, smoothed prolongator).

Definition at line 312 of file hecmw_precond_SAAMG_matrix.F90.

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

◆ hecmw_saamg_bcsr_from_dense()

subroutine, public hecmw_precond_saamg_matrix::hecmw_saamg_bcsr_from_dense ( real(kind=kreal), dimension(n,n), intent(in)  dense,
integer(kind=kint), intent(in)  n,
integer(kind=kint), intent(in)  nb,
type(hecmwst_saamg_bcsr), intent(out)  A,
integer(kind=kint), intent(in), optional  mb 
)

Build a block-CSR matrix from a dense n x n array. A block is stored when any of its entries is nonzero (the full nb x mb block is kept, in-block zeros and all). Intended for unit tests and small reference matrices, not production.

Parameters
[in]mbcolumn-block size (default nb)

Definition at line 107 of file hecmw_precond_SAAMG_matrix.F90.

Here is the call graph for this function:

◆ hecmw_saamg_bcsr_from_triplets()

subroutine, public hecmw_precond_saamg_matrix::hecmw_saamg_bcsr_from_triplets ( integer(kind=kint), intent(in)  nrow,
integer(kind=kint), intent(in)  ncol,
integer(kind=kint), intent(in)  nb,
integer(kind=kint), dimension(:), intent(in)  ti,
integer(kind=kint), dimension(:), intent(in)  tj,
real(kind=kreal), dimension(:), intent(in)  tv,
integer(kind=kint), intent(in)  nt,
type(hecmwst_saamg_bcsr), intent(out)  A,
integer(kind=kint), intent(in), optional  mb 
)

Assemble a block-CSR (nrow x ncol) from a scalar triplet list (i,j,v): each entry is scattered into its block (block row (i-1)/nb+1, block col (j-1)/mb+1, in-block position), duplicate entries summed. Used by the distributed operator assembly (routed scalar triplets -> owned block rows).

Parameters
[in]mbcolumn-block size (default nb)

Definition at line 231 of file hecmw_precond_SAAMG_matrix.F90.

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

◆ hecmw_saamg_bcsr_move()

subroutine, public hecmw_precond_saamg_matrix::hecmw_saamg_bcsr_move ( type(hecmwst_saamg_bcsr), intent(inout)  A,
type(hecmwst_saamg_bcsr), intent(out)  B 
)

Move: B = A, transferring A's storage (move_alloc, no copy); A is emptied. Use when the source is no longer needed – avoids holding the operator twice.

Definition at line 91 of file hecmw_precond_SAAMG_matrix.F90.

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

◆ hecmw_saamg_bcsr_to_dense()

subroutine, public hecmw_precond_saamg_matrix::hecmw_saamg_bcsr_to_dense ( type(hecmwst_saamg_bcsr), intent(in)  A,
real(kind=kreal), dimension(:,:), intent(out)  dense 
)

Densify a matrix into a (n x ncol) array (verification helper).

Definition at line 416 of file hecmw_precond_SAAMG_matrix.F90.

Here is the call graph for this function:

◆ hecmw_saamg_bcsr_transpose()

subroutine, public hecmw_precond_saamg_matrix::hecmw_saamg_bcsr_transpose ( type(hecmwst_saamg_bcsr), intent(in)  A,
type(hecmwst_saamg_bcsr), intent(out)  At 
)

Transpose: At = A^T (At is ncol x n).

Definition at line 391 of file hecmw_precond_SAAMG_matrix.F90.

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

◆ hecmw_saamg_galerkin_blk()

subroutine, public hecmw_precond_saamg_matrix::hecmw_saamg_galerkin_blk ( type(hecmwst_saamg_bcsr), intent(in)  A,
type(hecmwst_saamg_bcsr), intent(in)  P,
integer(kind=kint), intent(in)  mblk,
type(hecmwst_saamg_bcsr), intent(out)  Ac 
)

Block Galerkin Ac = P^T A P (block transpose + two block SpGEMM). mblk = coarse block size, tagged on Acnb / Acmb.

Definition at line 622 of file hecmw_precond_SAAMG_matrix.F90.

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

◆ hecmw_saamg_galerkin_local()

subroutine, public hecmw_precond_saamg_matrix::hecmw_saamg_galerkin_local ( type(hecmwst_saamg_bcsr), intent(in)  A,
type(hecmwst_saamg_bcsr), intent(in)  P,
integer(kind=kint), intent(in)  mblk,
type(hecmwst_saamg_bcsr), intent(out)  Ac 
)

Galerkin coarse operator Ac = P^T A P. mblk = coarse block size.

Definition at line 407 of file hecmw_precond_SAAMG_matrix.F90.

Here is the call graph for this function:

◆ hecmw_saamg_is_symmetric()

real(kind=kreal) function, public hecmw_precond_saamg_matrix::hecmw_saamg_is_symmetric ( type(hecmwst_saamg_bcsr), intent(in)  A)

Relative asymmetry ||A - A^T||_F / ||A||_F (debug / verification helper). Returns 0 for a structurally and numerically symmetric matrix. Square only.

Definition at line 191 of file hecmw_precond_SAAMG_matrix.F90.

Here is the caller graph for this function:

◆ hecmw_saamg_matvec()

subroutine, public hecmw_precond_saamg_matrix::hecmw_saamg_matvec ( type(hecmwst_saamg_bcsr), intent(in)  A,
real(kind=kreal), dimension(:), intent(in)  x,
real(kind=kreal), dimension(:), intent(out)  y 
)

Sparse matrix-vector product : y = A x.

Definition at line 167 of file hecmw_precond_SAAMG_matrix.F90.

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

◆ hecmw_saamg_matvec_blk()

subroutine, public hecmw_precond_saamg_matrix::hecmw_saamg_matvec_blk ( type(hecmwst_saamg_bcsr), intent(in)  A,
real(kind=kreal), dimension(:), intent(in)  x,
real(kind=kreal), dimension(:), intent(out)  y 
)

Block matvec y = A x (x indexed by column blocks, y by row blocks).

Definition at line 448 of file hecmw_precond_SAAMG_matrix.F90.

Here is the caller graph for this function:

◆ hecmw_saamg_matvec_d()

subroutine, public hecmw_precond_saamg_matrix::hecmw_saamg_matvec_d ( type(hecmwst_saamg_comm), intent(in)  cmt,
type(hecmwst_saamg_bcsr), intent(in)  A,
real(kind=kreal), dimension(:), intent(inout)  x,
real(kind=kreal), dimension(:), intent(out)  y 
)

Distributed matvec y = A x : refresh x's halo region from the owning ranks (via the level comm table), then run the local product. x must have length nb*nnode (internal + halo room); y has length An = nb*nint (internal rows). Reduces to hecmw_saamg_matvec when the comm table has no neighbors (serial).

Definition at line 179 of file hecmw_precond_SAAMG_matrix.F90.

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

◆ hecmw_saamg_spgemm()

subroutine, public hecmw_precond_saamg_matrix::hecmw_saamg_spgemm ( type(hecmwst_saamg_bcsr), intent(in)  A,
type(hecmwst_saamg_bcsr), intent(in)  B,
type(hecmwst_saamg_bcsr), intent(out)  C 
)

Sparse matrix-matrix product C = A * B. Requires Amb == Bnb.

Definition at line 399 of file hecmw_precond_SAAMG_matrix.F90.

Here is the call graph for this function:

◆ hecmw_saamg_spgemm_blk()

subroutine, public hecmw_precond_saamg_matrix::hecmw_saamg_spgemm_blk ( type(hecmwst_saamg_bcsr), intent(in)  A,
type(hecmwst_saamg_bcsr), intent(in)  B,
type(hecmwst_saamg_bcsr), intent(out)  C 
)

Block SpGEMM C = A * B : block Gustavson with dense block GEMM accumulation. Requires Amb == Bnb (inner block dimension).

Definition at line 528 of file hecmw_precond_SAAMG_matrix.F90.

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

◆ hecmw_saamg_to_dense_blk()

subroutine, public hecmw_precond_saamg_matrix::hecmw_saamg_to_dense_blk ( type(hecmwst_saamg_bcsr), intent(in)  A,
real(kind=kreal), dimension(:,:), intent(out)  dense 
)

Densify from the block-CSR storage.

Definition at line 428 of file hecmw_precond_SAAMG_matrix.F90.

Here is the caller graph for this function:

◆ hecmw_saamg_transpose_blk()

subroutine, public hecmw_precond_saamg_matrix::hecmw_saamg_transpose_blk ( type(hecmwst_saamg_bcsr), intent(in)  A,
type(hecmwst_saamg_bcsr), intent(out)  At 
)

Block transpose At = A^T : swap block dims and transpose each block.

Definition at line 487 of file hecmw_precond_SAAMG_matrix.F90.

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

◆ hecmw_saamg_transpose_blk_rows()

subroutine, public hecmw_precond_saamg_matrix::hecmw_saamg_transpose_blk_rows ( type(hecmwst_saamg_bcsr), intent(in)  A,
integer(kind=kint), intent(in)  nbrow_keep,
type(hecmwst_saamg_bcsr), intent(out)  At 
)

Transpose only the first nbrow_keep block rows of A : At = (A[1:nbrow_keep])^T. Used to form the restriction P^T from the internal rows of the halo-extended prolongator without first copying out those rows.

Definition at line 639 of file hecmw_precond_SAAMG_matrix.F90.

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

◆ hecmw_saamg_triple_blk()

subroutine, public hecmw_precond_saamg_matrix::hecmw_saamg_triple_blk ( type(hecmwst_saamg_bcsr), intent(in)  L,
type(hecmwst_saamg_bcsr), intent(in)  A,
type(hecmwst_saamg_bcsr), intent(in)  R,
type(hecmwst_saamg_bcsr), intent(out)  Ac 
)

FUSED block triple product Ac = L * A * R, computed WITHOUT materializing the intermediate A*R (or L*A): the i -> j(L) -> k(A) -> l(R) loop accumulates the block products L(i,j) A(j,k) R(k,l) directly into Ac(i,l) (modelled on the FrontISTR T^t K T product). Only a small per-(i,j,k) temporary L*A is held, so the large A*R intermediate is never formed – critical for the level-1 Galerkin P^T A P on huge meshes. Requires Lmb==Anb, Amb==Rnb (and matching counts).

Definition at line 686 of file hecmw_precond_SAAMG_matrix.F90.

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