|
|
| |
| # lines: |
364 | | # code: |
364 | | # comment: | 0 | |
# blank: | 0 |
| # Variables: | 35 |
| # Callers: | 16 |
| # Callings: | 0 |
| # Words: | 287 |
| # Keywords: | 220 |
|
|
|
|
|
..
Purpose
=======
PJLAENV is called from the ScaLAPACK symmetric and Hermitian
tailored eigen-routines to choose
problem-dependent parameters for the local environment. See ISPEC
for a description of the parameters.
This version provides a set of parameters which should give good,
but not optimal, performance on many of the currently available
computers. Users are encouraged to modify this subroutine to set
the tuning parameters for their particular machine using the option
and problem size information in the arguments.
This routine will not function correctly if it is converted to all
lower case. Converting it to all upper case is allowed.
Arguments
=========
ISPEC (global input) INTEGER
Specifies the parameter to be returned as the value of
PJLAENV.
= 1: the data layout blocksize;
= 2: the panel blocking factor;
= 3: the algorithmic blocking factor;
= 4: execution path control;
= 5: maximum size for direct call to the LAPACK routine
NAME (global input) CHARACTER*(*)
The name of the calling subroutine, in either upper case or
lower case.
OPTS (global input) CHARACTER*(*)
The character options to the subroutine NAME, concatenated
into a single character string. For example, UPLO = 'U',
TRANS = 'T', and DIAG = 'N' for a triangular routine would
be specified as OPTS = 'UTN'.
N1 (global input) INTEGER
N2 (global input) INTEGER
N3 (global input) INTEGER
N4 (global input) INTEGER
Problem dimensions for the subroutine NAME; these may not all
be required.
At present, only N1 is used, and it (N1) is used only for
'TTRD'
(PJLAENV) (global or local output) INTEGER
>= 0: the value of the parameter specified by ISPEC
< 0: if PJLAENV = -k, the k-th argument had an illegal
value.
Most parameters set via a call to PJLAENV must be identical
on all processors and hence PJLAENV will return the same
value to all procesors (i.e. global output). However some,
in particular, the panel blocking factor can be different
on each processor and hence PJLAENV can return different
values on different processors (i.e. local output).
Further Details
===============
The following conventions have been used when calling PJLAENV from
the ScaLAPACK routines:
1) OPTS is a concatenation of all of the character options to
subroutine NAME, in the same order that they appear in the
argument list for NAME, even if they are not used in determining
the value of the parameter specified by ISPEC.
2) The problem dimensions N1, N2, N3, N4 are specified in the order
that they appear in the argument list for NAME. N1 is used
first, N2 second, and so on, and unused problem dimensions are
passed a value of -1.
3) The parameter value returned by PJLAENV is checked for validity
in the calling subroutine. For example, PJLAENV is used to
retrieve the optimal blocksize for STRTRI as follows:
NB = PJLAENV( 1, 'STRTRI', UPLO // DIAG, N, -1, -1, -1 )
IF( NB.LE.1 ) NB = MAX( 1, N )
PJLAENV is patterned after ILAENV and keeps the same interface in
anticipation of future needs, even though PJLAENV is only sparsely
used at present in ScaLAPACK. Most ScaLAPACK codes use the input
data layout blocking factor as the algorithmic blocking factor -
hence there is no need or opportunity to set the algorithmic or
data decomposition blocking factor.
pXYYtevx.f and pXYYtgvx.f and pXYYttrd.f are the only codes which
call PJLAENV in this release. pXYYtevx.f and pXYYtgvx.f redistribute
the data to the best data layout for each transformation. pXYYttrd.f
uses a data layout blocking factor of 1 and a
=====================================================================
.. Parameters ..
|
|
|
|
001 INTEGER FUNCTION PJLAENV( ICTXT , ISPEC , NAME , OPTS , N1 ,
002 $N2 , N3 , N4 )
003
004 * -- ScaLAPACK test routine(version 1.7) --
005 * University of Tennessee , Knoxville , Oak Ridge National Laboratory ,
006 * and University of California , Berkeley.
007 * October 15 , 1999
008
009 * .. Scalar Arguments ..
010 CHARACTER*( * ) NAME , OPTS
011 INTEGER ICTXT , ISPEC , N1 , N2 , N3 , N4
012 INTEGER BLOCK_CYCLIC_2D , CSRC_ , CTXT_ , DLEN_ , DTYPE_ ,
013 $LLD_ , MB_ , M_ , NB_ , N_ , RSRC_
014 PARAMETER( BLOCK_CYCLIC_2D = 1 , DLEN_ = 9 , DTYPE_ = 1 ,
015 $CTXT_ = 2 , M_ = 3 , N_ = 4 , MB_ = 5 , NB_ = 6 ,
016 $RSRC_ = 7 , CSRC_ = 8 , LLD_ = 9 )
017 * ..
018 * .. Local Scalars ..
019 LOGICAL CNAME , GLOBAL , SNAME
020 CHARACTER C1
021 CHARACTER*2 C2 , C4
022 CHARACTER*3 C3
023 CHARACTER*8 SUBNAM
024 INTEGER I , IC , IDUMM , IZ , MSZ , NB
025 * ..
026 * .. Intrinsic Functions ..
027 INTRINSIC CHAR , ICHAR
028 * ..
029
030 * .. External Subroutines ..
031 EXTERNAL IGAMX2D
032 * ..
033 * .. Executable Statements ..
034 * This is just to keep ftnchek and toolpack / 1 happy
035 IF( BLOCK_CYCLIC_2D*CSRC_*CTXT_*DLEN_*DTYPE_*LLD_*MB_*M_*NB_*N_*
035
036 $ RSRC_.LT.0 )RETURN
037
038 GO TO( 10 , 10 , 10 , 10 , 10 )ISPEC
039
040 * Invalid value for ISPEC
041
042 PJLAENV = - 1
043 RETURN
044
045 10 CONTINUE
046
047 * Convert NAME to upper case if the first character is lower case.
048
049 PJLAENV = 1
050 SUBNAM = NAME
051 IC = ICHAR( SUBNAM( 1 : 1 ) )
052 IZ = ICHAR( 'Z' )
053 IF( IZ.EQ.100 .OR. IZ.EQ.122 ) THEN
054
055 * ASCII character set
056
056
057 IF( IC.GE.97 .AND. IC.LE.122 ) THEN
057
058 SUBNAM( 1 : 1 ) = CHAR( IC - 32 )
059 DO 20 I = 2 , 6
059
060 IC = ICHAR( SUBNAM( I : I ) )
061 IF( IC.GE.97 .AND. IC.LE.122 )
061
062 $ SUBNAM( I : I ) = CHAR( IC - 32 )
063 20 CONTINUE
063
064 END IF
065
066 ELSE IF( IZ.EQ.233 .OR. IZ.EQ.169 ) THEN
067
068 * EBCDIC character set
069
069
070 IF(( IC.GE.129 .AND. IC.LE.137 ) .OR.
071 $( IC.GE.145 .AND. IC.LE.153 ) .OR.
072 $( IC.GE.162 .AND. IC.LE.169 ) ) THEN
072
073 SUBNAM( 1 : 1 ) = CHAR( IC + 64 )
074 DO 30 I = 2 , 6
074
075 IC = ICHAR( SUBNAM( I : I ) )
076 IF(( IC.GE.129 .AND. IC.LE.137 ) .OR.
077 $( IC.GE.145 .AND. IC.LE.153 ) .OR.
078 $( IC.GE.162 .AND. IC.LE.169 ) )SUBNAM( I :
078
079 $ I ) = CHAR( IC + 64 )
080 30 CONTINUE
081 END IF
082
083 ELSE IF( IZ.EQ.218 .OR. IZ.EQ.250 ) THEN
084
085 * Prime machines : ASCII + 128
086
086
087 IF( IC.GE.225 .AND. IC.LE.250 ) THEN
087
088 SUBNAM( 1 : 1 ) = CHAR( IC - 32 )
089 DO 40 I = 2 , 6
089
090 IC = ICHAR( SUBNAM( I : I ) )
091 IF( IC.GE.225 .AND. IC.LE.250 )
091
092 $ SUBNAM( I : I ) = CHAR( IC - 32 )
093 40 CONTINUE
093
094 END IF
095 END IF
096
097 C1 = SUBNAM( 2 : 2 )
098 SNAME = C1.EQ.'S' .OR. C1.EQ.'D'
099 CNAME = C1.EQ.'C' .OR. C1.EQ.'Z'
100 IF( .NOT.( CNAME .OR. SNAME ) )
100
101 $ RETURN
102 C2 = SUBNAM( 3 : 4 )
103 C3 = SUBNAM( 5 : 7 )
104 C4 = C3( 2 : 3 )
105
106 * This is to keep ftnchek happy
107
108 IF(( N2 + N3 + N4 )*0.NE.0 ) THEN
108
109 C4 = OPTS
110 C3 = C4
111 END IF
112
113 GO TO( 50 , 60 , 70 , 80 , 90 )ISPEC
114
115 50 CONTINUE
116
117 * ISPEC = 1 : data layout block size
118 * (global - all processes must use the same value)
119
120 * In these examples , separate code is provided for setting NB for
121 * real and complex. We assume that NB will take the same value in
122 * single or double precision.
123
124 NB = 1
125
126 IF( C2.EQ.'SY' .OR. C2.EQ.'HE' ) THEN
126
127 IF( C3.EQ.'LLT' ) THEN
127
128 IF( SNAME ) THEN
128
129 NB = 64
130 ELSE
130
131 NB = 64
132 END IF
133 ELSE IF( C3.EQ.'TTR' ) THEN
133
134 IF( SNAME ) THEN
134
135 NB = 1
136 ELSE
136
137 NB = 1
138 END IF
139 ELSE IF( C3.EQ.'GST' ) THEN
139
140 IF( SNAME ) THEN
140
141 NB = 32
142 ELSE
142
143 NB = 32
144 END IF
145 ELSE IF( C3.EQ.'BCK' ) THEN
145
146 IF( SNAME ) THEN
146
147 NB = 32
148 ELSE
148
149 NB = 32
150 END IF
151 ELSE IF( C3.EQ.'TRS' ) THEN
151
152 IF( SNAME ) THEN
152
153 NB = 64
154 ELSE
154
155 NB = 64
156 END IF
157 END IF
158 END IF
159
160 PJLAENV = NB
161 GLOBAL = .TRUE.
162 GO TO 100
163
164 60 CONTINUE
165
166 * ISPEC = 2 : panel blocking factor(Used only in PxyyTTRD)
167 * (local - different processes may use different values)
168
169 NB = 16
170 IF( C2.EQ.'SY' .OR. C2.EQ.'HE' ) THEN
170
171 IF( C3.EQ.'TTR' ) THEN
171
172 IF( SNAME ) THEN
172
173 NB = 32
174 ELSE
174
175 NB = 32
176 END IF
177 END IF
178 END IF
179 PJLAENV = NB
180 GLOBAL = .FALSE.
181 GO TO 100
182
183 70 CONTINUE
184
185 * ISPEC = 3 : algorithmic blocking factor(Used only in PxyyTTRD)
186 * (global - all processes must use the same value)
187
188 NB = 1
189 IF( C2.EQ.'SY' .OR. C2.EQ.'HE' ) THEN
189
190 IF( C3.EQ.'TTR' ) THEN
190
191 IF( SNAME ) THEN
191
192 NB = 16
193 ELSE
193
194 NB = 16
195 END IF
196 END IF
197 END IF
198 PJLAENV = NB
199 GLOBAL = .TRUE.
200 GO TO 100
201
202 80 CONTINUE
203
204 * ISPEC = 4 : Execution path options(Used only in PxyyTTRD)
205 * (global - all processes must use the same value)
206
207 PJLAENV = - 4
208 IF( C2.EQ.'SY' .OR. C2.EQ.'HE' ) THEN
208
209 IF( C3.EQ.'TTR' ) THEN
210 * V and H interleaved(default is not interleaved)
210
211 IF( N1.EQ.1 ) THEN
211
212 PJLAENV = 1
213 END IF
214
215 * Two ZGEMMs(default is one ZGEMM)
216 IF( N1.EQ.2 ) THEN
216
217 PJLAENV = 0
218 END IF
219 * Balanced Update(default is minimum communication update)
220 IF( N1.EQ.3 ) THEN
220
221 PJLAENV = 0
222 END IF
223 END IF
224 END IF
225 GLOBAL = .TRUE.
226 GO TO 100
227
228 90 CONTINUE
229
230 * ISPEC = 5 : Minimum size to justify call to parallel code
231 * (global - all processes must use the same value)
232
233 MSZ = 0
234 IF( C2.EQ.'SY' .OR. C2.EQ.'HE' ) THEN
234
235 IF( C3.EQ.'TTR' ) THEN
235
236 IF( SNAME ) THEN
236
237 MSZ = 100
238 ELSE
238
239 MSZ = 100
240 END IF
241 END IF
242 END IF
243 PJLAENV = MSZ
244 GLOBAL = .TRUE.
245 GO TO 100
246
247 100 CONTINUE
248
249 IF( GLOBAL ) THEN
249
250 CALL IGAMX2D( ICTXT , 'All' , ' ' , 1 , 1 , PJLAENV , 1 , IDUMM ,
251 $ IDUMM , - 1 , - 1 , IDUMM )
252 END IF
253
254 RETURN
255
256 * End of PJLAENV
257
258 END45
51
|
|
Variables in Routine PJLAENV()
| Summary Report |
| Data Type | Quantity | Size(byte) |
| CHARACTER | 1 | 1 |
| CHARACTER*( | 2 | 2 |
| CHARACTER*2 | 2 | 2 |
| CHARACTER*3 | 1 | 1 |
| CHARACTER*8 | 1 | 1 |
| INTEGER | 23 | 92 |
| LOGICAL | 3 | 3 |
| REAL | 2 | 8 |
| TOTAL | 35 | 110 |
List of Variables
CHARACTER
CHARACTER*(
CHARACTER*2
CHARACTER*3
CHARACTER*8
INTEGER
| BLOCK_CYCLIC_2D | CSRC_ | CTXT_ | DLEN_ | DTYPE_ |
| I | IC | ICTXT | IDUMM | ISPEC |
| IZ | LLD_ | M_ | MB_ | MSZ |
| N_ | N1 | N2 | N3 | N4 |
| NB | NB_ | RSRC_ | | |
LOGICAL
REAL
Variables Dependence Graph Put the mouse over a right hand side variable to display the corresponding line of the dependence | | - | | - | - | | C1 | <--- | SUBNAMC1 = SUBNAM( 2: 2 ) |
| C2 | <--- | SUBNAMC2 = SUBNAM( 3: 4 ) |
| C3 | <--- | SUBNAMC3 = SUBNAM( 5: 7 ), C4C3 = C4 |
| C4 | <--- | OPTSC4 = OPTS, C3C4 = C3( 2: 3 ) |
| IC | <--- | IIC = ICHAR( SUBNAM( I: I ) ){2IC = ICHAR( SUBNAM( I: I ) ), 3IC = ICHAR( SUBNAM( I: I ) )}, SUBNAMIC = ICHAR( SUBNAM( 1: 1 ) ){2IC = ICHAR( SUBNAM( I: I ) ), 3IC = ICHAR( SUBNAM( I: I ) ), 4IC = ICHAR( SUBNAM( I: I ) )} |
| PJLAENV | <--- | MSZPJLAENV = MSZ, NBPJLAENV = NB{2PJLAENV = NB, 3PJLAENV = NB} |
| SUBNAM | <--- | ICSUBNAM( 1: 1 ) = CHAR( IC-32 ){2SUBNAM( 1: 1 ) = CHAR( IC+64 ), 3SUBNAM( 1: 1 ) = CHAR( IC-32 )} |
|
|
Analysis elements of the routine PJLAENV() Put the mouse over each element to display detailed matching information
Assigned variables |
| | | BLOCK_CYCLIC_2D , C1 , C2 , C3 , C4 , CNAME , CSRC_ , CTXT_ , DLEN_ , DTYPE_ , GLOBAL , I , IC , ISPEC , IZ , LLD_ , M_ , MB_ , MSZ , N_ , NB , NB_ , PJLAENV , RSRC_ , SNAME , SUBNAM |
|
Active variables |
| | | BLOCK_CYCLIC_2D , C1 , C2 , C3 , C4 , CNAME , CSRC_ , CTXT_ , DLEN_ , DTYPE_ , GLOBAL , I , IC , ICTXT , IDUMM , ISPEC , IZ , LLD_ , M_ , MB_ , MSZ , N_ , N1 , N2 , N3 , N4 , NAME , NB , NB_ , OPTS , PJLAENV , RSRC_ , SNAME , SUBNAM |
|
Accessed arrays [ array name : associated index ] |
| | C3 | : 2: 3 |
| | SUBNAM | : 1: 1 , 1: 1 , 1: 1 , 1: 1 , 2: 2 , 3: 4 , 5: 7 , I: I , I: I , I: I , I: I , I: I |
|
Conditional statements [ statement : associated predicate ] |
| | do | : ( 20 I = 2 , 6 ) , ( 30 I = 2 , 6 ) , ( 40 I = 2 , 6 ) |
| | for | : ( ISPEC ) , ( setting NB for ) |
| | if | : ( BLOCK_CYCLIC_2D*CSRC_*CTXT_*DLEN_*DTYPE_*LLD_*MB_*M_*NB_*N_* ) , ( the first character is lower case. ) , ( IZ.EQ.100 .OR. IZ.EQ.122 ) , ( IC.GE.97 .AND. IC.LE.122 ) , ( IC.GE.97 .AND. IC.LE.122 ) , ( IZ.EQ.233 .OR. IZ.EQ.169 ) , ( (( IC.GE.129 .AND. IC.LE.137 ) .OR. ) , ( (( IC.GE.129 .AND. IC.LE.137 ) .OR. ) , ( IZ.EQ.218 .OR. IZ.EQ.250 ) , ( IC.GE.225 .AND. IC.LE.250 ) , ( IC.GE.225 .AND. IC.LE.250 ) , ( (.NOT.( CNAME .OR. SNAME ) ) ) , ( (( N2+N3 + N4 )*0.NE.0 ) ) , ( C2.EQ.'SY' .OR. C2.EQ.'HE' ) , ( C3.EQ.'LLT' ) , ( SNAME ) , ( C3.EQ.'TTR' ) , ( SNAME ) , ( C3.EQ.'GST' ) , ( SNAME ) , ( C3.EQ.'BCK' ) , ( SNAME ) , ( C3.EQ.'TRS' ) , ( SNAME ) , ( C2.EQ.'SY' .OR. C2.EQ.'HE' ) , ( C3.EQ.'TTR' ) , ( SNAME ) , ( C2.EQ.'SY' .OR. C2.EQ.'HE' ) , ( C3.EQ.'TTR' ) , ( SNAME ) , ( C2.EQ.'SY' .OR. C2.EQ.'HE' ) , ( C3.EQ.'TTR' ) , ( N1.EQ.1 ) , ( N1.EQ.2 ) , ( N1.EQ.3 ) , ( C2.EQ.'SY' .OR. C2.EQ.'HE' ) , ( C3.EQ.'TTR' ) , ( SNAME ) , ( GLOBAL ) |
|
| List of variables | ) BLOCK_CYCLIC_2D C1 C2 C3 C4 CNAME
| CSRC_ CTXT_ DLEN_ DTYPE_ GLOBAL I IC ICTXT
| IDUMM ISPEC IZ LLD_ M_ MB_ MSZ N_
| N1 N2 N3 N4 NAME NB NB_ OPTS
| PJLAENV RSRC_ SNAME SUBNAM | | close
| |
)
BLOCK_CYCLIC_2D
C1
C2
C3
C4
CNAME
CSRC_
CTXT_
DLEN_
DTYPE_
GLOBAL
I
IC
ICTXT
IDUMM
ISPEC
IZ
LLD_
M_
MB_
MSZ
N_
N1
N2
N3
N4
NAME
NB
NB_
OPTS
PJLAENV
RSRC_
SNAME
SUBNAM
| |