PSLAEVSWP(l)

πŸ“¦ version 1.5, in ubuntu jammy

✨ NAME ✨

PSLAEVSWP β€” bestie, this routine takes your eigenvectors (which are possibly a whole unsorted mess rn) from wherever they got computed and moves them into a ScaLAPACK standard block cyclic array, sorted so that the eigenvalues they belong to are sorted too. glow-up + relocation, all in one πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

SUBROUTINE PSLAEVSWP( N, ZIN, LDZI, Z, IZ, JZ, DESCZ, NVS, KEY, WORK,
                      LWORK )

    INTEGER           IZ, JZ, LDZI, LWORK, N

    INTEGER           DESCZ( * ), KEY( * ), NVS( * )

    REAL              WORK( * ), Z( * ), ZIN( LDZI, * )

πŸ”₯ PURPOSE πŸ”₯

PSLAEVSWP moves the eigenvectors (potentially unsorted) from where they are computed, to a ScaLAPACK standard block cyclic array, sorted so that the corresponding eigenvalues are sorted. it's giving ✨organized✨, it's giving main character energy πŸ¦‹

πŸ“ Notes

ok so first things first, bestie: every global data object out here is described by an associated description vector. that vector stores all the info you need to establish the mapping between an object element and its corresponding process and memory location. no cap.

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, 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. iconic behavior 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 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.
  • 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 πŸ’…

quick lil vocab check before we dive in, bestie: NP = the number of rows local to a given process. NQ = the number of columns local to a given process. okay now the lineup πŸ‘‘

  • N (global input) INTEGER β€” the order of the matrix A. N >= 0. simple. clean. we love her.
  • ZIN (local input) REAL array β€” dimension ( LDZI, NVS(iam) ). the eigenvectors on input. each eigenvector resides entirely in one process (no sharing, she's independent πŸ’…). each process holds a contiguous set of NVS(iam) eigenvectors. the first eigenvector which the process holds is: sum for i=[0,iam-1) of NVS(i).
  • LDZI (local input) INTEGER β€” leading dimension of the ZIN array.
  • Z (local output) REAL array β€” global dimension (N, N), local dimension (DESCZ(DLEN_), NQ). the eigenvectors on output. the eigenvectors are distributed in a block cyclic manner in both dimensions, with a block size of NB. she's everywhere and she's thriving 🌈
  • IZ (global input) INTEGER β€” Z's global row index, which points to the beginning of the submatrix which is to be operated on.
  • JZ (global input) INTEGER β€” Z's global column index, which points to the beginning of the submatrix which is to be operated on.
  • DESCZ (global and local input) INTEGER array of dimension DLEN_ β€” the array descriptor for the distributed matrix Z.
  • NVS (global input) INTEGER array, dimension( nprocs+1 ) β€” nvs(i) = number of processes number of eigenvectors held by processes [0,i-1). nvs(1) = number of eigen vectors held by [0,1-1) == 0. nvs(nprocs+1) = number of eigen vectors held by [0,nprocs) == total number of eigenvectors.
  • KEY (global input) INTEGER array, dimension( N ) β€” indicates the actual index (after sorting) for each of the eigenvectors. the post-sort glow-up receipt 🧾✨
  • WORK (local workspace) REAL array, dimension (LWORK)
  • LWORK (local input) INTEGER β€” dimension of WORK.
fr fr, keep your array descriptors and dimensions consistent β€” this routine trusts you completely and will not be doing vibe checks on your inputs for you πŸ™ˆ

and that's the whole page, bestie!! you just read PSLAEVSWP(l) from LAPACK version 1.5, dated 12 May 1997 β€” a certified classic, she's been slaying since before you were born πŸ’–βœ¨πŸ¦‹ no cap, that's the source and the date, and you're officially done. periodt. πŸŽ€

πŸ“¦ where this page comes from