1 SUBROUTINE pstzrzrv( M, N, A, IA, JA, DESCA, TAU, WORK )
13 REAL A( * ), TAU( * ), WORK( * )
122 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
123 $ LLD_, MB_, M_, NB_, N_, RSRC_
124 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
125 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
126 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
128 parameter( zero = 0.0e+0 )
131 CHARACTER COLBTOP, ROWBTOP
132 INTEGER I, IACOL, IAROW, IB, ICOFF, ICTXT, IIA, IN,
133 $ IPT, IPV, IPW, JJA, JM1, JV, L, MYCOL, MYROW,
137 INTEGER DESCV( DLEN_ )
145 INTEGER ICEIL, NUMROC
146 EXTERNAL iceil, numroc
155 ictxt = desca( ctxt_ )
156 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
164 jm1 = ja +
min( m+1, n ) - 1
165 in =
min( iceil( ia, desca( mb_ ) ) * desca( mb_ ), ia+m-1 )
166 icoff = mod( ja-1, desca( nb_ ) )
167 CALL infog2l( ia, ja, desca, nprow, npcol, myrow, mycol, iia, jja,
169 nq = numroc( n+icoff, desca( nb_ ), mycol, iacol, npcol )
171 ipt = ipv + nq * desca( mb_ )
172 ipw = ipt + desca( mb_ ) * desca( mb_ )
173 CALL pb_topget( ictxt,
'Broadcast',
'Rowwise', rowbtop )
174 CALL pb_topget( ictxt,
'Broadcast',
'Columnwise', colbtop )
175 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise',
' ' )
176 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise',
'I-ring' )
178 CALL descset( descv, desca( mb_ ), n + icoff, desca( mb_ ),
179 $ desca( nb_ ), iarow, iacol, ictxt, desca( mb_ ) )
184 jv = icoff + jm1 - ja + 1
188 CALL pslarzt(
'Backward',
'Rowwise', l, ib, a, ia, jm1, desca,
189 $ tau, work( ipt ), work( ipw ) )
193 CALL pslacpy(
'All', ib, l, a, ia, jm1, desca, work( ipv ), 1,
198 CALL pslacpy(
'Lower', ib-1, ib-1, a, ia+1, ja, desca,
199 $ work( ipv ), 1, icoff+1, descv )
203 CALL pslaset(
'All', ib, l, zero, zero, a, ia, jm1, desca )
204 CALL pslaset(
'Lower', ib-1, ib-1, zero, zero, a, ia+1, ja,
209 CALL pslarzb(
'Right',
'Transpose',
'Backward',
'Rowwise',
210 $ in-ia+1, n, ib, l, work( ipv ), 1, jv, descv,
211 $ work( ipt ), a, ia, ja, desca, work( ipw ) )
215 CALL pslacpy(
'Lower', ib-1, ib-1, work( ipv ), 1, icoff+1, descv,
216 $ a, ia+1, ja, desca )
218 descv( rsrc_ ) = mod( descv( rsrc_ ) + 1, nprow )
222 DO 10 i = in+1, ia+m-1, desca( mb_ )
223 ib =
min( ia+m-i, desca( mb_ ) )
227 CALL pslarzt(
'Backward',
'Rowwise', l, ib, a, i, jm1, desca,
228 $ tau, work( ipt ), work( ipw ) )
232 CALL pslacpy(
'All', ib, l, a, i, jm1, desca, work( ipv ), 1,
237 CALL pslacpy(
'Lower', ib-1, ib-1, a, i+1, ja+i-ia, desca,
238 $ work( ipv ), 1, icoff+1+i-ia, descv )
242 CALL pslaset(
'All', ib, l, zero, zero, a, i, jm1, desca )
243 CALL pslaset(
'Lower', ib-1, ib-1, zero, zero, a, i+1, ja+i-ia,
248 CALL pslarzb(
'Right',
'Transpose',
'Backward',
'Rowwise',
249 $ i+ib-ia, n-i+ia, ib, l, work( ipv ), 1, jv,
250 $ descv, work( ipt ), a, ia, ja+i-ia, desca,
253 CALL pslacpy(
'Lower', ib-1, ib-1, work( ipv ), 1,
254 $ icoff+1+i-ia, descv, a, i+1, ja+i-ia, desca )
256 descv( rsrc_ ) = mod( descv( rsrc_ ) + 1, nprow )
260 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise', rowbtop )
261 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise', colbtop )