1 SUBROUTINE pcgeqlrv( 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, ICTXT, IIA, IPT, IPV, IPW, IROFF,
136 $ IV, J, JB, JJA, JN, K, MP, MYCOL, MYROW, NPCOL,
140 INTEGER DESCV( DLEN_ )
148 INTEGER ICEIL, NUMROC
149 EXTERNAL iceil, numroc
158 ictxt = desca( ctxt_ )
159 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
162 jn =
min( iceil( ja+n-k, desca( nb_ ) ) * desca( nb_ ), ja+n-1 )
164 iroff = mod( ia-1, desca( mb_ ) )
165 CALL infog2l( ia, ja+n-k, desca, nprow, npcol, myrow, mycol,
166 $ iia, jja, iarow, iacol )
167 mp = numroc( m+iroff, desca( mb_ ), myrow, iarow, nprow )
169 ipt = ipv + mp * desca( nb_ )
170 ipw = ipt + desca( nb_ ) * desca( nb_ )
171 CALL pb_topget( ictxt,
'Broadcast',
'Rowwise', rowbtop )
172 CALL pb_topget( ictxt,
'Broadcast',
'Columnwise', colbtop )
173 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise',
'I-ring' )
174 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise',
' ' )
176 CALL descset( descv, m+iroff, desca( nb_ ), desca( mb_ ),
177 $ desca( nb_ ), iarow, iacol, ictxt,
max( 1, mp ) )
181 iv = 1 + m - k + iroff
182 jb = jn - ja - n + k + 1
186 CALL pclarft(
'Backward',
'Columnwise', m-n+jn-ja+1, jb, a, ia,
187 $ ja+n-k, desca, tau, work( ipt ), work( ipw ) )
191 CALL pclacpy(
'All', m-n+jn-ja+1, jb, a, ia, ja+n-k, desca,
192 $ work( ipv ), iroff+1, 1, descv )
193 CALL pclaset(
'Lower', jb, jb, zero, one, work( ipv ), iv,
199 CALL pclaset(
'All', m-k, jb, zero, zero, a, ia, ja+n-k,
201 CALL pclaset(
'Upper', jb, jb-1, zero, zero, a, ia+m-k,
206 CALL pclarfb(
'Left',
'No transpose',
'Backward',
'Columnwise',
207 $ m-n+jn-ja+1, jn-ja+1, jb, work( ipv ), iroff+1, 1,
208 $ descv, work( ipt ), a, ia, ja, desca, work( ipw ) )
210 descv( csrc_ ) = mod( descv( csrc_ ) + 1, npcol )
214 DO 10 j = jn+1, ja+n-1, desca( nb_ )
215 jb =
min( ja+n-j, desca( nb_ ) )
216 iv = 1 + m - n + j - ja + iroff
220 CALL pclarft(
'Backward',
'Columnwise', m-n+j+jb-ja, jb, a, ia,
221 $ j, desca, tau, work( ipt ), work( ipw ) )
225 CALL pclacpy(
'All', m-n+j+jb-ja, jb, a, ia, j, desca,
226 $ work( ipv ), iroff+1, 1, descv )
227 CALL pclaset(
'Lower', jb, jb, zero, one, work( ipv ), iv,
233 CALL pclaset(
'All', m-n+j-ja, jb, zero, zero, a, ia, j,
235 CALL pclaset(
'Upper', jb, jb-1, zero, zero, a, ia+m-n+j-ja,
240 CALL pclarfb(
'Left',
'No transpose',
'Backward',
'Columnwise',
241 $ m-n+j+jb-ja, j+jb-ja, jb, work( ipv ), iroff+1,
242 $ 1, descv, work( ipt ), a, ia, ja, desca,
245 descv( csrc_ ) = mod( descv( csrc_ ) + 1, npcol )
249 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise', rowbtop )
250 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise', colbtop )