PDLASMSUB(l)

๐Ÿ“ฆ version 1.5, in ubuntu jammy

okay bestie, pull up a chair, because we're about to get into PDLASMSUB(l) โ€” a real LAPACK routine, from back in the day, and she is doing the most in the most useful way possible ๐Ÿ’…


โœจ NAME โœจ

PDLASMSUB โ€” she looks for a small subdiagonal element from the bottom of the matrix that it can safely set to zero. that's it, that's the job, and she does it flawlessly ๐Ÿ’–


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

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

    INTEGER           I, K, L, LWORK

    DOUBLE PRECISION SMLNUM

    INTEGER           DESCA( * )

    DOUBLE PRECISION A( * ), BUF( * )

๐ŸŽ€ PURPOSE ๐ŸŽ€

PDLASMSUB looks for a small subdiagonal element from the bottom of the matrix that it can safely set to zero. periodt. ๐Ÿซถ

๐Ÿ“ Notes ๐Ÿ“

okay so here's the lore you need if you're gonna understand what's going on. every global data object is described by an associated description vector, right? this vector stores all the info required to establish the mapping between an object element and its corresponding process and memory location. it's giving โœจ bureaucracy but make it distributed โœจ.

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. so unserious of it honestly ๐Ÿ’€
  • 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)).

now, 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) DOUBLE PRECISION array, dimension (DESCA(LLD_),*). on entry, the Hessenberg matrix whose tridiagonal part is being scanned. unchanged on exit. no touchy, no changey ๐Ÿšซ
  • DESCA โ€” (global and local input) INTEGER array of dimension DLEN_. the array descriptor for the distributed matrix A. it's the โœจ map โœจ.
  • 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. ๐Ÿ‘‘ (yes bestie, she says M, that's what the page says, we don't question the ancestors)
  • SMLNUM โ€” (global input) DOUBLE PRECISION. on entry, a "small number" for the given matrix. unchanged on exit.
  • BUF โ€” (local output) DOUBLE PRECISION 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. do the math, she's not doing it for you ๐Ÿงฎโœจ

๐Ÿ“Œ Notes: ๐Ÿ“Œ

  • this routine does a global maximum and must be called by all processes. no leaving people on read, everybody shows up to this call. fr fr ๐Ÿซ‚
  • this code is basically a parallelization of the following snip of LAPACK code from DLAHQR:
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 = DLANHS( '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. ๐Ÿซก legend behaviour, honestly. respect the OG.


๐ŸŒˆ and that's the whole page bestie, you ate that. now go call her on every process like she asked. ๐Ÿ’–

okay so for the cute little sign-off: this iconic piece of documentation lives in LAPACK version 1.5, and she's dated 12 May 1997 ๐ŸŽ€ โ€” vintage, but never out of style, and still serving flawless subdiagonal realness. mwah ๐Ÿ’‹

๐Ÿ“ฆ where this page comes from