1 SUBROUTINE psgetf2( M, N, A, IA, JA, DESCA, IPIV, INFO )
9 INTEGER IA, INFO, JA, M, N
12 INTEGER DESCA( * ), IPIV( * )
138 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
139 $ LLD_, MB_, M_, NB_, N_, RSRC_
140 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
141 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
142 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
144 parameter( one = 1.0e+0, zero = 0.0e+0 )
148 INTEGER I, IACOL, IAROW, ICOFF, ICTXT, IIA, IROFF, J,
149 $ JJA, MN, MYCOL, MYROW, NPCOL, NPROW
153 EXTERNAL blacs_abort, blacs_gridinfo,
chk1mat, igebr2d,
154 $ igebs2d,
infog2l, psamax, psger,
155 $ psscal, psswap, pb_topget,
pxerbla
164 ictxt = desca( ctxt_ )
165 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
170 IF( nprow.EQ.-1 )
THEN
173 CALL chk1mat( m, 1, n, 2, ia, ja, desca, 6, info )
175 iroff = mod( ia-1, desca( mb_ ) )
176 icoff = mod( ja-1, desca( nb_ ) )
177 IF( n+icoff.GT.desca( nb_ ) )
THEN
179 ELSE IF( iroff.NE.0 )
THEN
181 ELSE IF( icoff.NE.0 )
THEN
183 ELSE IF( desca( mb_ ).NE.desca( nb_ ) )
THEN
190 CALL pxerbla( ictxt,
'PSGETF2', -info )
191 CALL blacs_abort( ictxt, 1 )
197 IF( m.EQ.0 .OR. n.EQ.0 )
201 CALL infog2l( ia, ja, desca, nprow, npcol, myrow, mycol, iia, jja,
203 CALL pb_topget( ictxt,
'Broadcast',
'Rowwise', rowbtop )
205 IF( mycol.EQ.iacol )
THEN
206 DO 10 j = ja, ja+mn-1
211 CALL psamax( m-j+ja, gmax, ipiv( iia+j-ja ), a, i, j,
213 IF( gmax.NE.zero )
THEN
217 CALL psswap( n, a, i, ja, desca, desca( m_ ), a,
218 $ ipiv( iia+j-ja ), ja, desca, desca( m_ ) )
223 $
CALL psscal( m-j+ja-1, one / gmax, a, i+1, j,
225 ELSE IF( info.EQ.0 )
THEN
231 IF( j-ja+1.LT.mn )
THEN
232 CALL psger( m-j+ja-1, n-j+ja-1, -one, a, i+1, j, desca,
233 $ 1, a, i, j+1, desca, desca( m_ ), a, i+1,
238 CALL igebs2d( ictxt,
'Rowwise', rowbtop, mn, 1, ipiv( iia ),
243 CALL igebr2d( ictxt,
'Rowwise', rowbtop, mn, 1, ipiv( iia ),