1 SUBROUTINE pslaed0( N, D, E, Q, IQ, JQ, DESCQ, WORK, IWORK, INFO )
9 INTEGER INFO, IQ, JQ, N
12 INTEGER DESCQ( * ), IWORK( * )
13 REAL D( * ), E( * ), Q( * ), WORK( * )
81 INTEGER BLOCK_CYCLIC_2D, DLEN_, DTYPE_, CTXT_, M_, N_,
82 $ MB_, NB_, RSRC_, CSRC_, LLD_
83 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
84 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
85 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
88 INTEGER I, ID, IDCOL, IDROW, IID, IINFO, IIQ, IM1, IM2,
89 $ IPQ, IQCOL, IQROW, J, JJD, JJQ, LDQ, MATSIZ,
90 $ MYCOL, MYROW, N1, NB, NBL, NBL1, NPCOL, NPROW,
95 $ sgebr2d, sgebs2d, sgerv2d, sgesd2d, ssteqr
103 IF( block_cyclic_2d*csrc_*ctxt_*dlen_*dtype_*lld_*mb_*m_*nb_*n_*
108 CALL blacs_gridinfo( descq( ctxt_ ), nprow, npcol, myrow, mycol )
110 IF( descq( nb_ ).GT.n .OR. n.LT.2 )
113 CALL pxerbla( descq( ctxt_ ),
'PSLAED0', -info )
119 CALL infog2l( iq, jq, descq, nprow, npcol, myrow, mycol, iiq, jjq,
125 tsubpbs = ( n-1 ) / nb + 1
129 IF( iwork( subpbs ).GT.1 )
THEN
130 DO 20 j = subpbs, 1, -1
131 iwork( 2*j ) = ( iwork( j )+1 ) / 2
132 iwork( 2*j-1 ) = iwork( j ) / 2
138 iwork( j ) = iwork( j ) + iwork( j-1 )
144 DO 40 i = nb + 1, n, nb
146 d( im1 ) = d( im1 ) - abs( e( im1 ) )
147 d( i ) = d( i ) - abs( e( im1 ) )
154 CALL infog2l( iq-1+id, jq-1+id, descq, nprow, npcol, myrow,
155 $ mycol, iid, jjd, idrow, idcol )
156 matsiz =
min( nb, n-id+1 )
157 IF( myrow.EQ.idrow .AND. mycol.EQ.idcol )
THEN
158 ipq = iid + ( jjd-1 )*ldq
159 CALL ssteqr(
'I', matsiz, d( id ), e( id ), q( ipq ), ldq,
162 CALL pxerbla( descq( ctxt_ ),
'SSTEQR', -info )
165 IF( myrow.NE.iqrow .OR. mycol.NE.iqcol )
THEN
166 CALL sgesd2d( descq( ctxt_ ), matsiz, 1, d( id ), matsiz,
169 ELSE IF( myrow.EQ.iqrow .AND. mycol.EQ.iqcol )
THEN
170 CALL sgerv2d( descq( ctxt_ ), matsiz, 1, d( id ), matsiz,
175 IF( myrow.EQ.iqrow .AND. mycol.EQ.iqcol )
THEN
176 CALL sgebs2d( descq( ctxt_ ),
'A',
' ', n, 1, d, n )
178 CALL sgebr2d( descq( ctxt_ ),
'A',
' ', n, 1, d, n, iqrow,
188 IF( subpbs.GT.1 )
THEN
197 matsiz =
min( n, nbl*nb )
200 nbl = iwork( i+2 ) - iwork( i )
204 id = iwork( i )*nb + 1
205 matsiz =
min( nb*nbl, n-id+1 )
212 CALL pslaed1( matsiz, n1, d( id ), id, q, iq, jq, descq,
213 $ e( id+n1-1 ), work, iwork( subpbs+1 ), iinfo )
214 IF( iinfo.NE.0 )
THEN
215 info = iinfo*( n+1 ) + id
218 iwork( i / 2+1 ) = iwork( i+2 )