PSSTEIN(l)
π PSSTEIN(l) π
okay bestie, welcome to PSSTEIN β a LAPACK routine, version 1.5, and she is not like the other girls. this is the parallel one. buckle up. π
β¨ NAME β¨
PSSTEIN β compute the eigenvectors of a symmetric tridiagonal matrix in parallel, using inverse iteration π
β¨ SYNOPSIS β¨
SUBROUTINE PSSTEIN( N, D, E, M, W, IBLOCK, ISPLIT, ORFAC, Z, IZ, JZ,
DESCZ, WORK, LWORK, IWORK, LIWORK, IFAIL, ICLUSTR,
GAP, INFO )
INTEGER INFO, IZ, JZ, LIWORK, LWORK, M, N
REAL ORFAC
INTEGER DESCZ( * ), IBLOCK( * ), ICLUSTR( * ), IFAIL( * ),
ISPLIT( * ), IWORK( * )
REAL D( * ), E( * ), GAP( * ), W( * ), WORK( * ), Z( * )
like, look at that argument list. she's long. she's girthy. she contains multitudes. π
β¨ PURPOSE β¨
okay so what does PSSTEIN actually do? she computes the eigenvectors of a symmetric tridiagonal matrix, in parallel, using inverse iteration. no cap. π₯
the eigenvectors she finds correspond to user specified eigenvalues β you tell her which ones you want, she goes and gets them. very main character of her honestly.
here's the tea though π«: PSSTEIN does not orthogonalize vectors that are on different processes. the extent of orthogonalization is controlled by the input parameter LWORK. eigenvectors that are going to be orthogonalized get computed by the same process β she keeps them together, she doesn't split them up, that's the whole vibe.
then PSSTEIN decides on the allocation of work among the processes and calls SSTEIN2 (a modified LAPACK routine, not the original β she's got her own version) on each individual process.
β οΈ IMPORTANT β οΈ if insufficient workspace is allocated, the expected orthogonalization may not be done. like, she will simply not do it. she's not going to warn you mid-computation, she's just going to hand you non-orthogonal vectors and move on with her day π
π
Note : If the eigenvectors obtained are not orthogonal, increase LWORK and run the code again.
like. just run it again with a bigger LWORK. that's the fix. she said what she said.
πΈ Notes πΈ
the descriptor vector situation (iykyk)
each global data object is described by an associated description vector. this vector stores the information required to establish the mapping between an object element and its corresponding process and memory location.
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 following comments, the character _ should be read as "of the global array".
here's the whole notation breakdown, bestie, no skipping:
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 gridAis distributed over. the context itself is global, but the handle (the integer value) may vary.M_A(global) β stored inDESCA( M_ ). the number of rows in the global arrayA.N_A(global) β stored inDESCA( N_ ). the number of columns in the global arrayA.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 arrayAis distributed.CSRC_A(global) β stored inDESCA( CSRC_ ). the process column over which the first column of the arrayAis distributed.LLD_A(local) β stored inDESCA( LLD_ ). the leading dimension of the local array.LLD_A >= MAX(1,LOCr(M_A)).
LOCr and LOCc, the duo we didn't know we needed β¨
let K be the number of rows or columns of a distributed matrix, and assume that its process grid has dimension p x q.
LOCr( K )denotes the number of elements ofKthat a process would receive ifKwere distributed over thepprocesses of its process column.- similarly,
LOCc( K )denotes the number of elements ofKthat a process would receive ifKwere distributed over theqprocesses 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
β¨ part 1 done, bestie β more PSSTEIN incoming β¨
β¨ ARGUMENTS β¨
okay bestie, real talk: P = NPROW * NPCOL is the total number of processes. That's the whole squad handling this. π
Nβ (global input) INTEGER. The order of the tridiagonal matrixT.N >= 0. πDβ (global input) REAL array, dimension (N). The n diagonal elements of the tridiagonal matrixT.Eβ (global input) REAL array, dimension (N-1). The (n-1) off-diagonal elements of the tridiagonal matrixT.Mβ (global input) INTEGER. The total number of eigenvectors to be found.0 <= M <= N.Wβ (global input/global output) REAL array, dim (M). On input, the firstMelements ofWcontain all the eigenvalues for which eigenvectors are to be computed. The eigenvalues should be grouped by split-off block and ordered from smallest to largest within the block (The output arrayWfromPSSTEBZwithORDER='b'is expected here). This array should be replicated on all processes. On output, the firstMelements contain the input eigenvalues in ascending order. Note: To obtain orthogonal vectors, it is best if eigenvalues are computed to highest accuracy (this can be done by settingABSTOLto the underflow threshold =SLAMCH('U')---ABSTOLis an input parameter toPSSTEBZ).IBLOCKβ (global input) INTEGER array, dimension (N). The submatrix indices associated with the corresponding eigenvalues inW--1for eigenvalues belonging to the first submatrix from the top,2for those belonging to the second submatrix, etc. (The output arrayIBLOCKfromPSSTEBZis expected here).ISPLITβ (global input) INTEGER array, dimension (N). The splitting points, at whichTbreaks up into submatrices. The first submatrix consists of rows/columns1toISPLIT(1), the second of rows/columnsISPLIT(1)+1throughISPLIT(2), etc., and theNSPLIT-th consists of rows/columnsISPLIT(NSPLIT-1)+1throughISPLIT(NSPLIT)=N(The output arrayISPLITfromPSSTEBZis expected here.)ORFACβ (global input) REAL.ORFACspecifies which eigenvectors should be orthogonalized. Eigenvectors that correspond to eigenvalues which are withinORFAC*||T||of each other are to be orthogonalized. However, if the workspace is insufficient (seeLWORK), this tolerance may be decreased until all eigenvectors to be orthogonalized can be stored in one process. No orthogonalization will be done ifORFACequals zero. A default value of10^-3is used ifORFACis negative.ORFACshould be identical on all processes.Zβ (local output) REAL array, dimension (DESCZ(DLEN_),N/npcol + NB).Zcontains the computed eigenvectors associated with the specified eigenvalues. Any vector which fails to converge is set to its current iterate afterMAXITSiterations (SeeSSTEIN2). On output,Zis distributed across thePprocesses in block cyclic format.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 dimensionDLEN_. The array descriptor for the distributed matrixZ.WORKβ (local workspace/global output) REAL array, dimension (LWORK). On output,WORK(1)gives a lower bound on the workspace (LWORK) that guarantees the user desired orthogonalization (seeORFAC). Note that this may overestimate the minimum workspace needed.LWORKβ (local input) integer.LWORKcontrols the extent of orthogonalization which can be done. The number of eigenvectors for which storage is allocated on each process isNVEC = floor(( LWORK- max(5*N,NP00*MQ00) )/N). Eigenvectors corresponding to eigenvalue clusters of sizeNVEC - ceil(M/P) + 1are guaranteed to be orthogonal (the orthogonality is similar to that obtained fromSSTEIN2). Note:LWORKmust be no smaller than:max(5*N,NP00*MQ00) + ceil(M/P)*N, and should have the same input value on all processes. It is the minimum value ofLWORKinput on different processes that is significant. IfLWORK = -1, thenLWORKis global input and a workspace query is assumed; the routine only calculates the minimum and optimal size for all work arrays. Each of these values is returned in the first entry of the corresponding work array, and no error message is issued byPXERBLA.IWORKβ (local workspace/global output) INTEGER array, dimension (3*N+P+1). On return,IWORK(1)contains the amount of integer workspace required. On return, theIWORK(2)throughIWORK(P+2)indicate the eigenvectors computed by each process. ProcessIcomputes eigenvectors indexedIWORK(I+2)+1thru'IWORK(I+3).LIWORKβ (local input) INTEGER. Size of arrayIWORK. Must be>= 3*N + P + 1. IfLIWORK = -1, thenLIWORKis global input and a workspace query is assumed; the routine only calculates the minimum and optimal size for all work arrays. Each of these values is returned in the first entry of the corresponding work array, and no error message is issued byPXERBLA.IFAILβ (global output) integer array, dimension (M). On normal exit, all elements ofIFAILare zero. If one or more eigenvectors fail to converge afterMAXITSiterations (as inSSTEIN), thenINFO > 0is returned. Ifmod(INFO,M+1)>0, then forI=1tomod(INFO,M+1), the eigenvector corresponding to the eigenvalueW(IFAIL(I))failed to converge (Wrefers to the array of eigenvalues on output).ICLUSTRβ (global output) integer array, dimension (2*P). This output array contains indices of eigenvectors corresponding to a cluster of eigenvalues that could not be orthogonalized due to insufficient workspace (seeLWORK,ORFACandINFO). Eigenvectors corresponding to clusters of eigenvalues indexedICLUSTR(2*I-1)toICLUSTR(2*I),I = 1toINFO/(M+1), could not be orthogonalized due to lack of workspace. Hence the eigenvectors corresponding to these clusters may not be orthogonal.ICLUSTRis a zero terminated array ---( ICLUSTR(2*K).NE.0 .AND. ICLUSTR(2*K+1).EQ.0 )if and only ifKis the number of clusters.GAPβ (global output) REAL array, dimension (P). This output array contains the gap between eigenvalues whose eigenvectors could not be orthogonalized. TheINFO/Moutput values in this array correspond to theINFO/(M+1)clusters indicated by the arrayICLUSTR. As a result, the dot product between eigenvectors corresponding to theI^thcluster may be as high as( O(n)*macheps ) / GAP(I).INFOβ (global output) INTEGER.= 0: successful exit.< 0: If the i-th argument is an array and the j-entry had an illegal value, thenINFO = -(i*100+j), if the i-th argument is a scalar and had an illegal value, thenINFO = -i.< 0: ifINFO = -I, the I-th argument had an illegal value.> 0: ifmod(INFO,M+1) = I, thenIeigenvectors failed to converge inMAXITSiterations. Their indices are stored in the arrayIFAIL. ifINFO/(M+1) = I, then eigenvectors corresponding toIclusters of eigenvalues could not be orthogonalized due to insufficient workspace. The indices of the clusters are stored in the arrayICLUSTR.
That's the whole vibe, bestie! π This was PSSTEIN(l) from LAPACK version 1.5, dated 12 May 1997. Stay orthogonal! π¦β¨
π¦ 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