1 SUBROUTINE pcgelqrv( M, N, A, IA, JA, DESCA, TAU, WORK )
13 COMPLEX 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( one = ( 1.0e+0, 0.0e+0 ),
129 $ zero = ( 0.0e+0, 0.0e+0 ) )
132 CHARACTER COLBTOP, ROWBTOP
133 INTEGER I, IACOL, IAROW, IB, ICOFF, ICTXT, IIA, IL, IN,
134 $ IPT, IPV, IPW, J, JJA, JV, K, MYCOL, MYROW,
138 INTEGER DESCV( DLEN_ )
145 INTEGER ICEIL, NUMROC
146 EXTERNAL iceil, numroc
155 ictxt = desca( ctxt_ )
156 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
159 in =
min( iceil( ia, desca( mb_ ) ) * desca( mb_ ), ia+k-1 )
160 il =
max( ( (ia+k-2) / desca( mb_ ) ) * desca( mb_ ) + 1, ia )
162 icoff = mod( ja-1, desca( nb_ ) )
163 CALL infog2l( il, ja, desca, nprow, npcol, myrow, mycol, iia, jja,
165 nq = numroc( n+icoff, desca( nb_ ), mycol, iacol, npcol )
167 ipt = ipv + nq * desca( mb_ )
168 ipw = ipt + desca( mb_ ) * desca( mb_ )
169 CALL pb_topget( ictxt,
'Broadcast',
'Rowwise', rowbtop )
170 CALL pb_topget( ictxt,
'Broadcast',
'Columnwise', colbtop )
171 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise',
' ' )
172 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise',
'D-ring' )
174 CALL descset( descv, desca( mb_ ), n + icoff, desca( mb_ ),
175 $ desca( nb_ ), iarow, iacol, ictxt, desca( mb_ ) )
177 DO 10 i = il, in+1, -desca( mb_ )
178 ib =
min( ia+k-i, desca( mb_ ) )
180 jv = 1 + i - ia + icoff
184 CALL pclarft(
'Forward',
'Rowwise', n-j+ja, ib, a, i, j, desca,
185 $ tau, work( ipt ), work( ipw ) )
189 CALL pclacpy(
'Upper', ib, n-j+ja, a, i, j, desca, work( ipv ),
191 CALL pclaset(
'Lower', ib, n-j+ja, zero, one, work( ipv ), 1,
197 CALL pclaset(
'Upper', ib, n-j+ja-1, zero, zero, a, i, j+1,
202 CALL pclarfb(
'Right',
'Conjugate transpose',
'Forward',
203 $
'Rowwise', m-i+ia, n-j+ja, ib, work( ipv ), 1,
204 $ jv, descv, work( ipt ), a, i, j, desca,
207 descv( rsrc_ ) = mod( descv( rsrc_ ) + nprow - 1, nprow )
217 CALL pclarft(
'Forward',
'Rowwise', n, ib, a, ia, ja, desca, tau,
218 $ work( ipt ), work( ipw ) )
222 CALL pclacpy(
'Upper', ib, n, a, ia, ja, desca, work( ipv ), 1,
224 CALL pclaset(
'Lower', ib, n, zero, one, work, 1, icoff+1, descv )
229 CALL pclaset(
'Upper', ib, n-1, zero, zero, a, ia, ja+1, desca )
233 CALL pclarfb(
'Right',
'Conjugate transpose',
'Forward',
234 $
'Rowwise', m, n, ib, work( ipv ), 1, icoff+1, descv,
235 $ work( ipt ), a, ia, ja, desca, work( ipw ) )
237 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise', rowbtop )
238 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise', colbtop )