PSLASMSUB(l)

πŸ“¦ version 1.5, in ubuntu jammy

✨ PSLASMSUB β€” NAME ✨

okay bestie, gather round, because this is PSLASMSUB from LAPACK version 1.5 (the (l) is just the manual section, don't worry about it πŸ’…), and its whole entire job is: look for a small subdiagonal element from the bottom of the matrix that it can safely set to zero.

that's it. that's the gig. tiny task, big responsibility. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

SUBROUTINE PSLASMSUB( A, DESCA, I, L, K, SMLNUM, BUF, LWORK )

    INTEGER           I, K, L, LWORK

    REAL              SMLNUM

    INTEGER           DESCA( * )

    REAL              A( * ), BUF( * )

πŸ’– PURPOSE πŸ’–

so like, PSLASMSUB looks for a small subdiagonal element from the bottom of the matrix that it can safely set to zero. yes, the NAME and the PURPOSE are saying the same thing, and honestly? iconic of them.

🌸 Notes 🌸

every global data object out here is described by an associated description vector. this vector stores the information you need to establish the mapping between an object element and its corresponding process and memory location.

let A be a generic term for any 2D block cyclicly distributed array. such a global array has an associated description vector DESCA. in the following comments, the character _ should be read as "of the global array". iykyk.

  • DTYPE_A (global) β€” stored in DESCA( DTYPE_ ) β€” the descriptor type. in this case, DTYPE_A = 1.
  • CTXT_A (global) β€” stored in DESCA( CTXT_ ) β€” the BLACS context handle, indicating the BLACS process grid A is distributed over. the context itself is global, but the handle (the integer value) may vary. lowkey chaotic but okay.
  • M_A (global) β€” stored in DESCA( M_ ) β€” the number of rows in the global array A.
  • N_A (global) β€” stored in DESCA( N_ ) β€” the number of columns in the global array A.
  • MB_A (global) β€” stored in DESCA( MB_ ) β€” the blocking factor used to distribute the rows of the array.
  • NB_A (global) β€” stored in DESCA( NB_ ) β€” the blocking factor used to distribute the columns of the array.
  • RSRC_A (global) β€” stored in DESCA( RSRC_ ) β€” the process row over which the first row of the array A is distributed.
  • CSRC_A (global) β€” stored in DESCA( CSRC_ ) β€” the process column over which the first column of the array A is distributed.
  • LLD_A (local) β€” stored in DESCA( LLD_ ) β€” the leading dimension of the local array. LLD_A >= MAX(1,LOCr(M_A)).

let K be the number of rows or columns of a distributed matrix, and assume that its process grid has dimension p x q.

LOCr( K ) denotes the number of elements of K that a process would receive if K were distributed over the p processes of its process column.

similarly, LOCc( K ) denotes the number of elements of K that a process would receive if K were distributed over the q processes of its process row.

the values of LOCr() and LOCc() may be determined via a call to the ScaLAPACK tool function, NUMROC:

LOCr( M ) = NUMROC( M, MB_A, MYROW, RSRC_A, NPROW ),
LOCc( N ) = NUMROC( N, NB_A, MYCOL, CSRC_A, NPCOL ).

an upper bound for these quantities may be computed by:

LOCr( M ) <= ceil( ceil(M/MB_A)/NPROW )*MB_A
LOCc( N ) <= ceil( ceil(N/NB_A)/NPCOL )*NB_A

πŸ’… ARGUMENTS πŸ’…

  • A β€” (global input) REAL array, dimension (DESCA(LLD_),*). on entry, the Hessenberg matrix whose tridiagonal part is being scanned. unchanged on exit. she's just sitting there being scanned, minding her business. ✨
  • DESCA β€” (global and local input) INTEGER array of dimension DLEN_. the array descriptor for the distributed matrix A.
  • I β€” (global input) INTEGER. the global location of the bottom of the unreduced submatrix of A. unchanged on exit.
  • L β€” (global input) INTEGER. the global location of the top of the unreduced submatrix of A. unchanged on exit.
  • K β€” (global output) INTEGER. on exit, this yields the bottom portion of the unreduced submatrix. this will satisfy: L <= M <= I-1.
  • SMLNUM β€” (global input) REAL. on entry, a "small number" for the given matrix. unchanged on exit.
  • BUF β€” (local output) REAL array of size LWORK.
  • LWORK β€” (global input) INTEGER. on exit, LWORK is the size of the work buffer. this must be at least 2*Ceil( Ceil( (I-L)/HBL ) / LCM(NPROW,NPCOL) ) β€” here LCM is least common multiple, and NPROWxNPCOL is the logical grid size.

πŸ“ Notes: πŸ“

this routine does a global maximum and must be called by all processes. no solo missions, bestie. everyone's in the group chat for this one. 🫢

this code is basically a parallelization of the following snippet of LAPACK code from SLAHQR:

Look for a single small subdiagonal element.

DO 20 K = I, L + 1, -1
   TST1 = ABS( H( K-1, K-1 ) ) + ABS( H( K, K ) )
   IF( TST1.EQ.ZERO )
$     TST1 = SLANHS( '1', I-L+1, H( L, L ), LDH, WORK )
   IF( ABS( H( K, K-1 ) ).LE.MAX( ULP*TST1, SMLNUM ) )
$     GO TO 30
20 CONTINUE
30 CONTINUE

implemented by: G. Henry, November 17, 1996. an absolute legend, we love to see it. πŸ‘‘


fr fr, that's the whole page β€” go forth and zero out those subdiagonal elements safely. no cap. πŸ’œ

LAPACK version 1.5, dated 12 May 1997 β€” that's the version and the date this page shipped with, and yes she's vintage, she's retro, she's still slaying. πŸ¦‹βœ¨

πŸ“¦ where this page comes from