1 SUBROUTINE pslaqsy( UPLO, N, A, IA, JA, DESCA, SR, SC, SCOND,
16 REAL A( * ), SC( * ), SR( * )
156 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
157 $ lld_, mb_, m_, nb_, n_, rsrc_
158 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
159 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
160 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
162 parameter( one = 1.0e+0, thresh = 0.1e+0 )
165 INTEGER IACOL, IAROW, ICTXT, II, IIA, IOFFA, IROFF, J,
166 $ jb, jj, jja, jn, kk, lda, ll, mycol, myrow, np,
168 REAL CJ, LARGE, SMALL
171 EXTERNAL blacs_gridinfo,
infog2l
175 INTEGER ICEIL, NUMROC
177 EXTERNAL iceil, lsame, numroc, pslamch
193 ictxt = desca( ctxt_ )
194 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
195 CALL infog2l( ia, ja, desca, nprow, npcol, myrow, mycol, iia, jja,
201 small = pslamch( ictxt,
'Safe minimum' ) /
202 $ pslamch( ictxt,
'Precision' )
205 IF( scond.GE.thresh .AND. amax.GE.small .AND. amax.LE.large )
THEN
215 jn =
min( iceil( ja, desca( nb_ ) ) * desca( nb_ ), ja+n-1 )
220 IF( lsame( uplo,
'U' ) )
THEN
226 IF( mycol.EQ.iacol )
THEN
227 IF( myrow.EQ.iarow )
THEN
228 DO 20 ll = jj, jj + jb -1
230 DO 10 kk = iia, ii+ll-jj+1
231 a( ioffa + kk ) = cj*sr( kk )*a( ioffa + kk )
236 ioffa = ioffa + jb*lda
243 iarow = mod( iarow+1, nprow )
244 iacol = mod( iacol+1, npcol )
248 DO 70 j = jn+1, ja+n-1, desca( nb_ )
249 jb =
min( ja+n-j, desca( nb_ ) )
251 IF( mycol.EQ.iacol )
THEN
252 IF( myrow.EQ.iarow )
THEN
253 DO 40 ll = jj, jj + jb -1
255 DO 30 kk = iia, ii+ll-jj+1
256 a( ioffa + kk ) = cj*sr( kk )*a( ioffa + kk )
261 DO 60 ll = jj, jj + jb -1
264 a( ioffa + kk ) = cj*sr( kk )*a( ioffa + kk )
274 iarow = mod( iarow+1, nprow )
275 iacol = mod( iacol+1, npcol )
284 iroff = mod( ia-1, desca( mb_ ) )
285 np = numroc( n+iroff, desca( mb_ ), myrow, iarow, nprow )
290 IF( mycol.EQ.iacol )
THEN
291 IF( myrow.EQ.iarow )
THEN
292 DO 90 ll = jj, jj + jb -1
294 DO 80 kk = ii+ll-jj, iia+np-1
295 a( ioffa + kk ) = cj*sr( kk )*a( ioffa + kk )
300 DO 110 ll = jj, jj + jb -1
302 DO 100 kk = ii, iia+np-1
303 a( ioffa + kk ) = cj*sr( kk )*a( ioffa + kk )
313 iarow = mod( iarow+1, nprow )
314 iacol = mod( iacol+1, npcol )
318 DO 160 j = jn+1, ja+n-1, desca( nb_ )
319 jb =
min( ja+n-j, desca( nb_ ) )
321 IF( mycol.EQ.iacol )
THEN
322 IF( myrow.EQ.iarow )
THEN
323 DO 130 ll = jj, jj + jb -1
325 DO 120 kk = ii+ll-jj, iia+np-1
326 a( ioffa + kk ) = cj*sr( kk )*a( ioffa + kk )
331 DO 150 ll = jj, jj + jb -1
333 DO 140 kk = ii, iia+np-1
334 a( ioffa + kk ) = cj*sr( kk )*a( ioffa + kk )
344 iarow = mod( iarow+1, nprow )
345 iacol = mod( iacol+1, npcol )