1 SUBROUTINE psgelqrv( 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( one = 1.0e+0, zero = 0.0e+0 )
131 CHARACTER COLBTOP, ROWBTOP
132 INTEGER I, IACOL, IAROW, IB, ICOFF, ICTXT, IIA, IL, IN,
133 $ IPT, IPV, IPW, J, JJA, JV, K, MYCOL, MYROW,
137 INTEGER DESCV( DLEN_ )
144 INTEGER ICEIL, NUMROC
145 EXTERNAL iceil, numroc
154 ictxt = desca( ctxt_ )
155 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
158 in =
min( iceil( ia, desca( mb_ ) ) * desca( mb_ ), ia+k-1 )
159 il =
max( ( (ia+k-2) / desca( mb_ ) ) * desca( mb_ ) + 1, ia )
161 icoff = mod( ja-1, desca( nb_ ) )
162 CALL infog2l( il, ja, desca, nprow, npcol, myrow, mycol, iia, jja,
164 nq = numroc( n+icoff, desca( nb_ ), mycol, iacol, npcol )
166 ipt = ipv + nq * desca( mb_ )
167 ipw = ipt + desca( mb_ ) * desca( mb_ )
168 CALL pb_topget( ictxt,
'Broadcast',
'Rowwise', rowbtop )
169 CALL pb_topget( ictxt,
'Broadcast',
'Columnwise', colbtop )
170 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise',
' ' )
171 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise',
'D-ring' )
173 CALL descset( descv, desca( mb_ ), n + icoff, desca( mb_ ),
174 $ desca( nb_ ), iarow, iacol, ictxt, desca( mb_ ) )
176 DO 10 i = il, in+1, -desca( mb_ )
177 ib =
min( ia+k-i, desca( mb_ ) )
179 jv = 1 + i - ia + icoff
183 CALL pslarft(
'Forward',
'Rowwise', n-j+ja, ib, a, i, j, desca,
184 $ tau, work( ipt ), work( ipw ) )
188 CALL pslacpy(
'Upper', ib, n-j+ja, a, i, j, desca, work( ipv ),
190 CALL pslaset(
'Lower', ib, n-j+ja, zero, one, work( ipv ), 1,
196 CALL pslaset(
'Upper', ib, n-j+ja-1, zero, zero, a, i, j+1,
201 CALL pslarfb(
'Right',
'Transpose',
'Forward',
'Rowwise',
202 $ m-i+ia, n-j+ja, ib, work( ipv ), 1, jv, descv,
203 $ work( ipt ), a, i, j, desca, work( ipw ) )
205 descv( rsrc_ ) = mod( descv( rsrc_ ) + nprow - 1, nprow )
215 CALL pslarft(
'Forward',
'Rowwise', n, ib, a, ia, ja, desca, tau,
216 $ work( ipt ), work( ipw ) )
220 CALL pslacpy(
'Upper', ib, n, a, ia, ja, desca, work( ipv ), 1,
222 CALL pslaset(
'Lower', ib, n, zero, one, work, 1, icoff+1, descv )
227 CALL pslaset(
'Upper', ib, n-1, zero, zero, a, ia, ja+1, desca )
231 CALL pslarfb(
'Right',
'Transpose',
'Forward',
'Rowwise', m, n,
232 $ ib, work( ipv ), 1, icoff+1, descv, work( ipt ), a,
233 $ ia, ja, desca, work( ipw ) )
235 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise', rowbtop )
236 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise', colbtop )