1 SUBROUTINE pdlaed0( N, D, E, Q, IQ, JQ, DESCQ, WORK, IWORK, INFO )
9 INTEGER INFO, IQ, JQ, N
12 INTEGER DESCQ( * ), IWORK( * )
13 DOUBLE PRECISION 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,
94 EXTERNAL blacs_gridinfo, dgebr2d, dgebs2d, dgerv2d,
105 IF( block_cyclic_2d*csrc_*ctxt_*dlen_*dtype_*lld_*mb_*m_*nb_*n_*
110 CALL blacs_gridinfo( descq( ctxt_ ), nprow, npcol, myrow, mycol )
112 IF( descq( nb_ ).GT.n .OR. n.LT.2 )
115 CALL pxerbla( descq( ctxt_ ),
'PDLAED0', -info )
121 CALL infog2l( iq, jq, descq, nprow, npcol, myrow, mycol, iiq, jjq,
127 tsubpbs = ( n-1 ) / nb + 1
131 IF( iwork( subpbs ).GT.1 )
THEN
132 DO 20 j = subpbs, 1, -1
133 iwork( 2*j ) = ( iwork( j )+1 ) / 2
134 iwork( 2*j-1 ) = iwork( j ) / 2
140 iwork( j ) = iwork( j ) + iwork( j-1 )
146 DO 40 i = nb + 1, n, nb
148 d( im1 ) = d( im1 ) - abs( e( im1 ) )
149 d( i ) = d( i ) - abs( e( im1 ) )
156 CALL infog2l( iq-1+id, jq-1+id, descq, nprow, npcol, myrow,
157 $ mycol, iid, jjd, idrow, idcol )
158 matsiz =
min( nb, n-id+1 )
159 IF( myrow.EQ.idrow .AND. mycol.EQ.idcol )
THEN
160 ipq = iid + ( jjd-1 )*ldq
161 CALL dsteqr(
'I', matsiz, d( id ), e( id ), q( ipq ), ldq,
164 CALL pxerbla( descq( ctxt_ ),
'DSTEQR', -info )
167 IF( myrow.NE.iqrow .OR. mycol.NE.iqcol )
THEN
168 CALL dgesd2d( descq( ctxt_ ), matsiz, 1, d( id ), matsiz,
171 ELSE IF( myrow.EQ.iqrow .AND. mycol.EQ.iqcol )
THEN
172 CALL dgerv2d( descq( ctxt_ ), matsiz, 1, d( id ), matsiz,
177 IF( myrow.EQ.iqrow .AND. mycol.EQ.iqcol )
THEN
178 CALL dgebs2d( descq( ctxt_ ),
'A',
' ', n, 1, d, n )
180 CALL dgebr2d( descq( ctxt_ ),
'A',
' ', n, 1, d, n, iqrow,
190 IF( subpbs.GT.1 )
THEN
199 matsiz =
min( n, nbl*nb )
202 nbl = iwork( i+2 ) - iwork( i )
206 id = iwork( i )*nb + 1
207 matsiz =
min( nb*nbl, n-id+1 )
214 CALL pdlaed1( matsiz, n1, d( id ), id, q, iq, jq, descq,
215 $ e( id+n1-1 ), work, iwork( subpbs+1 ), iinfo )
216 IF( iinfo.NE.0 )
THEN
217 info = iinfo*( n+1 ) + id
221 iwork( i / 2+1 ) = iwork( i+2 )