PSLAHQR(l)
π PSLAHQR(l) π
okay bestie, welcome to the PSLAHQR(l) page β itβs the LAPACK auxiliary routine (version 1.5). this is part 1, and yes, weβre doing the whole thing, no skips. the math is giving serious main character energy, but weβre gonna vibe through it together. periodt. π
πΈ NAME πΈ
PSLAHQR β i an auxiliary routine used to find the Schur decomposition and or eigenvalues of a matrix already in Hessenberg form from cols ILO to IHI.
β¨ SYNOPSIS β¨
the signature is literally this, copy it exactly bestie:
SUBROUTINE PSLAHQR( WANTT, WANTZ, N, ILO, IHI, A, DESCA, WR, WI, ILOZ,
IHIZ, Z, DESCZ, WORK, LWORK, IWORK, ILWORK, INFO )
LOGICAL WANTT, WANTZ
INTEGER IHI, IHIZ, ILO, ILOZ, ILWORK, INFO, LWORK, N, ROTN
INTEGER DESCA( * ), DESCZ( * ), IWORK( * )
REAL A( * ), WI( * ), WORK( * ), WR( * ), Z( * )
π― PURPOSE π―
PSLAHQR is an auxiliary routine used to find the Schur decomposition and or eigenvalues of a matrix already in Hessenberg form from cols ILO to IHI.
no cap, thatβs the whole vibe.
π Notes π
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 notation breakdown, bestie β where itβs stored and what it means:
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)).
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 of K that a process would receive if K were distributed over the p processes of its process column.
Similarly, 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 π«Ά
Every single argument, no skips. Periodt. π
WANTT(global input) LOGICAL β.TRUE.means you want the full Schur formT, bestie..FALSE.means only eigenvalues, and that's it. πWANTZ(global input) LOGICAL β.TRUE.= give me the matrix of Schur vectorsZ..FALSE.= Schur vectors are not required, bye. β¨N(global input) INTEGER β The order of the Hessenberg matrixA(andZifWANTZ).N >= 0. πILO(global input) INTEGERIHI(global input) INTEGER β It is assumed thatAis already upper quasi-triangular in rows and columnsIHI+1:N, and thatA(ILO,ILO-1) = 0(unlessILO = 1). PSLAHQR works primarily with the Hessenberg submatrix in rows and columnsILOtoIHI, but applies transformations to all of H ifWANTTis.TRUE..1 <= ILO <= max(1,IHI);IHI <= N. πA(global input/output) REAL array, dimension (DESCA(LLD_),*) β On entry, the upper Hessenberg matrixA. On exit, ifWANTTis.TRUE.,Ais upper quasi-triangular in rows and columnsILO:IHI, with any 2-by-2 or larger diagonal blocks not yet in standard form. IfWANTTis.FALSE., the contents ofAare unspecified on exit. π (yes, unspecified, don't come for me)DESCA(global and local input) INTEGER array of dimensionDLEN_. β The array descriptor for the distributed matrixA. π¦WR(global replicated output) REAL array, dimension (N)WI(global replicated output) REAL array, dimension (N) β The real and imaginary parts, respectively, of the computed eigenvaluesILOtoIHIare stored in the corresponding elements ofWRandWI. If two eigenvalues are computed as a complex conjugate pair, they are stored in consecutive elements ofWRandWI, say the i-th and (i+1)th, withWI(i) > 0andWI(i+1) < 0. IfWANTTis.TRUE., the eigenvalues are stored in the same order as on the diagonal of the Schur form returned inA.Amay be returned with larger diagonal blocks until the next release. πILOZ(global input) INTEGERIHIZ(global input) INTEGER β Specify the rows ofZto which transformations must be applied ifWANTZis.TRUE..1 <= ILOZ <= ILO;IHI <= IHIZ <= N. πΈZ(global input/output) REAL array. β IfWANTZis.TRUE., on entryZmust contain the current matrixZof transformations accumulated byPDHSEQR, and on exitZhas been updated; transformations are applied only to the submatrixZ(ILOZ:IHIZ,ILO:IHI). IfWANTZis.FALSE.,Zis not referenced. πDESCZ(global and local input) INTEGER array of dimensionDLEN_. β The array descriptor for the distributed matrixZ. π§WORK(local output) REAL array of sizeLWORKβ (UnlessLWORK=-1, in which caseWORKmust be at least size 1). πLWORK(local input) INTEGER βWORK(LWORK)is a local array andLWORKis assumed big enough so that:
LWORK >= 3*N + MAX( 2*MAX(DESCZ(LLD_),DESCA(LLD_)) +
2*LOCc(N), 7*Ceil(N/HBL)/LCM(NPROW,NPCOL)) + MAX( 2*N,
(8*LCM(NPROW,NPCOL)+2)**2 )
If LWORK=-1, then WORK(1) gets set to the above number and the code returns immediately. π₯
IWORK(global and local input) INTEGER array of sizeILWORKβ This will hold some of theIBLKinteger arrays. This is held as a place holder for a future release. Currently unreferenced. βILWORK(local input) INTEGER β This will hold the size of theIWORKarray. This is held as a place holder for a future release. Currently unreferenced. βINFO(global output) INTEGER β exit status tea:< 0: parameter number-INFOincorrect or inconsistent= 0: successful exit, slay> 0: PSLAHQR failed to compute all the eigenvaluesILOtoIHIin a total of30*(IHI-ILO+1)iterations; ifINFO = i, elementsi+1:ihiofWRandWIcontain those eigenvalues which have been successfully computed.- Logic: This algorithm is very similar to
_LAHQR. Unlike_LAHQR, instead of sending one double shift through the largest unreduced submatrix, this algorithm sends multiple double shifts and spaces them apart so that there can be parallelism across several processor row/columns. Another critical difference is that this algorithm aggregates multiple transforms together in order to apply them in a block fashion. π - Important Local Variables:
IBLK= The maximum number of bulges that can be computed. Currently fixed. Future releases this won't be fixed.HBL= The square block size (HBL=DESCA(MB_)=DESCA(NB_))ROTN= The number of transforms to block togetherNBULGE= The number of bulges that will be attempted on the current submatrix.IBULGE= The current number of bulges started.K1(*),K2(*)= The current bulge loops fromK1(*)toK2(*).
- Subroutines:
- From LAPACK, this routine calls:
SLAHQR-> Serial QR used to determine shifts and eigenvaluesSLARFG-> Determine the Householder transforms
- And from ScaLAPACK, this routine calls:
PSLACONSB-> To determine where to start each iterationSLAMSH-> Sends multiple shifts through a small submatrix to see how the consecutive subdiagonals change (ifPSLACONSBindicates we can start a run in the middle)PSLAWIL-> Given the shift, get the transformationSLASORTE-> Pair up eigenvalues so that reals are paired.PSLACP3-> Parallel array to local replicated array copy & back.SLAREF-> Row/column reflector applier. Core routine here.PSLASMSUB-> Finds negligible subdiagonal elements.
- From LAPACK, this routine calls:
- Current Notes and/or Restrictions:
- This code requires the distributed block size to be square and at least six (6); unlike simpler codes like LU, this algorithm is extremely sensitive to block size. Unwise choices of too small a block size can lead to bad performance. π
- This code requires
AandZto be distributed identically and have identical contxts. A future version may allowZto have a different contxt to 1D row map it to all nodes (so no communication onZis necessary.) - This release currently does not have a routine for resolving the Schur blocks into regular 2x2 form after this code is completed. Because of this, a significant performance impact is required while the deflation is done by sometimes a single column of processors.
- This code does not currently block the initial transforms so that none of the rows or columns for any bulge are completed until all are started. To offset pipeline start-up it is recommended that at least
2*LCM(NPROW,NPCOL)bulges are used (if possible) - The maximum number of bulges currently supported is fixed at 32. In future versions this will be limited only by the incoming
WORKandIWORKarray. - The matrix
Amust be in upper Hessenberg form. If elements below the subdiagonal are nonzero, the resulting transforms may be nonsimilar. This is also true with the LAPACK routineSLAHQR. - For this release, this code has only been tested for
RSRC_=CSRC_=0, but it has been written for the general case. - Currently, all the eigenvalues are distributed to all the nodes. Future releases will probably distribute the eigenvalues by the column partitioning.
- The internals of this routine are subject to change.
- To optimize this for your architecture, try tuning
SLAREF. - This code has only been tested for
WANTZ = .TRUE.and may behave unpredictably forWANTZset to.FALSE.
- Implemented by: G. Henry, May 1, 1997
That's it bestie! This page is from LAPACK version 1.5, dated 12 May 1997. Stay iconic. πβ¨
π¦ 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