1 SUBROUTINE pcgeqrrv( M, N, A, IA, JA, DESCA, TAU, WORK )
13 COMPLEX 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 )
130 parameter( one = ( 1.0e+0, 0.0e+0 ),
131 $ zero = ( 0.0e+0, 0.0e+0 ) )
134 CHARACTER COLBTOP, ROWBTOP
135 INTEGER IACOL, IAROW, I, ICTXT, IIA, IPT, IPV, IPW,
136 $ IROFF, IV, J, JB, JJA, JL, JN, K, MP, MYCOL,
137 $ MYROW, NPCOL, NPROW
140 INTEGER DESCV( DLEN_ )
148 INTEGER ICEIL, INDXG2P, NUMROC
149 EXTERNAL iceil, indxg2p, numroc
158 ictxt = desca( ctxt_ )
159 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
161 iroff = mod( ia-1, desca( mb_ ) )
162 CALL infog2l( ia, ja, desca, nprow, npcol, myrow, mycol, iia, jja,
164 mp = numroc( m+iroff, desca( mb_ ), myrow, iarow, nprow )
166 ipt = ipv + mp * desca( nb_ )
167 ipw = ipt + desca( nb_ ) * desca( nb_ )
168 CALL pb_topget( ictxt,
'Broadcast',
'Rowwise', rowbtop )
169 CALL pb_topget( ictxt,
'Broadcast',
'Columnwise', colbtop )
170 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise',
'D-ring' )
171 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise',
' ' )
174 jn =
min( iceil( ja, desca( nb_ ) ) * desca( nb_ ), ja+k-1 )
175 jl =
max( ( (ja+k-2) / desca( nb_ ) ) * desca( nb_ ) + 1, ja )
177 CALL descset( descv, m+iroff, desca( nb_ ), desca( mb_ ),
178 $ desca( nb_ ), iarow, indxg2p( jl, desca( nb_ ),
179 $ mycol, desca( csrc_ ), npcol ), ictxt,
182 DO 10 j = jl, jn+1, -desca( nb_ )
183 jb =
min( ja+k-j, desca( nb_ ) )
185 iv = 1 + j - ja + iroff
189 CALL pclarft(
'Forward',
'Columnwise', m-i+ia, jb, a, i, j,
190 $ desca, tau, work( ipt ), work( ipw ) )
194 CALL pclacpy(
'Lower', m-i+ia, jb, a, i, j, desca, work( ipv ),
196 CALL pclaset(
'Upper', m-i+ia, jb, zero, one, work( ipv ), iv,
202 CALL pclaset(
'Lower', m-i+ia-1, jb, zero, zero, a, i+1, j,
207 CALL pclarfb(
'Left',
'No transpose',
'Forward',
'Columnwise',
208 $ m-i+ia, n-j+ja, jb, work( ipv ), iv, 1, descv,
209 $ work( ipt ), a, i, j, desca, work( ipw ) )
211 descv( csrc_ ) = mod( descv( csrc_ ) + npcol - 1, npcol )
221 CALL pclarft(
'Forward',
'Columnwise', m, jb, a, ia, ja, desca,
222 $ tau, work( ipt ), work( ipw ) )
226 CALL pclacpy(
'Lower', m, jb, a, ia, ja, desca, work( ipv ),
227 $ iroff+1, 1, descv )
228 CALL pclaset(
'Upper', m, jb, zero, one, work, iroff+1, 1, descv )
233 CALL pclaset(
'Lower', m-1, jb, zero, zero, a, ia+1, ja, desca )
237 CALL pclarfb(
'Left',
'No transpose',
'Forward',
'Columnwise', m,
238 $ n, jb, work( ipv ), iroff+1, 1, descv, work( ipt ),
239 $ a, ia, ja, desca, work( ipw ) )
241 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise', rowbtop )
242 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise', colbtop )