PSLAEVSWP(l)
β¨ 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 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. iconic behavior honestly.M_A(global) β stored inDESCA( M_ )β the number of rows in the global array A.N_A(global) β stored inDESCA( N_ )β the number of columns in the global array A.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 array A is distributed.CSRC_A(global) β stored inDESCA( CSRC_ )β the process column over which the first column of the array A is 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.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 ofNVS(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 theZINarray.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 ofNB. 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 ofWORK.
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
- 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