1 SUBROUTINE pdgeqrrv( M, N, A, IA, JA, DESCA, TAU, WORK )
13 DOUBLE PRECISION A( * ), TAU( * ), WORK( * )
124 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
125 $ LLD_, MB_, M_, NB_, N_, RSRC_
126 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
127 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
128 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
129 DOUBLE PRECISION ONE, ZERO
130 parameter( one = 1.0d+0, zero = 0.0d+0 )
133 CHARACTER COLBTOP, ROWBTOP
134 INTEGER IACOL, IAROW, I, ICTXT, IIA, IPT, IPV, IPW,
135 $ IROFF, IV, J, JB, JJA, JL, JN, K, MP, MYCOL,
136 $ MYROW, NPCOL, NPROW
139 INTEGER DESCV( DLEN_ )
147 INTEGER ICEIL, INDXG2P, NUMROC
148 EXTERNAL iceil, indxg2p, numroc
157 ictxt = desca( ctxt_ )
158 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
160 iroff = mod( ia-1, desca( mb_ ) )
161 CALL infog2l( ia, ja, desca, nprow, npcol, myrow, mycol, iia, jja,
163 mp = numroc( m+iroff, desca( mb_ ), myrow, iarow, nprow )
165 ipt = ipv + mp * desca( nb_ )
166 ipw = ipt + desca( nb_ ) * desca( nb_ )
167 CALL pb_topget( ictxt,
'Broadcast',
'Rowwise', rowbtop )
168 CALL pb_topget( ictxt,
'Broadcast',
'Columnwise', colbtop )
169 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise',
'D-ring' )
170 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise',
' ' )
173 jn =
min( iceil( ja, desca( nb_ ) ) * desca( nb_ ), ja+k-1 )
174 jl =
max( ( (ja+k-2) / desca( nb_ ) ) * desca( nb_ ) + 1, ja )
176 CALL descset( descv, m+iroff, desca( nb_ ), desca( mb_ ),
177 $ desca( nb_ ), iarow, indxg2p( jl, desca( nb_ ),
178 $ mycol, desca( csrc_ ), npcol ), ictxt,
181 DO 10 j = jl, jn+1, -desca( nb_ )
182 jb =
min( ja+k-j, desca( nb_ ) )
184 iv = 1 + j - ja + iroff
188 CALL pdlarft(
'Forward',
'Columnwise', m-i+ia, jb, a, i, j,
189 $ desca, tau, work( ipt ), work( ipw ) )
193 CALL pdlacpy(
'Lower', m-i+ia, jb, a, i, j, desca, work( ipv ),
195 CALL pdlaset(
'Upper', m-i+ia, jb, zero, one, work( ipv ), iv,
201 CALL pdlaset(
'Lower', m-i+ia-1, jb, zero, zero, a, i+1, j,
206 CALL pdlarfb(
'Left',
'No transpose',
'Forward',
'Columnwise',
207 $ m-i+ia, n-j+ja, jb, work( ipv ), iv, 1, descv,
208 $ work( ipt ), a, i, j, desca, work( ipw ) )
210 descv( csrc_ ) = mod( descv( csrc_ ) + npcol - 1, npcol )
220 CALL pdlarft(
'Forward',
'Columnwise', m, jb, a, ia, ja, desca,
221 $ tau, work( ipt ), work( ipw ) )
225 CALL pdlacpy(
'Lower', m, jb, a, ia, ja, desca, work( ipv ),
226 $ iroff+1, 1, descv )
227 CALL pdlaset(
'Upper', m, jb, zero, one, work, iroff+1, 1, descv )
232 CALL pdlaset(
'Lower', m-1, jb, zero, zero, a, ia+1, ja, desca )
236 CALL pdlarfb(
'Left',
'No transpose',
'Forward',
'Columnwise', m,
237 $ n, jb, work( ipv ), iroff+1, 1, descv, work( ipt ),
238 $ a, ia, ja, desca, work( ipw ) )
240 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise', rowbtop )
241 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise', colbtop )