1 SUBROUTINE psgehdrv( N, ILO, IHI, A, IA, JA, DESCA, TAU, WORK )
9 INTEGER IA, IHI, ILO, JA, N
13 REAL A( * ), TAU( * ), WORK( * )
90 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
91 $ LLD_, MB_, M_, NB_, N_, RSRC_
92 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
93 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
94 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
96 parameter( zero = 0.0e+0 )
99 INTEGER I, IACOL, IAROW, ICTXT, IHLP, II, IOFF, IPT,
100 $ IPV, IPW, IV, J, JB, JJ, JL, K, MYCOL, MYROW,
104 INTEGER DESCV( DLEN_ )
107 INTEGER INDXG2P, NUMROC
108 EXTERNAL indxg2p, numroc
121 ictxt = desca( ctxt_ )
122 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
130 ioff = mod( ia+ilo-2, nb )
131 CALL infog2l( ia+ilo-1, ja+ilo-1, desca, nprow, npcol, myrow,
132 $ mycol, ii, jj, iarow, iacol )
133 ihlp = numroc( ihi-ilo+ioff+1, nb, myrow, iarow, nprow )
137 ipw = ipv + ihlp * nb
138 jl =
max( ( ( ja+ihi-2 ) / nb ) * nb + 1, ja + ilo - 1 )
139 CALL descset( descv, ihi-ilo+ioff+1, nb, nb, nb, iarow,
140 $ indxg2p( jl, desca( nb_ ), mycol, desca( csrc_ ),
141 $ npcol ), ictxt,
max( 1, ihlp ) )
143 DO 10 j = jl, ilo+ja+nb-ioff-1, -nb
144 jb =
min( ja+ihi-j-1, nb )
147 iv = k - ilo + ioff + 1
151 CALL pslarft(
'Forward',
'Columnwise', ihi-k, jb, a, i+1, j,
152 $ desca, tau, work( ipt ), work( ipw ) )
156 CALL pslacpy(
'All', ihi-k, jb, a, i+1, j, desca, work( ipv ),
161 CALL pslaset(
'Lower', ihi-k-1, jb, zero, zero, a, i+2, j,
166 CALL pslarfb(
'Left',
'No transpose',
'Forward',
'Columnwise',
167 $ ihi-k, n-k+1, jb, work( ipv ), iv+1, 1, descv,
168 $ work( ipt ), a, i+1, j, desca, work( ipw ) )
172 CALL pslarfb(
'Right',
'Transpose',
'Forward',
'Columnwise',
173 $ ihi, ihi-k, jb, work( ipv ), iv+1, 1, descv,
174 $ work( ipt ), a, ia, j+1, desca, work( ipw ) )
176 descv( csrc_ ) = mod( descv( csrc_ ) + npcol - 1, npcol )
185 jb =
min( nb-ioff, ja+ihi-j-1 )
189 CALL pslarft(
'Forward',
'Columnwise', ihi-ilo, jb, a, i+1, j,
190 $ desca, tau, work( ipt ), work( ipw ) )
194 CALL pslacpy(
'All', ihi-ilo, jb, a, i+1, j, desca, work( ipv ),
200 $
CALL pslaset(
'Lower', ihi-ilo-1, jb, zero, zero, a, i+2, j,
205 CALL pslarfb(
'Left',
'No transpose',
'Forward',
'Columnwise',
206 $ ihi-ilo, n-ilo+1, jb, work( ipv ), iv+1, 1, descv,
207 $ work( ipt ), a, i+1, j, desca, work( ipw ) )
211 CALL pslarfb(
'Right',
'Transpose',
'Forward',
'Columnwise', ihi,
212 $ ihi-ilo, jb, work( ipv ), iv+1, 1, descv,
213 $ work( ipt ), a, ia, j+1, desca, work( ipw ) )