PCLAEVSWP(l)

πŸ“¦ version 1.5, in ubuntu jammy

πŸ’– NAME πŸ’–

okay bestie so PCLAEVSWP β€” it takes the eigenvectors (which might be all unsorted and messy, no judgment) from wherever they got computed and moves them into a ScaLAPACK standard block cyclic array, and it sorts them so that the corresponding eigenvalues come out sorted. the way that it literally does both in one go?? obsessed. πŸ’…


✨ SYNOPSIS ✨

SUBROUTINE PCLAEVSWP( N, ZIN, LDZI, Z, IZ, JZ, DESCZ, NVS, KEY, RWORK,
                      LRWORK )

    INTEGER           IZ, JZ, LDZI, LRWORK, N

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

    REAL              RWORK( * ), ZIN( LDZI, * )

    COMPLEX           Z( * )

πŸ¦‹ PURPOSE πŸ¦‹

PCLAEVSWP moves the eigenvectors (potentially unsorted, it's giving chaos fr) from where they are computed, over to a ScaLAPACK standard block cyclic array, sorted so that the corresponding eigenvalues are sorted. slay. 🫢

Notes πŸ“

bestie, every global data object has a description vector attached to it, and that vector is storing all the info you need to map an object element to its process and its memory location. iykyk.

so like, let A be a generic term for any 2D block cyclicly distributed array (just a stand-in name, she's a placeholder πŸ’…). a global array like that has an associated description vector DESCA. and in the comments below, whenever you see the character _, read it as "of the global array".

  • 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. lowkey iconic of it.
  • 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)).

okay and 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 (twinning ✨), 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 ).

and 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. got it? good. πŸ“

  • N β€” (global input) INTEGER. the order of the matrix A. N >= 0.
  • ZIN β€” (local input) REAL array, dimension ( LDZI, NVS(iam) ). the eigenvectors on input. each eigenvector resides entirely in one process (she does not share, main character energy πŸ‘‘). 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) COMPLEX 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.
  • 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.
  • RWORK β€” (local workspace) REAL array, dimension (LRWORK).
  • LRWORK β€” (local input) INTEGER. dimension of RWORK.

πŸ’€ friendly reminder bestie: ZIN is REAL, Z is COMPLEX. do not mix them up, i am begging. πŸ™ˆ

and that's the whole page, periodt. 🧚 this one's from LAPACK version 1.5, dated 12 May 1997 β€” vintage but still serving, fr fr. bye bestie, go sort some eigenvectors πŸ’œ

πŸ“¦ where this page comes from