|
|
| |
| # lines: |
363 | | # code: |
363 | | # comment: | 0 | |
# blank: | 0 |
| # Variables: | 36 |
| # Callers: | 3 |
| # Callings: | 1 |
| # Words: | 186 |
| # Keywords: | 119 |
|
|
|
|
|
..
.. Array Arguments ..
..
Purpose
=======
PCPOTRF computes the Cholesky factorization of an N-by-N complex
hermitian positive definite distributed matrix sub( A ) denoting
A(IA:IA+N-1, JA:JA+N-1).
The factorization has the form
sub( A ) = U' * U , if UPLO = 'U', or
sub( A ) = L * L', if UPLO = 'L',
where U is an upper triangular matrix and L is lower triangular.
Notes
=====
Each global data object is described by an associated description
vector. This vector stores the information required to establish
the mapping between an object element and its corresponding process
and memory location.
Let A be a generic term for any 2D block cyclicly distributed array.
Such a global array has an associated description vector DESCA.
In the following comments, the character _ should be read as
"of the global array".
NOTATION STORED IN EXPLANATION
--------------- -------------- --------------------------------------
DTYPE_A(global) DESCA( DTYPE_ )The descriptor type. In this case,
DTYPE_A = 1.
CTXT_A (global) DESCA( CTXT_ ) The BLACS context handle, indicating
the BLACS process grid A is distribu-
ted over. The context itself is glo-
bal, but the handle (the integer
value) may vary.
M_A (global) DESCA( M_ ) The number of rows in the global
array A.
N_A (global) DESCA( N_ ) The number of columns in the global
array A.
MB_A (global) DESCA( MB_ ) The blocking factor used to distribute
the rows of the array.
NB_A (global) DESCA( NB_ ) The blocking factor used to distribute
the columns of the array.
RSRC_A (global) DESCA( RSRC_ ) The process row over which the first
row of the array A is distributed.
CSRC_A (global) DESCA( CSRC_ ) The process column over which the
first column of the array A is
distributed.
LLD_A (local) DESCA( LLD_ ) The leading dimension of the local
array. LLD_A >= MAX(1,LOCr(M_A)).
Let K be the number of rows or columns of a distributed matrix,
and assume that its process grid has dimension p x q.
LOCr( K ) denotes the number of elements of K that a process
would receive if K were distributed over the p processes of its
process column.
Similarly, LOCc( K ) denotes the number of elements of K that a
process would receive if K were distributed over the q processes of
its process row.
The values of LOCr() and LOCc() may be determined via a call to the
ScaLAPACK tool function, NUMROC:
LOCr( M ) = NUMROC( M, MB_A, MYROW, RSRC_A, NPROW ),
LOCc( N ) = NUMROC( N, NB_A, MYCOL, CSRC_A, NPCOL ).
An upper bound for these quantities may be computed by:
LOCr( M ) <= ceil( ceil(M/MB_A)/NPROW )*MB_A
LOCc( N ) <= ceil( ceil(N/NB_A)/NPCOL )*NB_A
This routine requires square block decomposition ( MB_A = NB_A ).
Arguments
=========
UPLO (global input) CHARACTER
= 'U': Upper triangle of sub( A ) is stored;
= 'L': Lower triangle of sub( A ) is stored.
N (global input) INTEGER
The number of rows and columns to be operated on, i.e. the
order of the distributed submatrix sub( A ). N >= 0.
A (local input/local output) COMPLEX pointer into the
local memory to an array of dimension (LLD_A, LOCc(JA+N-1)).
On entry, this array contains the local pieces of the
N-by-N Hermitian distributed matrix sub( A ) to be factored.
If UPLO = 'U', the leading N-by-N upper triangular part of
sub( A ) contains the upper triangular part of the matrix,
and its strictly lower triangular part is not referenced.
If UPLO = 'L', the leading N-by-N lower triangular part of
sub( A ) contains the lower triangular part of the distribu-
ted matrix, and its strictly upper triangular part is not
referenced. On exit, if UPLO = 'U', the upper triangular
part of the distributed matrix contains the Cholesky factor
U, if UPLO = 'L', the lower triangular part of the distribu-
ted matrix contains the Cholesky factor L.
IA (global input) INTEGER
The row index in the global array A indicating the first
row of sub( A ).
JA (global input) INTEGER
The column index in the global array A indicating the
first column of sub( A ).
DESCA (global and local input) INTEGER array of dimension DLEN_.
The array descriptor for the distributed matrix A.
INFO (global output) INTEGER
= 0: successful exit
< 0: If the i-th argument is an array and the j-entry had
an illegal value, then INFO = -(i*100+j), if the i-th
argument is a scalar and had an illegal value, then
INFO = -i.
> 0: If INFO = K, the leading minor of order K,
A(IA:IA+K-1,JA:JA+K-1) is not positive definite, and
the factorization could not be completed.
=====================================================================
.. Parameters ..
|
|
|
|
001 SUBROUTINE PCPOTRF( UPLO , N , A , IA , JA , DESCA , INFO )
002
003 * -- ScaLAPACK routine(version 1.7) --
004 * University of Tennessee , Knoxville , Oak Ridge National Laboratory ,
005 * and University of California , Berkeley.
006 * May 25 , 2001
007
008 * .. Scalar Arguments ..
009 CHARACTER UPLO
010 INTEGER IA , INFO , JA , N
011 INTEGER BLOCK_CYCLIC_2D , CSRC_ , CTXT_ , DLEN_ , DTYPE_ ,
012 $LLD_ , MB_ , M_ , NB_ , N_ , RSRC_
013 PARAMETER( BLOCK_CYCLIC_2D = 1 , DLEN_ = 9 , DTYPE_ = 1 ,
014 $CTXT_ = 2 , M_ = 3 , N_ = 4 , MB_ = 5 , NB_ = 6 ,
015 $RSRC_ = 7 , CSRC_ = 8 , LLD_ = 9 )
016 REAL ONE
017 PARAMETER( ONE = 1.0E + 0 )
018 COMPLEX CONE
019 PARAMETER( CONE =( 1.0E + 0 , 0.0E + 0 ) )
020 * ..
021 * .. Local Scalars ..
022 LOGICAL UPPER
023 CHARACTER COLBTOP , ROWBTOP
024 INTEGER I , ICOFF , ICTXT , IROFF , J , JB , JN , MYCOL ,
025 $MYROW , NPCOL , NPROW
026 * ..
027 * .. Local Arrays ..
028 INTEGER IDUM1( 1 ) , IDUM2( 1 )
029 * ..
030 * .. External Subroutines ..
031 EXTERNAL BLACS_GRIDINFO , CHK1MAT , PCHK1MAT , PB_TOPGET ,
032 $PB_TOPSET , PCPOTF2 , PCHERK , PCTRSM ,
033 $PXERBLA
034 * ..
035 * .. External Functions ..
036 LOGICAL LSAME
037 INTEGER ICEIL
038 EXTERNAL ICEIL , LSAME
039 * ..
040 * .. Intrinsic Functions ..
041 INTRINSIC ICHAR , MIN , MOD
042 * ..
043 * .. Executable Statements ..
044
045 * Get grid parameters
046
047 ICTXT = DESCA( CTXT_ )
048 CALL BLACS_GRIDINFO( ICTXT , NPROW , NPCOL , MYROW , MYCOL )
049
050 * Test the input parameters
051
052 INFO = 0
053 IF( NPROW.EQ. - 1 ) THEN
053
054 INFO = - (600 + CTXT_)
055 ELSE
055
056 CALL CHK1MAT( N , 2 , N , 2 , IA , JA , DESCA , 6 , INFO )
057 UPPER = LSAME( UPLO , 'U' )
058 IF( INFO.EQ.0 ) THEN
058
059 IROFF = MOD( IA - 1 , DESCA( MB_ ) )
060 ICOFF = MOD( JA - 1 , DESCA( NB_ ) )
061 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO , 'L' ) ) THEN
061
062 INFO = - 1
063 ELSE IF( IROFF.NE.0 ) THEN
063
064 INFO = - 4
065 ELSE IF( ICOFF.NE.0 ) THEN
065
066 INFO = - 5
067 ELSE IF( DESCA( MB_ ).NE.DESCA( NB_ ) ) THEN
067
068 INFO = - (600 + NB_)
069 END IF
070 END IF
071 IF( UPPER ) THEN
071
072 IDUM1( 1 ) = ICHAR( 'U' )
073 ELSE
073
074 IDUM1( 1 ) = ICHAR( 'L' )
075 END IF
076 IDUM2( 1 ) = 1
077 CALL PCHK1MAT( N , 2 , N , 2 , IA , JA , DESCA , 6 , 1 , IDUM1 , IDUM2 ,
078 $ INFO )
079 END IF
080
081 IF( INFO.NE.0 ) THEN
081
082 CALL PXERBLA( ICTXT , 'PCPOTRF' , - INFO )
083 RETURN
084 END IF
085
086 * Quick return if possible
087
088 IF( N.EQ.0 )
088
089 $ RETURN
090
091 CALL PB_TOPGET( ICTXT , 'Broadcast' , 'Rowwise' , ROWBTOP )
092 CALL PB_TOPGET( ICTXT , 'Broadcast' , 'Columnwise' , COLBTOP )
093
094 IF( UPPER ) THEN
095
096 * Split - ring topology for the communication along process
097 * columns , 1 - tree topology along process rows.
098
098
099 CALL PB_TOPSET( ICTXT , 'Broadcast' , 'Rowwise' , ' ' )
100 CALL PB_TOPSET( ICTXT , 'Broadcast' , 'Columnwise' , 'S - ring' )
101
102 * A is upper triangular , compute Cholesky factorization A = U'*U.
103
104 * Handle the first block of columns separately
105
106 JN = MIN( ICEIL( JA , DESCA( NB_ ) )*DESCA(NB_) , JA + N - 1 )
107 JB = JN - JA + 1
108
109 * Perform unblocked Cholesky factorization on JB block
110
111 CALL PCPOTF2 ( UPLO , JB , A , IA , JA , DESCA , INFO )
112 IF( INFO.NE.0 )
112
113 $ GO TO 30
114
115 IF( JB + 1.LE.N ) THEN
116
117 * Form the row panel of U using the triangular solver
118
118
119 CALL PCTRSM( 'Left' , UPLO , 'Conjugate transpose' ,
120 $ 'Non - Unit' , JB , N - JB , CONE , A , IA , JA , DESCA ,
121 $ A , IA , JA + JB , DESCA )
122
123 * Update the trailing matrix , A = A - U'*U
124
125 CALL PCHERK( UPLO , 'Conjugate transpose' , N - JB , JB , - ONE , A ,
126 $ IA , JA + JB , DESCA , ONE , A , IA + JB , JA + JB , DESCA )
127 END IF
128
129 * Loop over remaining block of columns
130
131 DO 10 J = JN + 1 , JA + N - 1 , DESCA( NB_ )
131
132 JB = MIN( N - J + JA , DESCA( NB_ ) )
133 I = IA + J - JA
134
135 * Perform unblocked Cholesky factorization on JB block
136
137 CALL PCPOTF2 ( UPLO , JB , A , I , J , DESCA , INFO )
138 IF( INFO.NE.0 ) THEN
138
139 INFO = INFO + J - JA
140 GO TO 30
141 END IF
142
143 IF( J - JA + JB + 1.LE.N ) THEN
144
145 * Form the row panel of U using the triangular solver
146
146
147 CALL PCTRSM( 'Left' , UPLO , 'Conjugate transpose' ,
148 $ 'Non - Unit' , JB , N - J - JB + JA , CONE , A , I , J ,
149 $ DESCA , A , I , J + JB , DESCA )
150
151 * Update the trailing matrix , A = A - U'*U
152
153 CALL PCHERK( UPLO , 'Conjugate transpose' , N - J - JB + JA , JB ,
154 $ - ONE , A , I , J + JB , DESCA , ONE , A , I + JB ,
155 $ J + JB , DESCA )
156 END IF
157 10 CONTINUE
158
158
159 ELSE
160
161 * 1 - tree topology for the communication along process columns ,
162 * Split - ring topology along process rows.
163
163
164 CALL PB_TOPSET( ICTXT , 'Broadcast' , 'Rowwise' , 'S - ring' )
165 CALL PB_TOPSET( ICTXT , 'Broadcast' , 'Columnwise' , ' ' )
166
167 * A is lower triangular , compute Cholesky factorization A = L*L'
168 * (right - looking)
169
170 * Handle the first block of columns separately
171
172 JN = MIN( ICEIL( JA , DESCA( NB_ ) )*DESCA( NB_ ) , JA + N - 1 )
173 JB = JN - JA + 1
174
175 * Perform unblocked Cholesky factorization on JB block
176
177 CALL PCPOTF2 ( UPLO , JB , A , IA , JA , DESCA , INFO )
178 IF( INFO.NE.0 )
178
179 $ GO TO 30
180
181 IF( JB + 1.LE.N ) THEN
182
183 * Form the column panel of L using the triangular solver
184
184
185 CALL PCTRSM( 'Right' , UPLO , 'Conjugate transpose' ,
186 $ 'Non - Unit' , N - JB , JB , CONE , A , IA , JA , DESCA ,
187 $ A , IA + JB , JA , DESCA )
188
189 * Update the trailing matrix , A = A - L*L'
190
191 CALL PCHERK( UPLO , 'No Transpose' , N - JB , JB , - ONE , A , IA + JB ,
192 $ JA , DESCA , ONE , A , IA + JB , JA + JB , DESCA )
193
194 END IF
195
196 DO 20 J = JN + 1 , JA + N - 1 , DESCA( NB_ )
196
197 JB = MIN( N - J + JA , DESCA( NB_ ) )
198 I = IA + J - JA
199
200 * Perform unblocked Cholesky factorization on JB block
201
202 CALL PCPOTF2 ( UPLO , JB , A , I , J , DESCA , INFO )
203 IF( INFO.NE.0 ) THEN
203
204 INFO = INFO + J - JA
205 GO TO 30
206 END IF
207
208 IF( J - JA + JB + 1.LE.N ) THEN
209
210 * Form the column panel of L using the triangular solver
211
211
212 CALL PCTRSM( 'Right' , UPLO , 'Conjugate transpose' ,
213 $ 'Non - Unit' , N - J - JB + JA , JB , CONE , A , I , J ,
214 $ DESCA , A , I + JB , J , DESCA )
215
216 * Update the trailing matrix , A = A - L*L'
217
218 CALL PCHERK( UPLO , 'No Transpose' , N - J - JB + JA , JB , - ONE ,
219 $ A , I + JB , J , DESCA , ONE , A , I + JB , J + JB ,
220 $ DESCA )
221
222 END IF
223 20 CONTINUE
224
224
225 END IF
226
227 30 CONTINUE
228
229 CALL PB_TOPSET( ICTXT , 'Broadcast' , 'Rowwise' , ROWBTOP )
230 CALL PB_TOPSET( ICTXT , 'Broadcast' , 'Columnwise' , COLBTOP )
231
232 RETURN
233
234 * End of PCPOTRF
235
236 END61
25
|
|
Variables in Routine PCPOTRF()
| Summary Report |
| Data Type | Quantity | Size(byte) |
| CHARACTER | 3 | 3 |
| COMPLEX | 1 | 4 |
| INTEGER | 29 | 120 |
| LOGICAL | 2 | 2 |
| REAL | 1 | 4 |
| TOTAL | 36 | 133 |
List of Variables
CHARACTER
COMPLEX
INTEGER
| BLOCK_CYCLIC_2D | CSRC_ | CTXT_ | DLEN_ | DTYPE_ |
| I | IA | ICEIL | ICOFF | ICTXT |
| IDUM1( 1 ) | IDUM2( 1 ) | INFO | IROFF | J |
| JA | JB | JN | LLD_ | M_ |
| MB_ | MYCOL | MYROW | N | N_ |
| NB_ | NPCOL | NPROW | RSRC_ | |
LOGICAL
REAL
Variables Dependence Graph Put the mouse over a right hand side variable to display the corresponding line of the dependence | | - | | - | - | | I | <--- | JI = IA + J - JA{2I = IA + J - JA}, JAI = IA + J - JA{2I = IA + J - JA}, IAI = IA + J - JA{2I = IA + J - JA} |
| ICOFF | <--- | JAICOFF = MOD( JA-1, DESCA( NB_ ) ), NB_ICOFF = MOD( JA-1, DESCA( NB_ ) ) |
| ICTXT | <--- | CTXT_ICTXT = DESCA( CTXT_ ) |
| INFO | <--- | INFOINFO = INFO + J - JA{2INFO = INFO + J - JA}, JINFO = INFO + J - JA{2INFO = INFO + J - JA}, JAINFO = INFO + J - JA{2INFO = INFO + J - JA}, NB_INFO = -(600+NB_), CTXT_INFO = -(600+CTXT_) |
| IROFF | <--- | MB_IROFF = MOD( IA-1, DESCA( MB_ ) ), IAIROFF = MOD( IA-1, DESCA( MB_ ) ) |
| J | <--- | JADO 10 J = JN+1, JA+N-1, DESCA( NB_ ){2DO 20 J = JN+1, JA+N-1, DESCA( NB_ )}, JNDO 10 J = JN+1, JA+N-1, DESCA( NB_ ){2DO 20 J = JN+1, JA+N-1, DESCA( NB_ )}, NDO 10 J = JN+1, JA+N-1, DESCA( NB_ ){2DO 20 J = JN+1, JA+N-1, DESCA( NB_ )}, NB_DO 10 J = JN+1, JA+N-1, DESCA( NB_ ){2DO 20 J = JN+1, JA+N-1, DESCA( NB_ )} |
| JB | <--- | JJB = MIN( N-J+JA, DESCA( NB_ ) ){2JB = MIN( N-J+JA, DESCA( NB_ ) )}, JAJB = JN - JA + 1{2JB = MIN( N-J+JA, DESCA( NB_ ) ), 3JB = JN - JA + 1, 4JB = MIN( N-J+JA, DESCA( NB_ ) )}, JNJB = JN - JA + 1{2JB = JN - JA + 1}, NJB = MIN( N-J+JA, DESCA( NB_ ) ){2JB = MIN( N-J+JA, DESCA( NB_ ) )}, NB_JB = MIN( N-J+JA, DESCA( NB_ ) ){2JB = MIN( N-J+JA, DESCA( NB_ ) )} |
| JN | <--- | ICEILJN = MIN( ICEIL( JA, DESCA( NB_ ) )*DESCA(NB_), JA+N-1 ){2JN = MIN( ICEIL( JA, DESCA( NB_ ) )*DESCA( NB_ ), JA+N-1 )}, JAJN = MIN( ICEIL( JA, DESCA( NB_ ) )*DESCA(NB_), JA+N-1 ){2JN = MIN( ICEIL( JA, DESCA( NB_ ) )*DESCA( NB_ ), JA+N-1 )}, NJN = MIN( ICEIL( JA, DESCA( NB_ ) )*DESCA(NB_), JA+N-1 ){2JN = MIN( ICEIL( JA, DESCA( NB_ ) )*DESCA( NB_ ), JA+N-1 )}, NB_JN = MIN( ICEIL( JA, DESCA( NB_ ) )*DESCA(NB_), JA+N-1 ){2JN = MIN( ICEIL( JA, DESCA( NB_ ) )*DESCA( NB_ ), JA+N-1 )} |
| UPPER | <--- | LSAMEUPPER = LSAME( UPLO, 'U' ), UPLOUPPER = LSAME( UPLO, 'U' ) |
|
|
Analysis elements of the routine PCPOTRF() Put the mouse over each element to display detailed matching information
Assigned variables |
| | | A , BLOCK_CYCLIC_2D , CONE , CSRC_ , CTXT_ , DLEN_ , DTYPE_ , I , ICOFF , ICTXT , IDUM1 , IDUM2 , INFO , IROFF , J , JB , JN , LLD_ , M_ , MB_ , N_ , NB_ , ONE , RSRC_ , UPPER |
|
Active variables |
| | | A , BLOCK_CYCLIC_2D , COLBTOP , CONE , CSRC_ , CTXT_ , DESCA , DLEN_ , DTYPE_ , I , IA , ICEIL , ICOFF , ICTXT , IDUM1 , IDUM2 , INFO , IROFF , J , JA , JB , JN , LLD_ , LSAME , M_ , MB_ , MYCOL , MYROW , N , N_ , NB_ , NPCOL , NPROW , ONE , ROWBTOP , RSRC_ , UPLO , UPPER |
|
Accessed arrays [ array name : associated index ] |
| | DESCA | : CTXT_ , MB_ , MB_ , NB_ , NB_ , NB_ , NB_ , NB_ , NB_ , NB_ , NB_ |
| | ICEIL | : JA, DESCA( NB_ ) , JA, DESCA( NB_ ) |
| | IDUM1 | : 1 , 1 , 1 |
| | IDUM2 | : 1 , 1 |
| | LSAME | : UPLO, 'L' , UPLO, 'U' |
|
Conditional statements [ statement : associated predicate ] |
| | do | : ( 10 J = JN + 1 , JA + N - 1 , DESCA( NB_ ) ) , ( 20 J = JN + 1 , JA + N - 1 , DESCA( NB_ ) ) |
| | for | : ( the communication along process ) , ( the communication along process columns , ) |
| | if | : ( NPROW.EQ. - 1 ) , ( INFO.EQ.0 ) , ( (.NOT.UPPER .AND. .NOT.LSAME( UPLO , 'L' ) ) ) , ( IROFF.NE.0 ) , ( ICOFF.NE.0 ) , ( (DESCA( MB_ ).NE.DESCA( NB_ ) ) ) , ( UPPER ) , ( INFO.NE.0 ) , ( possible ) , ( N.EQ.0 ) , ( UPPER ) , ( INFO.NE.0 ) , ( JB+1.LE.N ) , ( INFO.NE.0 ) , ( J-JA+JB + 1.LE.N ) , ( INFO.NE.0 ) , ( JB+1.LE.N ) , ( INFO.NE.0 ) , ( J-JA+JB + 1.LE.N ) |
|
| List of variables | BLOCK_CYCLIC_2D COLBTOP CONE CSRC_ CTXT_ DLEN_ DTYPE_
| I IA ICEIL ICOFF ICTXT IDUM1( 1 ) IDUM2( 1 ) INFO
| IROFF J JA JB JN LLD_ LSAME M_
| MB_ MYCOL MYROW N N_ NB_ NPCOL NPROW
| ONE ROWBTOP RSRC_ UPLO UPPER | | close
| |
BLOCK_CYCLIC_2D
COLBTOP
CONE
CSRC_
CTXT_
DLEN_
DTYPE_
I
IA
ICEIL
ICOFF
ICTXT
IDUM1( 1 )
IDUM2( 1 )
INFO
IROFF
J
JA
JB
JN
LLD_
LSAME
M_
MB_
MYCOL
MYROW
N
N_
NB_
NPCOL
NPROW
ONE
ROWBTOP
RSRC_
UPLO
UPPER
127
| |