PSSYGS2(l)

๐Ÿ“ฆ version 1.5, in ubuntu jammy

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 is sub( A )*x = lambda*sub( B )*x, and sub( A ) gets overwritten by inv(U**T)*sub( A )*inv(U) or inv(L)*sub( A )*inv(L**T)
  • if IBTYPE = 2 or 3, the problem is sub( A )*sub( B )*x = lambda*x or sub( B )*sub( A )*x = lambda*x, and sub( A ) gets overwritten by U*sub( A )*U**T or L**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 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.
  • 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 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: compute inv(U**T)*sub( A )*inv(U) or inv(L)*sub( A )*inv(L**T); = 2 or 3: compute U*sub( A )*U**T or L**T*sub( A )*L.
  • UPLO (global input) CHARACTER โ€” = 'U': upper triangle of sub( A ) is stored and sub( B ) is factored as U**T*U; = 'L': lower triangle of sub( A ) is stored and sub( B ) is factored as L*L**T.
  • N (global input) INTEGER โ€” the order of the matrices sub( A ) and sub( B ). N >= 0. (yes, zero is allowed. zero is a valid order. she contains multitudes. ๐Ÿ’–)
  • A (local input/local output) REAL pointer 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 matrix sub( A ). if UPLO = 'U', the leading N-by-N upper triangular part of sub( A ) contains the upper triangular part of the matrix, and its strictly lower triangular part is not referenced. if UPLO = 'L', the leading N-by-N lower triangular part of sub( 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) INTEGER array of dimension DLEN_. the array descriptor for the distributed matrix A. that's her birth certificate. ๐Ÿ“œ
  • B (local input) REAL pointer 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 of sub( B ), as returned by PSPOTRF.
  • 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) INTEGER array of dimension DLEN_. the array descriptor for the distributed matrix B.
  • INFO (global output) INTEGER โ€” = 0: successful exit. < 0: if the i-th argument is an array and the j-entry had an illegal value, then INFO = -(i*100+j); if the i-th argument is a scalar and had an illegal value, then INFO = -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