|
|
| |
| # lines: |
276 | | # code: |
276 | | # comment: | 0 | |
# blank: | 0 |
| # Variables: | 37 |
| # Callers: | 1 |
| # Callings: | 0 |
| # Words: | 104 |
| # Keywords: | 72 |
|
|
|
|
|
..
.. Array Arguments ..
..
Purpose
=======
PSTRTI2 computes the inverse of a real upper or lower triangular
block matrix sub( A ) = A(IA:IA+N-1,JA:JA+N-1). This matrix should be
contained in one and only one process memory space (local operation).
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
Arguments
=========
UPLO (global input) CHARACTER*1
= 'U': sub( A ) is upper triangular;
= 'L': sub( A ) is lower triangular.
DIAG (global input) CHARACTER*1
= 'N': sub( A ) is non-unit triangular
= 'U': sub( A ) is unit triangular
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) REAL pointer into the
local memory to an array of dimension (LLD_A,LOCc(JA+N-1)),
this array contains the local pieces of the triangular matrix
sub( A ). If UPLO = 'U', the leading N-by-N upper triangular
part of the matrix sub( A ) contains the upper triangular
matrix, and the strictly lower triangular part of sub( A )
is not referenced. If UPLO = 'L', the leading N-by-N lower
triangular part of the matrix sub( A ) contains the lower
triangular matrix, and the strictly upper triangular part
of sub( A ) is not referenced. If DIAG = 'U', the diagonal
elements of sub( A ) are also not referenced and are assumed
to be 1. On exit, the (triangular) inverse of the original
matrix, in the same storage format.
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 (local 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.
=====================================================================
.. Parameters ..
|
|
|
|
001 SUBROUTINE PSTRTI2( UPLO , DIAG , 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 1 , 1997
007
008 * .. Scalar Arguments ..
009 CHARACTER DIAG , 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 * ..
019 * .. Local Scalars ..
020 LOGICAL NOUNIT , UPPER
021 INTEGER IACOL , IAROW , ICTXT , ICURR , IDIAG , IIA , IOFFA ,
022 $JJA , LDA , MYCOL , MYROW , NA , NPCOL , NPROW
023 REAL AJJ
024 * ..
025 * .. External Subroutines ..
026 EXTERNAL BLACS_ABORT , BLACS_GRIDINFO , CHK1MAT , INFOG2L ,
027 $PXERBLA , SSCAL , STRMV
028 * ..
029 * .. External Functions ..
030 LOGICAL LSAME
031 EXTERNAL LSAME
032 * ..
033 * .. Executable Statements ..
034
035 * Get grid parameters
036
037 ICTXT = DESCA( CTXT_ )
038 CALL BLACS_GRIDINFO( ICTXT , NPROW , NPCOL , MYROW , MYCOL )
039
040 * Test the input parameters
041
042 INFO = 0
043 IF( NPROW.EQ. - 1 ) THEN
043
044 INFO = - (700 + CTXT_)
045 ELSE
045
046 CALL CHK1MAT( N , 3 , N , 3 , IA , JA , DESCA , 7 , INFO )
047 UPPER = LSAME( UPLO , 'U' )
048 NOUNIT = LSAME( DIAG , 'N' )
049 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO , 'L' ) ) THEN
049
050 INFO = - 1
051 ELSE IF( .NOT.NOUNIT .AND. .NOT.LSAME( DIAG , 'U' ) ) THEN
051
052 INFO = - 2
053 END IF
054 END IF
055
056 IF( INFO.NE.0 ) THEN
056
057 CALL PXERBLA( ICTXT , 'PSTRTI2' , - INFO )
058 CALL BLACS_ABORT( ICTXT , 1 )
059 RETURN
060 END IF
061
062 * Compute local indexes
063
064 CALL INFOG2L( IA , JA , DESCA , NPROW , NPCOL , MYROW , MYCOL , IIA , JJA ,
065 $IAROW , IACOL )
066
067 IF( MYROW.EQ.IAROW .AND. MYCOL.EQ.IACOL ) THEN
068
068
069 LDA = DESCA( LLD_ )
070
071 IF( UPPER ) THEN
072
072
073 IOFFA = IIA + ( JJA - 1 ) * LDA
074 ICURR = IOFFA + LDA
075
076 IF( NOUNIT ) THEN
077
078 * Compute inverse of upper non - unit triangular matrix.
079
079
080 A( IOFFA ) = ONE / A( IOFFA )
081 IDIAG = ICURR + 1
082 DO 10 NA = 1 , N - 1
082
083 A( IDIAG ) = ONE / A( IDIAG )
084 AJJ = - A( IDIAG )
085
086 * Compute elements 1 : j - 1 of j - th column.
087
088 CALL STRMV( 'Upper' , 'No transpose' , DIAG , NA ,
089 $ A( IOFFA ) , LDA , A( ICURR ) , 1 )
090 CALL SSCAL( NA , AJJ , A( ICURR ) , 1 )
091 IDIAG = IDIAG + LDA + 1
092 ICURR = ICURR + LDA
093 10 CONTINUE
094
094
095 ELSE
096
097 * Compute inverse of upper unit triangular matrix.
098
098
099 DO 20 NA = 1 , N - 1
100
101 * Compute elements 1 : j - 1 of j - th column.
102
102
103 CALL STRMV( 'Upper' , 'No transpose' , DIAG , NA ,
104 $ A( IOFFA ) , LDA , A( ICURR ) , 1 )
105 CALL SSCAL( NA , - ONE , A( ICURR ) , 1 )
106 ICURR = ICURR + LDA
107 20 CONTINUE
108
108
109 END IF
110
111 ELSE
112
112
113 ICURR = IIA + N - 1 + ( JJA + N - 2 ) * LDA
114 IOFFA = ICURR - LDA
115
116 IF( NOUNIT ) THEN
117
118 * Compute inverse of lower non - unit triangular matrix.
119
119
120 A( ICURR ) = ONE / A( ICURR )
121 IDIAG = IOFFA - 1
122 DO 30 NA = 1 , N - 1
122
123 A( IDIAG ) = ONE / A( IDIAG )
124 AJJ = - A( IDIAG )
125
126 * Compute elements j + 1 : n of j - th column.
127
128 CALL STRMV( 'Lower' , 'No transpose' , DIAG , NA ,
129 $ A( ICURR ) , LDA , A( IOFFA ) , 1 )
130 CALL SSCAL( NA , AJJ , A( IOFFA ) , 1 )
131 ICURR = IDIAG
132 IDIAG = IDIAG - LDA - 1
133 IOFFA = IDIAG + 1
134 30 CONTINUE
135
135
136 ELSE
137
138 * Compute inverse of lower unit triangular matrix.
139
139
140 DO 40 NA = 1 , N - 1
141
142 * Compute elements j + 1 : n of j - th column.
143
143
144 CALL STRMV( 'Lower' , 'No transpose' , DIAG , NA ,
145 $ A( ICURR ) , LDA , A( IOFFA ) , 1 )
146 CALL SSCAL( NA , - ONE , A( IOFFA ) , 1 )
147 ICURR = ICURR - LDA - 1
148 IOFFA = ICURR - LDA
149 40 CONTINUE
150
150
151 END IF
152
153 END IF
154
155 END IF
156
157 * End of PSTRTI2
158
159 END41
20
|
|
Variables in Routine PSTRTI2()
| Summary Report |
| Data Type | Quantity | Size(byte) |
| CHARACTER | 2 | 2 |
| INTEGER | 29 | 116 |
| LOGICAL | 3 | 3 |
| REAL | 3 | 12 |
| TOTAL | 37 | 133 |
List of Variables
CHARACTER
INTEGER
| BLOCK_CYCLIC_2D | CSRC_ | CTXT_ | DLEN_ | DTYPE_ |
| IA | IACOL | IAROW | ICTXT | ICURR |
| IDIAG | IIA | INFO | IOFFA | JA |
| JJA | LDA | LLD_ | M_ | MB_ |
| MYCOL | MYROW | N | N_ | NA |
| 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 | | - | | - | - | | A | <--- | AA( ICURR ) = ONE / A( ICURR ){2A( IDIAG ) = ONE / A( IDIAG ), 3A( IOFFA ) = ONE / A( IOFFA ), 4A( IDIAG ) = ONE / A( IDIAG )}, ICURRA( ICURR ) = ONE / A( ICURR ), IDIAGA( IDIAG ) = ONE / A( IDIAG ){2A( IDIAG ) = ONE / A( IDIAG )}, IOFFAA( IOFFA ) = ONE / A( IOFFA ), ONEA( ICURR ) = ONE / A( ICURR ){2A( IDIAG ) = ONE / A( IDIAG ), 3A( IOFFA ) = ONE / A( IOFFA ), 4A( IDIAG ) = ONE / A( IDIAG )} |
| AJJ | <--- | AAJJ = -A( IDIAG ){2AJJ = -A( IDIAG )}, IDIAGAJJ = -A( IDIAG ){2AJJ = -A( IDIAG )} |
| ICTXT | <--- | CTXT_ICTXT = DESCA( CTXT_ ) |
| ICURR | <--- | ICURRICURR = ICURR + LDA{2ICURR = ICURR - LDA - 1, 3ICURR = ICURR + LDA}, IDIAGICURR = IDIAG, IIAICURR = IIA + N - 1 + ( JJA + N - 2 ) * LDA, IOFFAICURR = IOFFA + LDA, JJAICURR = IIA + N - 1 + ( JJA + N - 2 ) * LDA, LDAICURR = ICURR + LDA{2ICURR = IIA + N - 1 + ( JJA + N - 2 ) * LDA, 3ICURR = ICURR - LDA - 1, 4ICURR = IOFFA + LDA, 5ICURR = ICURR + LDA}, NICURR = IIA + N - 1 + ( JJA + N - 2 ) * LDA |
| IDIAG | <--- | ICURRIDIAG = ICURR + 1, IDIAGIDIAG = IDIAG - LDA - 1{2IDIAG = IDIAG + LDA + 1}, IOFFAIDIAG = IOFFA - 1, LDAIDIAG = IDIAG - LDA - 1{2IDIAG = IDIAG + LDA + 1} |
| INFO | <--- | CTXT_INFO = -(700+CTXT_) |
| IOFFA | <--- | ICURRIOFFA = ICURR - LDA{2IOFFA = ICURR - LDA}, IDIAGIOFFA = IDIAG + 1, IIAIOFFA = IIA + ( JJA - 1 ) * LDA, JJAIOFFA = IIA + ( JJA - 1 ) * LDA, LDAIOFFA = ICURR - LDA{2IOFFA = ICURR - LDA, 3IOFFA = IIA + ( JJA - 1 ) * LDA} |
| LDA | <--- | LLD_LDA = DESCA( LLD_ ) |
| NA | <--- | NDO 30 NA = 1, N-1{2DO 40 NA = 1, N-1, 3DO 10 NA = 1, N-1, 4DO 20 NA = 1, N-1} |
| NOUNIT | <--- | LSAMENOUNIT = LSAME( DIAG, 'N' ), NNOUNIT = LSAME( DIAG, 'N' ), DIAGNOUNIT = LSAME( DIAG, 'N' ) |
| UPPER | <--- | LSAMEUPPER = LSAME( UPLO, 'U' ), UPLOUPPER = LSAME( UPLO, 'U' ) |
|
|
Analysis elements of the routine PSTRTI2() Put the mouse over each element to display detailed matching information
Assigned variables |
| | | AJJ , BLOCK_CYCLIC_2D , CSRC_ , CTXT_ , DLEN_ , DTYPE_ , ICTXT , ICURR , IDIAG , INFO , IOFFA , LDA , LLD_ , M_ , MB_ , N_ , NA , NB_ , NOUNIT , ONE , RSRC_ , UPPER |
|
Active variables |
| | | A , AJJ , BLOCK_CYCLIC_2D , CSRC_ , CTXT_ , DESCA , DIAG , DLEN_ , DTYPE_ , IA , IACOL , IAROW , ICTXT , ICURR , IDIAG , IIA , INFO , IOFFA , JA , JJA , LDA , LLD_ , LSAME , M_ , MB_ , MYCOL , MYROW , N , N_ , NA , NB_ , NOUNIT , NPCOL , NPROW , ONE , RSRC_ , UPLO , UPPER |
|
Accessed arrays [ array name : associated index ] |
| | A | : ICURR , ICURR , ICURR , ICURR , ICURR , ICURR , ICURR , IDIAG , IDIAG , IDIAG , IDIAG , IOFFA , IOFFA , IOFFA , IOFFA , IOFFA , IOFFA , IOFFA |
| | DESCA | : CTXT_ , LLD_ |
| | LSAME | : DIAG, 'N' , DIAG, 'U' , UPLO, 'L' , UPLO, 'U' |
|
Conditional statements [ statement : associated predicate ] |
| | do | : ( 10 NA = 1 , N - 1 ) , ( 20 NA = 1 , N - 1 ) , ( 30 NA = 1 , N - 1 ) , ( 40 NA = 1 , N - 1 ) |
| | if | : ( NPROW.EQ. - 1 ) , ( (.NOT.UPPER .AND. .NOT.LSAME( UPLO , 'L' ) ) ) , ( (.NOT.NOUNIT .AND. .NOT.LSAME( DIAG , 'U' ) ) ) , ( INFO.NE.0 ) , ( MYROW.EQ.IAROW .AND. MYCOL.EQ.IACOL ) , ( UPPER ) , ( NOUNIT ) , ( NOUNIT ) |
|
| List of variables | A AJJ BLOCK_CYCLIC_2D CSRC_ CTXT_ DIAG DLEN_
| DTYPE_ IA IACOL IAROW ICTXT ICURR IDIAG IIA
| INFO IOFFA JA JJA LDA LLD_ LSAME M_
| MB_ MYCOL MYROW N N_ NA NB_ NOUNIT
| NPCOL NPROW ONE RSRC_ UPLO UPPER | | close
| |
A
AJJ
BLOCK_CYCLIC_2D
CSRC_
CTXT_
DIAG
DLEN_
DTYPE_
IA
IACOL
IAROW
ICTXT
ICURR
IDIAG
IIA
INFO
IOFFA
JA
JJA
LDA
LLD_
LSAME
M_
MB_
MYCOL
MYROW
N
N_
NA
NB_
NOUNIT
NPCOL
NPROW
ONE
RSRC_
UPLO
UPPER
| |