PSSYGS2(l)
PSSYGS2 ๐ โจ
okay bestie, gather round, because this one is a LAPACK routine โ specifically from LAPACK version 1.5 โ and it's about to reduce a real symmetric-definite generalized eigenproblem to standard form. yes that's a mouthful. yes it slays. let's go ๐ฆ
NAME ๐
PSSYGS2 โ reduce a real symmetric-definite generalized eigenproblem to standard form. that's the whole job. she does one thing and she does it immaculately. ๐
SYNOPSIS โจ
SUBROUTINE PSSYGS2( IBTYPE, UPLO, N, A, IA, JA, DESCA, B, IB, JB, DESCB,
INFO )
CHARACTER UPLO
INTEGER IA, IB, IBTYPE, INFO, JA, JB, N
INTEGER DESCA( * ), DESCB( * )
REAL A( * ), B( * )
like. look at her. so much going on and yet so composed. ๐
PURPOSE ๐ธ
so PSSYGS2 reduces a real symmetric-definite generalized eigenproblem to standard form. no cap, that's the mission statement.
in all the tea that follows, sub( A ) means A( IA:IA+N-1, JA:JA+N-1 ) and sub( B ) means B( IB:IB+N-1, JB:JB+N-1 ). shorthand besties, don't panic.
- if
IBTYPE = 1, the problem issub( A )*x = lambda*sub( B )*x, andsub( A )gets overwritten byinv(U**T)*sub( A )*inv(U)orinv(L)*sub( A )*inv(L**T) - if
IBTYPE = 2or3, the problem issub( A )*sub( B )*x = lambda*xorsub( B )*sub( A )*x = lambda*x, andsub( A )gets overwritten byU*sub( A )*U**TorL**T*sub( A )*L
and listen โ sub( B ) must have been previously factorized as U**T*U or L*L**T by PSPOTRF. she is not doing that for you. that's a you problem. ๐
Notes ๐
each global data object is described by an associated description vector. this vector stores all the info you need to establish the mapping between an object element and its corresponding process and memory location. it's giving โจlogisticsโจ.
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 comments below, read the character _ 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 gridAis distributed over. the context itself is global, but the handle (the integer value) may vary.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 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. twin functions, matching energy. ๐ซถ
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
math. but make it cute. ๐งฎโจ
ARGUMENTS ๐
IBTYPE(global input)INTEGERโ= 1: computeinv(U**T)*sub( A )*inv(U)orinv(L)*sub( A )*inv(L**T);= 2or3: computeU*sub( A )*U**TorL**T*sub( A )*L.UPLO(global input)CHARACTERโ= 'U': upper triangle ofsub( A )is stored andsub( B )is factored asU**T*U;= 'L': lower triangle ofsub( A )is stored andsub( B )is factored asL*L**T.N(global input)INTEGERโ the order of the matricessub( A )andsub( B ).N >= 0. (yes, zero is allowed. zero is a valid order. she contains multitudes. ๐)A(local input/local output)REALpointer into the local memory to an array of dimension(LLD_A, LOCc(JA+N-1)). on entry, this array contains the local pieces of the N-by-N symmetric distributed matrixsub( A ). ifUPLO = 'U', the leading N-by-N upper triangular part ofsub( A )contains the upper triangular part of the matrix, and its strictly lower triangular part is not referenced. ifUPLO = 'L', the leading N-by-N lower triangular part ofsub( A )contains the lower triangular part of the matrix, and its strictly upper triangular part is not referenced.
on exit, if INFO = 0, the transformed matrix, stored in the same format as sub( A ). glow-up complete. โจ
IA(global input)INTEGERโA's global row index, which points to the beginning of the submatrix which is to be operated on.JA(global input)INTEGERโA's global column index, which points to the beginning of the submatrix which is to be operated on.DESCA(global and local input)INTEGERarray of dimensionDLEN_. the array descriptor for the distributed matrixA. that's her birth certificate. ๐B(local input)REALpointer into the local memory to an array of dimension(LLD_B, LOCc(JB+N-1)). on entry, this array contains the local pieces of the triangular factor from the Cholesky factorization ofsub( B ), as returned byPSPOTRF.IB(global input)INTEGERโB's global row index, which points to the beginning of the submatrix which is to be operated on.JB(global input)INTEGERโB's global column index, which points to the beginning of the submatrix which is to be operated on.DESCB(global and local input)INTEGERarray of dimensionDLEN_. the array descriptor for the distributed matrixB.INFO(global output)INTEGERโ= 0: successful exit.< 0: if the i-th argument is an array and the j-entry had an illegal value, thenINFO = -(i*100+j); if the i-th argument is a scalar and had an illegal value, thenINFO = -i.
โ ๏ธ okay so real talk about INFO: if she comes back negative, that's not a vibe, that's an error. the number is a little breadcrumb trail telling you exactly which argument misbehaved. read it. do not ignore it. i'm not playing. ๐ญ
SEE ALSO? ๐
not listed here bestie, but PSPOTRF is the one who has to do the factorization first. she is the opening act and PSSYGS2 is the headliner. ๐ค
and that's the whole page!! written by the LAPACK crew, LAPACK version 1.5, dated 12 May 1997 โ which is, and i say this with love, before most of us existed, and yet she's still out here running on your cluster. iconic behavior, honestly. no notes. ๐โจ๐
๐ฆ 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