SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
pdsepdriver.f
Go to the documentation of this file.
1*
2*
3 PROGRAM pdsepdriver
4*
5* -- ScaLAPACK routine (version 1.7) --
6* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
7* and University of California, Berkeley.
8* May 1, 1997
9*
10* Parallel DOUBLE PRECISION symmetric eigenproblem test driver
11*
12* The user should modify TOTMEM to indicate the maximum amount of
13* memory in bytes her system has. Remember to leave room in memory
14* for operating system, the BLACS buffer, etc. INTSIZ and DBLSIZ
15* indicate the length in bytes on the given platform for an integer
16* and a double precision real.
17* For example, on our system with 8 MB of memory, TOTMEM=6500000
18* (leaves 1.5 MB for OS, code, BLACS buffer, etc), the length of a
19* DOUBLE is 8, and an integer takes up 4 bytes. Some playing around
20* to discover what the maximum value you can set MEMSIZ to may be
21* required.
22* All arrays used by factorization and solve are allocated out of
23* big array called MEM.
24*
25* The full tester requires approximately (5 n + 5 n^2/p + slop)
26* DOUBLE PRECISION words and 6*n integer words.
27* So, TOTMEM should be set to at least 1.1 * 8 * (5n + 5n^2/p)
28*
29* WHAT WE TEST
30* ============
31*
32* This routine tests PDSYEVX, the expert driver for the parallel
33* symmetric eigenvalue problem, PDSYEV and PDSYEVD. We would like
34* to cover all possible combinations of: matrix size, process
35* configuration (nprow and npcol), block size (nb),
36* matrix type (??), range of eigenvalue (all, by value,
37* by position), sorting options, and upper vs. lower storage.
38*
39* As PDSYEV returns an error message when heterogeneity is detected,
40* the PDSYEV tests can be suppressed by changing the appropiate
41* entry in the input file.
42*
43* We intend to provide two types of test input files, an
44* installation test and a thorough test.
45*
46* We also intend that the reports be meaningful. Our input file
47* will allow multiple requests where each request is a cross product
48* of the following sets:
49* matrix sizes: n
50* process configuration triples: nprow, npcol, nb
51* matrix types:
52* eigenvalue requests: all, by value, by position
53* storage (upper vs. lower): uplo
54*
55* TERMS:
56* Request - means a set of tests, which is the cross product of
57* a set of specifications from the input file.
58* Test - one element in the cross product, i.e. a specific input
59* size and type, process configuration, etc.
60*
61* .. Parameters ..
62*
63 INTEGER totmem, dblesz, nin
64 parameter( totmem = 2000000, dblesz = 8, nin = 11 )
65 INTEGER memsiz
66 parameter( memsiz = totmem / dblesz )
67* ..
68* .. Local Scalars ..
69 CHARACTER hetero
70 CHARACTER*80 summry, usrinfo
71 INTEGER context, iam, info, isieee, maxnodes, nnocheck,
72 $ nout, npassed, nprocs, nskipped, ntests
73* ..
74* .. Local Arrays ..
75*
76 INTEGER iseed( 4 )
77 DOUBLE PRECISION mem( memsiz )
78* ..
79* .. External Functions ..
80 DOUBLE PRECISION dlamch
81 EXTERNAL dlamch
82* ..
83* .. External Subroutines ..
84*
85 EXTERNAL blacs_exit, blacs_get, blacs_gridexit,
86 $ blacs_gridinit, blacs_pinfo, blacs_setup,
87 $ igamn2d, pdlachkieee, pdlasnbt, pdsepreq
88* ..
89* .. Executable Statements ..
90*
91* Get starting information
92*
93 CALL blacs_pinfo( iam, nprocs )
94*
95*
96 IF( iam.EQ.0 ) THEN
97*
98* Open file and skip data file header
99*
100 OPEN( unit = nin, file = 'SEP.dat', status = 'OLD' )
101 READ( nin, fmt = * )summry
102 summry = ' '
103*
104* Read in user-supplied info about machine type, compiler, etc.
105*
106 READ( nin, fmt = 9999 )usrinfo
107*
108* Read name and unit number for summary output file
109*
110 READ( nin, fmt = * )summry
111 READ( nin, fmt = * )nout
112 IF( nout.NE.0 .AND. nout.NE.6 )
113 $ OPEN( nout, file = summry, status = 'UNKNOWN' )
114 READ( nin, fmt = * )maxnodes
115 READ( nin, fmt = * )hetero
116 END IF
117*
118 IF( nprocs.LT.1 ) THEN
119 CALL blacs_setup( iam, maxnodes )
120 nprocs = maxnodes
121 END IF
122*
123 CALL blacs_get( -1, 0, context )
124 CALL blacs_gridinit( context, 'R', 1, nprocs )
125*
126 CALL pdlasnbt( isieee )
127*
128 CALL igamn2d( context, 'a', ' ', 1, 1, isieee, 1, 1, 1, -1, -1,
129 $ 0 )
130*
131 IF( ( isieee.NE.0 ) ) THEN
132 IF( iam.EQ.0 ) THEN
133 WRITE( nout, fmt = 9998 )
134 WRITE( nout, fmt = 9997 )
135 WRITE( nout, fmt = 9996 )
136 WRITE( nout, fmt = 9995 )
137 WRITE( nout, fmt = 9994 )
138 WRITE( nout, fmt = 9993 )
139 WRITE( nout, fmt = 9992 )
140 WRITE( nout, fmt = 9991 )
141 WRITE( nout, fmt = 9990 )
142 END IF
143*
144 CALL pdlachkieee( isieee, dlamch( 'O' ), dlamch( 'U' ) )
145*
146 CALL igamn2d( context, 'a', ' ', 1, 1, isieee, 1, 1, 1, -1, -1,
147 $ 0 )
148*
149 IF( isieee.EQ.0 ) THEN
150 IF( iam.EQ.0 ) THEN
151 WRITE( nout, fmt = 9989 )
152 WRITE( nout, fmt = 9988 )
153 WRITE( nout, fmt = 9987 )
154 END IF
155 GO TO 20
156 END IF
157*
158 IF( iam.EQ.0 ) THEN
159 WRITE( nout, fmt = 9986 )
160 END IF
161*
162 END IF
163*
164 IF( iam.EQ.0 ) THEN
165 WRITE( nout, fmt = 9999 )
166 $ 'SCALAPACK symmetric Eigendecomposition routines.'
167 WRITE( nout, fmt = 9999 )usrinfo
168 WRITE( nout, fmt = 9999 )' '
169 WRITE( nout, fmt = 9999 )'Running tests of the parallel ' //
170 $ 'symmetric eigenvalue routine: PDSYEVX & '//
171 $ ' PDSYEV & PDSYEVD.'
172 WRITE( nout, fmt = 9999 )'The following scaled residual ' //
173 $ 'checks will be computed:'
174 WRITE( nout, fmt = 9999 )' ||AQ - QL|| ' //
175 $ '/ ((abstol + ||A|| * eps) * N)'
176 WRITE( nout, fmt = 9999 )' ||Q^T*Q - I|| ' // '/ (N * eps)'
177 WRITE( nout, fmt = 9999 )
178 WRITE( nout, fmt = 9999 )'An explanation of the ' //
179 $ 'input/output parameters follows:'
180 WRITE( nout, fmt = 9999 )'RESULT : passed; or ' //
181 $ 'an indication of which eigen request test failed'
182 WRITE( nout, fmt = 9999 )
183 $ 'N : The number of rows and columns ' //
184 $ 'of the matrix A.'
185 WRITE( nout, fmt = 9999 )
186 $ 'P : The number of process rows.'
187 WRITE( nout, fmt = 9999 )
188 $ 'Q : The number of process columns.'
189 WRITE( nout, fmt = 9999 )
190 $ 'NB : The size of the square blocks' //
191 $ ' the matrix A is split into.'
192 WRITE( nout, fmt = 9999 )
193 $ 'THRESH : If a residual value is less ' //
194 $ 'than THRESH, RESULT is flagged as PASSED.'
195 WRITE( nout, fmt = 9999 )
196 $ ' : the QTQ norm is allowed to exceed THRESH' //
197 $ ' for those eigenvectors'
198 WRITE( nout, fmt = 9999 )' : which could not be ' //
199 $ 'reorthogonalized for lack of workspace.'
200 WRITE( nout, fmt = 9999 )
201 $ 'TYP : matrix type (see PDSEPtst.f).'
202 WRITE( nout, fmt = 9999 )'SUB : Subtests ' //
203 $ '(see PDSEPtst).f'
204 WRITE( nout, fmt = 9999 )'CHK : ||AQ - QL|| ' //
205 $ '/ ((abstol + ||A|| * eps) * N)'
206 WRITE( nout, fmt = 9999 )'QTQ : ||Q^T*Q - I||/ (N * eps)'
207 WRITE( nout, fmt = 9999 )
208 $ ' : when the adjusted QTQ exceeds THRESH',
209 $ ' the adjusted QTQ norm is printed'
210 WRITE( nout, fmt = 9999 )
211 $ ' : otherwise the true QTQ norm is printed'
212 WRITE( nout, fmt = 9999 )
213 $ ' If NT>1, CHK and QTQ are the max over all ' //
214 $ 'eigen request tests'
215 WRITE( nout, fmt = 9999 )
216 $ 'TEST : EVX - testing PDSYEVX, EV - testing PDSYEV, '//
217 $ 'EVD - testing PDSYEVD'
218 WRITE( nout, fmt = 9999 )' '
219 END IF
220*
221 ntests = 0
222 npassed = 0
223 nskipped = 0
224 nnocheck = 0
225*
226 IF( iam.EQ.0 ) THEN
227 WRITE( nout, fmt = 9979 )
228 WRITE( nout, fmt = 9978 )
229 END IF
230*
231 10 CONTINUE
232*
233 iseed( 1 ) = 139
234 iseed( 2 ) = 1139
235 iseed( 3 ) = 2139
236 iseed( 4 ) = 3139
237*
238 CALL pdsepreq( hetero, nin, mem, memsiz, nout, iseed, ntests,
239 $ nskipped, nnocheck, npassed, info )
240 IF( info.EQ.0 )
241 $ GO TO 10
242*
243 IF( iam.EQ.0 ) THEN
244 WRITE( nout, fmt = 9985 )ntests
245 WRITE( nout, fmt = 9984 )npassed
246 WRITE( nout, fmt = 9983 )nnocheck
247 WRITE( nout, fmt = 9982 )nskipped
248 WRITE( nout, fmt = 9981 )ntests - npassed - nskipped -
249 $ nnocheck
250 WRITE( nout, fmt = * )
251 WRITE( nout, fmt = * )
252 WRITE( nout, fmt = 9980 )
253 END IF
254*
255* Uncomment this line on SUN systems to avoid the useless print out
256*
257c CALL IEEE_FLAGS( 'clear', 'exception', 'underflow', ' ')
258*
259*
260*
261 20 CONTINUE
262 IF( iam.EQ.0 ) THEN
263 CLOSE ( nin )
264 IF( nout.NE.6 .AND. nout.NE.0 )
265 $ CLOSE ( nout )
266 END IF
267*
268 CALL blacs_gridexit( context )
269*
270 CALL blacs_exit( 0 )
271 stop
272*
273*
274 9999 FORMAT( a )
275 9998 FORMAT( ' I am about to check to make sure that overflow' )
276 9997 FORMAT( ' is handled in the ieee default manner. If this' )
277 9996 FORMAT( ' is the last output you see, you should assume' )
278 9995 FORMAT( ' that overflow caused a floating point exception.' )
279 9994 FORMAT( ' In that case, we recommend that you add -DNO_IEEE' )
280 9993 FORMAT( ' to the CDEFS line in SLmake.inc.' )
281 9992 FORMAT( ' Alternatively, you could set CDEFS in SLmake.inc ' )
282 9991 FORMAT( ' to enable the default ieee behaviour, However, this' )
283 9990 FORMAT( ' may result in good or very bad performance.' )
284 9989 FORMAT( ' Either signed zeroes or signed infinities ' )
285 9988 FORMAT( ' work incorrectly or your system. Change your' )
286 9987 FORMAT( ' SLmake.inc as suggested above.' )
287*
288 9986 FORMAT( ' Your system appears to handle ieee overflow.' )
289*
290 9985 FORMAT( 'Finished ', i6, ' tests, with the following results:' )
291 9984 FORMAT( i5, ' tests completed and passed residual checks.' )
292 9983 FORMAT( i5, ' tests completed without checking.' )
293 9982 FORMAT( i5, ' tests skipped for lack of memory.' )
294 9981 FORMAT( i5, ' tests completed and failed.' )
295 9980 FORMAT( 'END OF TESTS.' )
296 9979 FORMAT( ' N NB P Q TYP SUB WALL CPU ',
297 $ ' CHK QTQ CHECK TEST' )
298 9978 FORMAT( ' ----- --- --- --- --- --- -------- --------',
299 $ ' --------- --------- ----- ----' )
300*
301* End of PDSEPDRIVER
302*
303 END
program pdsepdriver
Definition pdsepdriver.f:3
subroutine pdsepreq(hetero, nin, mem, memsize, nout, iseed, ntests, nskipped, nnocheck, npassed, info)
Definition pdsepreq.f:5
double precision function dlamch(cmach)
Definition tools.f:10