1 SUBROUTINE pzpotf2( UPLO, N, A, IA, JA, DESCA, INFO )
10 INTEGER IA, INFO, JA, N
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 )
143 DOUBLE PRECISION ONE, ZERO
144 parameter( one = 1.0d+0, zero = 0.0d+0 )
146 parameter( cone = 1.0d+0 )
150 CHARACTER COLBTOP, ROWBTOP
151 INTEGER IACOL, IAROW, ICOFF, ICTXT, ICURR, IDIAG, IIA,
152 $ IOFFA, IROFF, J, JJA, LDA, MYCOL, MYROW,
157 EXTERNAL blacs_abort, blacs_gridinfo,
chk1mat, igebr2d,
162 INTRINSIC dble, mod, sqrt
167 EXTERNAL lsame, zdotc
173 ictxt = desca( ctxt_ )
174 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
179 IF( nprow.EQ.-1 )
THEN
182 CALL chk1mat( n, 2, n, 2, ia, ja, desca, 6, info )
184 upper = lsame( uplo,
'U' )
185 iroff = mod( ia-1, desca( mb_ ) )
186 icoff = mod( ja-1, desca( nb_ ) )
187 IF ( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
189 ELSE IF( n+icoff.GT.desca( nb_ ) )
THEN
191 ELSE IF( iroff.NE.0 )
THEN
193 ELSE IF( icoff.NE.0 )
THEN
195 ELSE IF( desca( mb_ ).NE.desca( nb_ ) )
THEN
202 CALL pxerbla( ictxt,
'PZPOTF2', -info )
203 CALL blacs_abort( ictxt, 1 )
214 CALL infog2l( ia, ja, desca, nprow, npcol, myrow, mycol, iia, jja,
216 CALL pb_topget( ictxt,
'Broadcast',
'Rowwise', rowbtop )
217 CALL pb_topget( ictxt,
'Broadcast',
'Columnwise', colbtop )
223 IF( myrow.EQ.iarow )
THEN
224 IF( mycol.EQ.iacol )
THEN
229 idiag = iia + ( jja - 1 ) * lda
236 ajj = dble( a( idiag ) ) -
237 $ zdotc( j-ja, a( ioffa ), 1, a( ioffa ), 1 )
238 IF( ajj.LE.zero )
THEN
248 IF( j.LT.ja+n-1 )
THEN
250 CALL zlacgv( j-ja, a( ioffa ), 1 )
251 CALL zgemv(
'Transpose', j-ja, ja+n-j-1, -cone,
252 $ a( ioffa+lda ), lda, a( ioffa ), 1,
253 $ cone, a( icurr ), lda )
254 CALL zlacgv( j-ja, a( ioffa ), 1 )
255 CALL zdscal( ja+n-j-1, one / ajj, a( icurr ),
258 idiag = idiag + lda + 1
266 CALL igebs2d( ictxt,
'Rowwise', rowbtop, 1, 1, info, 1 )
270 CALL igebr2d( ictxt,
'Rowwise', rowbtop, 1, 1, info, 1,
276 CALL igebs2d( ictxt,
'Columnwise', colbtop, 1, 1, info, 1 )
280 CALL igebr2d( ictxt,
'Columnwise', colbtop, 1, 1, info, 1,
289 IF( mycol.EQ.iacol )
THEN
290 IF( myrow.EQ.iarow )
THEN
295 idiag = iia + ( jja - 1 ) * lda
302 ajj = dble( a( idiag ) ) -
303 $ zdotc( j-ja, a( ioffa ), lda, a( ioffa ), lda )
304 IF ( ajj.LE.zero )
THEN
314 IF( j.LT.ja+n-1 )
THEN
316 CALL zlacgv( j-ja, a( ioffa ), lda )
317 CALL zgemv(
'No transpose', ja+n-j-1, j-ja, -cone,
318 $ a( ioffa+1 ), lda, a( ioffa ), lda,
319 $ cone, a( icurr ), 1 )
320 CALL zlacgv( j-ja, a( ioffa ), lda )
321 CALL zdscal( ja+n-j-1, one / ajj, a( icurr ), 1 )
323 idiag = idiag + lda + 1
331 CALL igebs2d( ictxt,
'Columnwise', colbtop, 1, 1, info,
336 CALL igebr2d( ictxt,
'Columnwise', colbtop, 1, 1, info,
343 CALL igebs2d( ictxt,
'Rowwise', rowbtop, 1, 1, info, 1 )
347 CALL igebr2d( ictxt,
'Rowwise', rowbtop, 1, 1, info, 1,