1 SUBROUTINE pdpotrf( UPLO, N, A, IA, JA, DESCA, INFO )
10 INTEGER IA, INFO, JA, N
14 DOUBLE PRECISION A( * )
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.0d+0 )
148 CHARACTER COLBTOP, ROWBTOP
149 INTEGER I, ICOFF, ICTXT, IROFF, J, JB, JN, MYCOL,
150 $ MYROW, NPCOL, NPROW
153 INTEGER IDUM1( 1 ), IDUM2( 1 )
157 $ pb_topset,
pdpotf2, pdsyrk, pdtrsm,
163 EXTERNAL iceil, lsame
166 INTRINSIC ichar,
min, mod
172 ictxt = desca( ctxt_ )
173 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
178 IF( nprow.EQ.-1 )
THEN
181 CALL chk1mat( n, 2, n, 2, ia, ja, desca, 6, info )
182 upper = lsame( uplo,
'U' )
184 iroff = mod( ia-1, desca( mb_ ) )
185 icoff = mod( ja-1, desca( nb_ ) )
186 IF ( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
188 ELSE IF( iroff.NE.0 )
THEN
190 ELSE IF( icoff.NE.0 )
THEN
192 ELSE IF( desca( mb_ ).NE.desca( nb_ ) )
THEN
197 idum1( 1 ) = ichar(
'U' )
199 idum1( 1 ) = ichar(
'L' )
202 CALL pchk1mat( n, 2, n, 2, ia, ja, desca, 6, 1, idum1, idum2,
207 CALL pxerbla( ictxt,
'PDPOTRF', -info )
216 CALL pb_topget( ictxt,
'Broadcast',
'Rowwise', rowbtop )
217 CALL pb_topget( ictxt,
'Broadcast',
'Columnwise', colbtop )
224 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise',
' ' )
225 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise',
'S-ring' )
231 jn =
min( iceil( ja, desca( nb_ ) )*desca(nb_), ja+n-1 )
236 CALL pdpotf2( uplo, jb, a, ia, ja, desca, info )
244 CALL pdtrsm(
'Left', uplo,
'Transpose',
'Non-Unit',
245 $ jb, n-jb, one, a, ia, ja, desca, a, ia, ja+jb,
250 CALL pdsyrk( uplo,
'Transpose', n-jb, jb, -one, a, ia,
251 $ ja+jb, desca, one, a, ia+jb, ja+jb, desca )
256 DO 10 j = jn+1, ja+n-1, desca( nb_ )
257 jb =
min( n-j+ja, desca( nb_ ) )
262 CALL pdpotf2( uplo, jb, a, i, j, desca, info )
268 IF( j-ja+jb+1.LE.n )
THEN
272 CALL pdtrsm(
'Left', uplo,
'Transpose',
'Non-Unit',
273 $ jb, n-j-jb+ja, one, a, i, j, desca, a,
278 CALL pdsyrk( uplo,
'Transpose', n-j-jb+ja, jb,
279 $ -one, a, i, j+jb, desca, one, a, i+jb,
289 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise',
'S-ring' )
290 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise',
' ' )
297 jn =
min( iceil( ja, desca( nb_ ) )*desca( nb_ ), ja+n-1 )
302 CALL pdpotf2( uplo, jb, a, ia, ja, desca, info )
310 CALL pdtrsm(
'Right', uplo,
'Transpose',
'Non-Unit',
311 $ n-jb, jb, one, a, ia, ja, desca, a, ia+jb, ja,
316 CALL pdsyrk( uplo,
'No Transpose', n-jb, jb, -one, a, ia+jb,
317 $ ja, desca, one, a, ia+jb, ja+jb, desca )
321 DO 20 j = jn+1, ja+n-1, desca( nb_ )
322 jb =
min( n-j+ja, desca( nb_ ) )
327 CALL pdpotf2( uplo, jb, a, i, j, desca, info )
333 IF( j-ja+jb+1.LE.n )
THEN
337 CALL pdtrsm(
'Right', uplo,
'Transpose',
'Non-Unit',
338 $ n-j-jb+ja, jb, one, a, i, j, desca, a, i+jb,
343 CALL pdsyrk( uplo,
'No Transpose', n-j-jb+ja, jb, -one,
344 $ a, i+jb, j, desca, one, a, i+jb, j+jb,
354 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise', rowbtop )
355 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise', colbtop )