1 SUBROUTINE psgeqlrv( M, N, A, IA, JA, DESCA, TAU, WORK )
13 REAL 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, zero = 0.0e+0 )
133 CHARACTER COLBTOP, ROWBTOP
134 INTEGER IACOL, IAROW, ICTXT, IIA, IPT, IPV, IPW, IROFF,
135 $ IV, J, JB, JJA, JN, K, MP, MYCOL, MYROW, NPCOL,
139 INTEGER DESCV( DLEN_ )
147 INTEGER ICEIL, NUMROC
148 EXTERNAL iceil, numroc
157 ictxt = desca( ctxt_ )
158 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
161 jn =
min( iceil( ja+n-k, desca( nb_ ) ) * desca( nb_ ), ja+n-1 )
163 iroff = mod( ia-1, desca( mb_ ) )
164 CALL infog2l( ia, ja+n-k, desca, nprow, npcol, myrow, mycol,
165 $ iia, jja, iarow, iacol )
166 mp = numroc( m+iroff, desca( mb_ ), myrow, iarow, nprow )
168 ipt = ipv + mp * desca( nb_ )
169 ipw = ipt + desca( nb_ ) * desca( nb_ )
170 CALL pb_topget( ictxt,
'Broadcast',
'Rowwise', rowbtop )
171 CALL pb_topget( ictxt,
'Broadcast',
'Columnwise', colbtop )
172 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise',
'I-ring' )
173 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise',
' ' )
175 CALL descset( descv, m+iroff, desca( nb_ ), desca( mb_ ),
176 $ desca( nb_ ), iarow, iacol, ictxt,
max( 1, mp ) )
180 iv = 1 + m - k + iroff
181 jb = jn - ja - n + k + 1
185 CALL pslarft(
'Backward',
'Columnwise', m-n+jn-ja+1, jb, a, ia,
186 $ ja+n-k, desca, tau, work( ipt ), work( ipw ) )
190 CALL pslacpy(
'All', m-n+jn-ja+1, jb, a, ia, ja+n-k, desca,
191 $ work( ipv ), iroff+1, 1, descv )
192 CALL pslaset(
'Lower', jb, jb, zero, one, work( ipv ), iv,
198 CALL pslaset(
'All', m-k, jb, zero, zero, a, ia, ja+n-k,
200 CALL pslaset(
'Upper', jb, jb-1, zero, zero, a, ia+m-k,
205 CALL pslarfb(
'Left',
'No transpose',
'Backward',
'Columnwise',
206 $ m-n+jn-ja+1, jn-ja+1, jb, work( ipv ), iroff+1, 1,
207 $ descv, work( ipt ), a, ia, ja, desca, work( ipw ) )
209 descv( csrc_ ) = mod( descv( csrc_ ) + 1, npcol )
213 DO 10 j = jn+1, ja+n-1, desca( nb_ )
214 jb =
min( ja+n-j, desca( nb_ ) )
215 iv = 1 + m - n + j - ja + iroff
219 CALL pslarft(
'Backward',
'Columnwise', m-n+j+jb-ja, jb, a, ia,
220 $ j, desca, tau, work( ipt ), work( ipw ) )
224 CALL pslacpy(
'All', m-n+j+jb-ja, jb, a, ia, j, desca,
225 $ work( ipv ), iroff+1, 1, descv )
226 CALL pslaset(
'Lower', jb, jb, zero, one, work( ipv ), iv,
232 CALL pslaset(
'All', m-n+j-ja, jb, zero, zero, a, ia, j,
234 CALL pslaset(
'Upper', jb, jb-1, zero, zero, a, ia+m-n+j-ja,
239 CALL pslarfb(
'Left',
'No transpose',
'Backward',
'Columnwise',
240 $ m-n+j+jb-ja, j+jb-ja, jb, work( ipv ), iroff+1,
241 $ 1, descv, work( ipt ), a, ia, ja, desca,
244 descv( csrc_ ) = mod( descv( csrc_ ) + 1, npcol )
248 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise', rowbtop )
249 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise', colbtop )