1 SUBROUTINE pdgelqrv( M, N, A, IA, JA, DESCA, TAU, WORK )
13 DOUBLE PRECISION 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 )
127 DOUBLE PRECISION ONE, ZERO
128 parameter( one = 1.0d+0, zero = 0.0d+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 pdlarft(
'Forward',
'Rowwise', n-j+ja, ib, a, i, j, desca,
184 $ tau, work( ipt ), work( ipw ) )
188 CALL pdlacpy(
'Upper', ib, n-j+ja, a, i, j, desca, work( ipv ),
190 CALL pdlaset(
'Lower', ib, n-j+ja, zero, one, work( ipv ), 1,
196 CALL pdlaset(
'Upper', ib, n-j+ja-1, zero, zero, a, i, j+1,
201 CALL pdlarfb(
'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 pdlarft(
'Forward',
'Rowwise', n, ib, a, ia, ja, desca, tau,
216 $ work( ipt ), work( ipw ) )
220 CALL pdlacpy(
'Upper', ib, n, a, ia, ja, desca, work( ipv ), 1,
222 CALL pdlaset(
'Lower', ib, n, zero, one, work, 1, icoff+1, descv )
227 CALL pdlaset(
'Upper', ib, n-1, zero, zero, a, ia, ja+1, desca )
231 CALL pdlarfb(
'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 )