PCLAEVSWP(l)
π 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 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. lowkey iconic of it.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)).
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 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)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 ofNB.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 arrayof dimensionDLEN_. the array descriptor for the distributed matrixZ.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 eigenvectorsKEYβ (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 ofRWORK.
π friendly reminder bestie:ZINisREAL,ZisCOMPLEX. 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
- 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