1 SUBROUTINE pstzrzf( M, N, A, IA, JA, DESCA, TAU, WORK, LWORK,
10 INTEGER IA, INFO, JA, LWORK, M, N
14 REAL A( * ), TAU( * ), WORK( * )
184 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
185 $ lld_, mb_, m_, nb_, n_, rsrc_
186 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
187 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
188 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
190 parameter( zero = 0.0e+0 )
194 CHARACTER COLBTOP, ROWBTOP
195 INTEGER I, IACOL, IAROW, IB, ICTXT, IIA, IL, IN, IPW,
196 $ iroffa, j, jm1, l, lwmin, mp0, mycol, myrow,
200 INTEGER IDUM1( 1 ), IDUM2( 1 )
208 INTEGER ICEIL, INDXG2P, NUMROC
209 EXTERNAL iceil, indxg2p, numroc
212 INTRINSIC max,
min, mod, real
218 ictxt = desca( ctxt_ )
219 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
224 IF( nprow.EQ.-1 )
THEN
227 CALL chk1mat( m, 1, n, 2, ia, ja, desca, 6, info )
229 iroffa = mod( ia-1, desca( mb_ ) )
230 iarow = indxg2p( ia, desca( mb_ ), myrow, desca( rsrc_ ),
232 iacol = indxg2p( ja, desca( nb_ ), mycol, desca( csrc_ ),
234 mp0 = numroc( m+iroffa, desca( mb_ ), myrow, iarow, nprow )
235 nq0 = numroc( n+mod( ja-1, desca( nb_ ) ), desca( nb_ ),
236 $ mycol, iacol, npcol )
237 lwmin = desca( mb_ ) * ( mp0 + nq0 + desca( mb_ ) )
239 work( 1 ) = real( lwmin )
240 lquery = ( lwork.EQ.-1 )
243 ELSE IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
253 CALL pchk1mat( m, 1, n, 2, ia, ja, desca, 6, 1, idum1, idum2,
258 CALL pxerbla( ictxt,
'PSTZRZF', -info )
260 ELSE IF( lquery )
THEN
266 IF( m.EQ.0 .OR. n.EQ.0 )
271 CALL infog1l( ia, desca( mb_ ), nprow, myrow, desca( rsrc_ ),
275 DO 10 i = iia, iia+mp0-1
282 jm1 = ja +
min( m+1, n ) - 1
283 ipw = desca( mb_ ) * desca( mb_ ) + 1
284 in =
min( iceil( ia, desca( mb_ ) ) * desca( mb_ ), ia+m-1 )
285 il =
max( ( (ia+m-2) / desca( mb_ ) ) * desca( mb_ ) + 1, ia )
286 CALL pb_topget( ictxt,
'Broadcast',
'Rowwise', rowbtop )
287 CALL pb_topget( ictxt,
'Broadcast',
'Columnwise', colbtop )
288 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise',
' ' )
289 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise',
'D-ring' )
293 DO 20 i = il, in+1, -desca( mb_ )
294 ib =
min( ia+m-i, desca( mb_ ) )
300 CALL pslatrz( ib, ja+n-j, l, a, i, j, desca, tau, work )
307 CALL pslarzt(
'Backward',
'Rowwise', l, ib, a, i, jm1,
308 $ desca, tau, work, work( ipw ) )
312 CALL pslarzb(
'Right',
'No transpose',
'Backward',
313 $
'Rowwise', i-ia, ja+n-j, ib, l, a, i, jm1,
314 $ desca, work, a, ia, j, desca, work( ipw ) )
321 CALL pslatrz( in-ia+1, n, n-m, a, ia, ja, desca, tau, work )
323 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise', rowbtop )
324 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise', colbtop )
328 work( 1 ) = real( lwmin )