PDLASMSUB(l)
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 inDESCA( DTYPE_ )โ the descriptor type. in this case,DTYPE_A = 1.CTXT_A(global) โ stored inDESCA( 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 inDESCA( M_ )โ the number of rows in the global arrayA.N_A(global) โ stored inDESCA( N_ )โ the number of columns in the global arrayA.MB_A(global) โ stored inDESCA( MB_ )โ the blocking factor used to distribute the rows of the array.NB_A(global) โ stored inDESCA( NB_ )โ the blocking factor used to distribute the columns of the array.RSRC_A(global) โ stored inDESCA( RSRC_ )โ the process row over which the first row of the arrayAis distributed.CSRC_A(global) โ stored inDESCA( CSRC_ )โ the process column over which the first column of the arrayAis distributed.LLD_A(local) โ stored inDESCA( 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 PRECISIONarray, 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)INTEGERarray of dimensionDLEN_. the array descriptor for the distributed matrixA. it's the โจ map โจ.Iโ (global input)INTEGER. the global location of the bottom of the unreduced submatrix ofA. unchanged on exit.Lโ (global input)INTEGER. the global location of the top of the unreduced submatrix ofA. 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 saysM, 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 PRECISIONarray of sizeLWORK.LWORKโ (global input)INTEGER. on exit,LWORKis 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
- ubuntu jammy: scalapack-doc 1.5-11
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms