![]() |
FrontISTR
5.9.0
Large-scale structural analysis program with finit element method
|
Smoothed Aggregation AMG preconditioner : lightweight comm table. More...
Functions/Subroutines | |
| subroutine, public | hecmw_saamg_abort (msg) |
Fatal-error termination with a clear message. Under MPI this is a COLLECTIVE abort (hecmw_abort -> MPI_Abort) so a setup failure on one rank tears the job down cleanly instead of a bare stop that leaves the other ranks hanging in the next collective. In the stand-alone (HECMW_SERIAL) harness it is a plain stop. Used by the SA-AMG core in place of bare stop on unrecoverable errors. More... | |
| logical function, public | hecmw_saamg_lapack_available () |
| Whether this build links LAPACK (SA-AMG's setup needs it: dense coarsest factorization, per-aggregate QR, Lanczos tridiagonal eigenvalue). The HECMW_WITH_LAPACK macro is set by the build (–with-lapack / -DWITH_LAPACK). More... | |
| subroutine, public | hecmw_saamg_require_lapack (site) |
| Abort with a uniform message when a LAPACK-only code path is reached in a build without LAPACK. Defensive: the backend checks availability up front and aborts before setup, so this normally never fires. More... | |
| subroutine, public | hecmw_saamg_check_alloc (ier, what) |
| Report a failed allocation (stat /= 0) with a clear message and a collective abort, instead of a bare runtime stop. Used on the size-scaling allocations so an out-of-memory / size-overflow failure is diagnosable. (Under default Linux overcommit a true OOM arrives as a SIGKILL before allocate returns, so this catches the catchable cases: size overflow, address-space exhaustion, and cgroup/ulimit-bound failures.) More... | |
| subroutine, public | hecmw_saamg_comm_init_serial (cmt, nnode, nb) |
Build a trivial single-rank communication table for nnode nodes of block size nb: no neighbors, internal == all nodes, global id = local id. This mirrors what comm_from_mesh produces on one rank (n_neighbor==0 leaves the neighbor/import/export arrays unallocated – the exchange routines short-circuit on n_neighbor==0). Lets the sequential wrapper drive the distributed core. More... | |
| subroutine, public | hecmw_saamg_comm_update (cmt, nb, X) |
| Halo exchange of a block vector X (length nb*nnode): fill the halo region nb*nint+1..nb*nnode from the owning ranks. No-op when serial / no neighbors. More... | |
| subroutine, public | hecmw_saamg_comm_reverse_add (cmt, nb, X) |
| Reverse halo exchange with accumulation: send each halo (import) node's value to its owner and ADD it into the owner's (export) node. The transpose of comm_update; used to assemble restriction contributions (P^T res) that land on coarse rows owned by neighbors. After this, halo entries of X are stale (only the internal/owned entries are meaningful). No-op when serial / no neighbors. More... | |
| subroutine, public | hecmw_saamg_comm_update_i (cmt, nb, IX) |
| Integer halo exchange of a block vector IX (length nb*cmtnnode): fill the halo region from owners. Used to propagate coarse-node global ids and aggregate ids across rank boundaries. No-op when serial / no neighbors. More... | |
| subroutine, public | hecmw_saamg_comm_update_var (cmt, pb, cnt, off, X) |
| Variable-length real halo exchange. Node i carries cnt(i) blocks of pb reals each, packed contiguously in X starting at block-offset off(i) (0-based); X has length off(nnode+1)*pb. Internal nodes' data and cnt are filled by the caller; halo (import) nodes' cnt must already hold the owner's count (exchange it first with comm_update_i, payload 1), and this routine fills their X region. Unlike comm_update there is no per-node padding to a global maximum: the messages carry exactly sum(cnt) blocks. More... | |
| subroutine, public | hecmw_saamg_comm_update_var_i (cmt, cnt, off, IX) |
| Variable-length integer halo exchange (1 int per block). Companion to comm_update_var for the per-block column ids: node i carries cnt(i) ints at IX block-offset off(i). More... | |
| integer(kind=kint) function, public | hecmw_saamg_comm_size (cmt) |
| Number of ranks in this level's communicator (1 when serial). More... | |
| subroutine, public | hecmw_saamg_comm_allgather_int (cmt, sval, rbuf) |
| Allgather one integer from every rank into rbuf (size must be #ranks). More... | |
| subroutine, public | hecmw_saamg_comm_exchange_neighbor_int (cmt, sendvals, recvvals) |
| Exchange one integer with each neighbor: sendvals(k) is sent to neighbor(k), recvvals(k) is received from neighbor(k). Used to check comm-table symmetry. More... | |
| subroutine, public | hecmw_saamg_comm_allreduce_max_r (cmt, s) |
| Global max-reduction of a scalar over the communicator (no-op when serial). More... | |
| subroutine, public | hecmw_saamg_comm_allreduce_max_int (cmt, n) |
| Global max-reduction of an integer over the communicator (no-op when serial). More... | |
| subroutine, public | hecmw_saamg_comm_allreduce_sum_int (cmt, n) |
| Global sum-reduction of an integer over the communicator (no-op when serial). More... | |
| subroutine, public | hecmw_saamg_comm_allreduce_sum_r (cmt, s) |
| Global sum-reduction of a scalar over the communicator (no-op when serial). More... | |
| subroutine, public | hecmw_saamg_comm_allgatherv_triplets (cmt, nloc, ti, tj, tv, ntot, gti, gtj, gtv) |
| Allgatherv a triplet stream (ti,tj,tv)[1:nloc] from every rank into the globally-concatenated (gti,gtj,gtv)[1:ntot] (allocated here). Used to gather every rank's partial coarse-operator contributions for redundant assembly. More... | |
| subroutine, public | hecmw_saamg_comm_allgatherv_real (cmt, nloc, vloc, ntot, gv) |
| Allgatherv a real vector vloc[1:nloc] from every rank into gv[1:ntot] (allocated here). Used to gather the distributed coarse RHS / near-kernel. More... | |
| subroutine, public | hecmw_saamg_comm_alltoall_int (cmt, scnt, rcnt) |
| MPI_Alltoall of one integer per rank: scnt(r) (count this rank sends to rank r-1) -> rcnt(r) (count this rank receives from rank r-1). Both size = #ranks. More... | |
| subroutine, public | hecmw_saamg_comm_alltoallv_int (cmt, scnt, sbuf, ntot, rbuf) |
| MPI_Alltoallv of integers. scnt(#ranks) = send counts per destination rank; sbuf must already be ordered by destination rank. Returns ntot received and the concatenated rbuf (allocated here, ordered by source rank). More... | |
| subroutine, public | hecmw_saamg_comm_alltoallv_triplets (cmt, scnt, si, sj, sv, ntot, ri, rj, rv) |
| MPI_Alltoallv of triplets (2 int + 1 real). scnt(#ranks) = send counts per destination; si/sj/sv ordered by destination rank. Returns ntot received and ri/rj/rv (allocated here). Routes sparse-matrix partial contributions to the owning ranks (possibly non-neighbors) for distributed Galerkin assembly. More... | |
| subroutine, public | hecmw_saamg_comm_alltoallv_real (cmt, scnt, sval, ntot, rval) |
| MPI_Alltoallv of reals only, reusing a fixed routing (same scnt as a prior _alltoallv_triplets call). For numeric-only Galerkin refresh: the triplet POSITIONS are unchanged, so only the values are re-routed. sval ordered by destination rank; returns ntot and rval in the identical receive order. More... | |
| subroutine, public | hecmw_saamg_comm_copy (src, dst) |
| Deep copy a communication table: dst = src. More... | |
| subroutine, public | hecmw_saamg_comm_free (cmt) |
Smoothed Aggregation AMG preconditioner : lightweight comm table.
A per-level communication table, decoupled from hecmwST_local_mesh, so that coarse levels (which have no mesh) carry their own halo-exchange descriptor. The halo exchange mirrors hecmw_solver_SR (HECMW_SOLVE_SEND_RECV) but is kept self-contained (raw MPI guarded by HECMW_SERIAL) so the SA-AMG core stays FrontISTR-independent and still compiles in the stand-alone gfortran harness (HECMW_SERIAL -> the exchange is a no-op).
Vector convention: a level vector has length nb*nnode; the internal part is 1..nb*nint, the halo part nb*nint+1..nb*nnode is filled by comm_update from the owning ranks. Reductions/norms must use the internal part only.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_abort | ( | character(len=*), intent(in) | msg | ) |
Fatal-error termination with a clear message. Under MPI this is a COLLECTIVE abort (hecmw_abort -> MPI_Abort) so a setup failure on one rank tears the job down cleanly instead of a bare stop that leaves the other ranks hanging in the next collective. In the stand-alone (HECMW_SERIAL) harness it is a plain stop. Used by the SA-AMG core in place of bare stop on unrecoverable errors.
Definition at line 89 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_check_alloc | ( | integer(kind=kint), intent(in) | ier, |
| character(len=*), intent(in) | what | ||
| ) |
Report a failed allocation (stat /= 0) with a clear message and a collective abort, instead of a bare runtime stop. Used on the size-scaling allocations so an out-of-memory / size-overflow failure is diagnosable. (Under default Linux overcommit a true OOM arrives as a SIGKILL before allocate returns, so this catches the catchable cases: size overflow, address-space exhaustion, and cgroup/ulimit-bound failures.)
Definition at line 125 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_comm_allgather_int | ( | type(hecmwst_saamg_comm), intent(in) | cmt, |
| integer(kind=kint), intent(in) | sval, | ||
| integer(kind=kint), dimension(:), intent(out) | rbuf | ||
| ) |
Allgather one integer from every rank into rbuf (size must be #ranks).
Definition at line 637 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_comm_allgatherv_real | ( | type(hecmwst_saamg_comm), intent(in) | cmt, |
| integer(kind=kint), intent(in) | nloc, | ||
| real(kind=kreal), dimension(:), intent(in) | vloc, | ||
| integer(kind=kint), intent(out) | ntot, | ||
| real(kind=kreal), dimension(:), intent(out), allocatable | gv | ||
| ) |
Allgatherv a real vector vloc[1:nloc] from every rank into gv[1:ntot] (allocated here). Used to gather the distributed coarse RHS / near-kernel.
Definition at line 759 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_comm_allgatherv_triplets | ( | type(hecmwst_saamg_comm), intent(in) | cmt, |
| integer(kind=kint), intent(in) | nloc, | ||
| 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(out) | ntot, | ||
| integer(kind=kint), dimension(:), intent(out), allocatable | gti, | ||
| integer(kind=kint), dimension(:), intent(out), allocatable | gtj, | ||
| real(kind=kreal), dimension(:), intent(out), allocatable | gtv | ||
| ) |
Allgatherv a triplet stream (ti,tj,tv)[1:nloc] from every rank into the globally-concatenated (gti,gtj,gtv)[1:ntot] (allocated here). Used to gather every rank's partial coarse-operator contributions for redundant assembly.
Definition at line 726 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_comm_allreduce_max_int | ( | type(hecmwst_saamg_comm), intent(in) | cmt, |
| integer(kind=kint), intent(inout) | n | ||
| ) |
Global max-reduction of an integer over the communicator (no-op when serial).
Definition at line 688 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_comm_allreduce_max_r | ( | type(hecmwst_saamg_comm), intent(in) | cmt, |
| real(kind=kreal), intent(inout) | s | ||
| ) |
Global max-reduction of a scalar over the communicator (no-op when serial).
Definition at line 676 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_comm_allreduce_sum_int | ( | type(hecmwst_saamg_comm), intent(in) | cmt, |
| integer(kind=kint), intent(inout) | n | ||
| ) |
Global sum-reduction of an integer over the communicator (no-op when serial).
Definition at line 700 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_comm_allreduce_sum_r | ( | type(hecmwst_saamg_comm), intent(in) | cmt, |
| real(kind=kreal), intent(inout) | s | ||
| ) |
Global sum-reduction of a scalar over the communicator (no-op when serial).
Definition at line 712 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_comm_alltoall_int | ( | type(hecmwst_saamg_comm), intent(in) | cmt, |
| integer(kind=kint), dimension(:), intent(in) | scnt, | ||
| integer(kind=kint), dimension(:), intent(out) | rcnt | ||
| ) |
MPI_Alltoall of one integer per rank: scnt(r) (count this rank sends to rank r-1) -> rcnt(r) (count this rank receives from rank r-1). Both size = #ranks.
Definition at line 788 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_comm_alltoallv_int | ( | type(hecmwst_saamg_comm), intent(in) | cmt, |
| integer(kind=kint), dimension(:), intent(in) | scnt, | ||
| integer(kind=kint), dimension(:), intent(in) | sbuf, | ||
| integer(kind=kint), intent(out) | ntot, | ||
| integer(kind=kint), dimension(:), intent(out), allocatable | rbuf | ||
| ) |
MPI_Alltoallv of integers. scnt(#ranks) = send counts per destination rank; sbuf must already be ordered by destination rank. Returns ntot received and the concatenated rbuf (allocated here, ordered by source rank).
Definition at line 802 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_comm_alltoallv_real | ( | type(hecmwst_saamg_comm), intent(in) | cmt, |
| integer(kind=kint), dimension(:), intent(in) | scnt, | ||
| real(kind=kreal), dimension(:), intent(in) | sval, | ||
| integer(kind=kint), intent(out) | ntot, | ||
| real(kind=kreal), dimension(:), intent(out), allocatable | rval | ||
| ) |
MPI_Alltoallv of reals only, reusing a fixed routing (same scnt as a prior _alltoallv_triplets call). For numeric-only Galerkin refresh: the triplet POSITIONS are unchanged, so only the values are re-routed. sval ordered by destination rank; returns ntot and rval in the identical receive order.
Definition at line 864 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_comm_alltoallv_triplets | ( | type(hecmwst_saamg_comm), intent(in) | cmt, |
| integer(kind=kint), dimension(:), intent(in) | scnt, | ||
| integer(kind=kint), dimension(:), intent(in) | si, | ||
| integer(kind=kint), dimension(:), intent(in) | sj, | ||
| real(kind=kreal), dimension(:), intent(in) | sv, | ||
| integer(kind=kint), intent(out) | ntot, | ||
| integer(kind=kint), dimension(:), intent(out), allocatable | ri, | ||
| integer(kind=kint), dimension(:), intent(out), allocatable | rj, | ||
| real(kind=kreal), dimension(:), intent(out), allocatable | rv | ||
| ) |
MPI_Alltoallv of triplets (2 int + 1 real). scnt(#ranks) = send counts per destination; si/sj/sv ordered by destination rank. Returns ntot received and ri/rj/rv (allocated here). Routes sparse-matrix partial contributions to the owning ranks (possibly non-neighbors) for distributed Galerkin assembly.
Definition at line 831 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_comm_copy | ( | type(hecmwst_saamg_comm), intent(in) | src, |
| type(hecmwst_saamg_comm), intent(out) | dst | ||
| ) |
Deep copy a communication table: dst = src.
Definition at line 891 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_comm_exchange_neighbor_int | ( | type(hecmwst_saamg_comm), intent(in) | cmt, |
| integer(kind=kint), dimension(:), intent(in) | sendvals, | ||
| integer(kind=kint), dimension(:), intent(out) | recvvals | ||
| ) |
Exchange one integer with each neighbor: sendvals(k) is sent to neighbor(k), recvvals(k) is received from neighbor(k). Used to check comm-table symmetry.
Definition at line 650 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_comm_free | ( | type(hecmwst_saamg_comm), intent(inout) | cmt | ) |
Definition at line 913 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_comm_init_serial | ( | type(hecmwst_saamg_comm), intent(out) | cmt, |
| integer(kind=kint), intent(in) | nnode, | ||
| integer(kind=kint), intent(in) | nb | ||
| ) |
Build a trivial single-rank communication table for nnode nodes of block size nb: no neighbors, internal == all nodes, global id = local id. This mirrors what comm_from_mesh produces on one rank (n_neighbor==0 leaves the neighbor/import/export arrays unallocated – the exchange routines short-circuit on n_neighbor==0). Lets the sequential wrapper drive the distributed core.
Definition at line 136 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_comm_reverse_add | ( | type(hecmwst_saamg_comm), intent(in) | cmt, |
| integer(kind=kint), intent(in) | nb, | ||
| real(kind=kreal), dimension(:), intent(inout) | X | ||
| ) |
Reverse halo exchange with accumulation: send each halo (import) node's value to its owner and ADD it into the owner's (export) node. The transpose of comm_update; used to assemble restriction contributions (P^T res) that land on coarse rows owned by neighbors. After this, halo entries of X are stale (only the internal/owned entries are meaningful). No-op when serial / no neighbors.
Definition at line 284 of file hecmw_precond_SAAMG_comm.F90.
| integer(kind=kint) function, public hecmw_precond_saamg_comm::hecmw_saamg_comm_size | ( | type(hecmwst_saamg_comm), intent(in) | cmt | ) |
Number of ranks in this level's communicator (1 when serial).
Definition at line 625 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_comm_update | ( | type(hecmwst_saamg_comm), intent(in) | cmt, |
| integer(kind=kint), intent(in) | nb, | ||
| real(kind=kreal), dimension(:), intent(inout) | X | ||
| ) |
Halo exchange of a block vector X (length nb*nnode): fill the halo region nb*nint+1..nb*nnode from the owning ranks. No-op when serial / no neighbors.
Definition at line 159 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_comm_update_i | ( | type(hecmwst_saamg_comm), intent(in) | cmt, |
| integer(kind=kint), intent(in) | nb, | ||
| integer(kind=kint), dimension(:), intent(inout) | IX | ||
| ) |
Integer halo exchange of a block vector IX (length nb*cmtnnode): fill the halo region from owners. Used to propagate coarse-node global ids and aggregate ids across rank boundaries. No-op when serial / no neighbors.
Definition at line 399 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_comm_update_var | ( | type(hecmwst_saamg_comm), intent(in) | cmt, |
| integer(kind=kint), intent(in) | pb, | ||
| integer(kind=kint), dimension(:), intent(in) | cnt, | ||
| integer(kind=kint), dimension(:), intent(in) | off, | ||
| real(kind=kreal), dimension(:), intent(inout) | X | ||
| ) |
Variable-length real halo exchange. Node i carries cnt(i) blocks of pb reals each, packed contiguously in X starting at block-offset off(i) (0-based); X has length off(nnode+1)*pb. Internal nodes' data and cnt are filled by the caller; halo (import) nodes' cnt must already hold the owner's count (exchange it first with comm_update_i, payload 1), and this routine fills their X region. Unlike comm_update there is no per-node padding to a global maximum: the messages carry exactly sum(cnt) blocks.
Definition at line 465 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_comm_update_var_i | ( | type(hecmwst_saamg_comm), intent(in) | cmt, |
| integer(kind=kint), dimension(:), intent(in) | cnt, | ||
| integer(kind=kint), dimension(:), intent(in) | off, | ||
| integer(kind=kint), dimension(:), intent(inout) | IX | ||
| ) |
Variable-length integer halo exchange (1 int per block). Companion to comm_update_var for the per-block column ids: node i carries cnt(i) ints at IX block-offset off(i).
Definition at line 548 of file hecmw_precond_SAAMG_comm.F90.
| logical function, public hecmw_precond_saamg_comm::hecmw_saamg_lapack_available |
Whether this build links LAPACK (SA-AMG's setup needs it: dense coarsest factorization, per-aggregate QR, Lanczos tridiagonal eigenvalue). The HECMW_WITH_LAPACK macro is set by the build (–with-lapack / -DWITH_LAPACK).
Definition at line 102 of file hecmw_precond_SAAMG_comm.F90.
| subroutine, public hecmw_precond_saamg_comm::hecmw_saamg_require_lapack | ( | character(len=*), intent(in) | site | ) |
Abort with a uniform message when a LAPACK-only code path is reached in a build without LAPACK. Defensive: the backend checks availability up front and aborts before setup, so this normally never fires.
Definition at line 113 of file hecmw_precond_SAAMG_comm.F90.