ScaLAPACK 2.1  2.1
ScaLAPACK: Scalable Linear Algebra PACKage
pzsepdriver.f
Go to the documentation of this file.
1 *
2 *
3  PROGRAM pzsepdriver
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 COMPLEX*16 Hermitian 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 * COMPLEX*16 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 PZHEEVX, the expert driver for the parallel
33 * Hermitian eigenvalue problem. We would like to cover all
34 * possible combinations of: matrix size, process configuration
35 * (nprow and npcol), block size (nb), matrix type (??), range
36 * of eigenvalue (all, by value, by position), sorting options,
37 * and upper vs. lower storage.
38 *
39 * We intend to provide two types of test input files, an
40 * installation test and a thorough test.
41 *
42 * We also intend that the reports be meaningful. Our input file
43 * will allow multiple requests where each request is a cross product
44 * of the following sets:
45 * matrix sizes: n
46 * process configuration triples: nprow, npcol, nb
47 * matrix types:
48 * eigenvalue requests: all, by value, by position
49 * storage (upper vs. lower): uplo
50 *
51 * TERMS:
52 * Request - means a set of tests, which is the cross product of
53 * a set of specifications from the input file.
54 * Test - one element in the cross product, i.e. a specific input
55 * size and type, process configuration, etc.
56 *
57 * .. Parameters ..
58 *
59  INTEGER totmem, zplxsz, nin
60  parameter( totmem = 2000000, zplxsz = 16, nin = 11 )
61  INTEGER memsiz
62  parameter( memsiz = totmem / zplxsz )
63 * ..
64 * .. Local Scalars ..
65  CHARACTER hetero
66  CHARACTER*80 summry, usrinfo
67  INTEGER context, iam, info, isieee, maxnodes, nnocheck,
68  $ nout, npassed, nprocs, nskipped, ntests
69 * ..
70 * .. Local Arrays ..
71 *
72  INTEGER iseed( 4 )
73  COMPLEX*16 mem( memsiz )
74 * ..
75 * .. External Functions ..
76  DOUBLE PRECISION dlamch
77  EXTERNAL dlamch
78 * ..
79 * .. External Subroutines ..
80 *
81  EXTERNAL blacs_exit, blacs_get, blacs_gridexit,
82  $ blacs_gridinit, blacs_pinfo, blacs_setup,
83  $ igamn2d, pdlachkieee, pdlasnbt, pzsepreq
84 * ..
85 * .. Executable Statements ..
86 *
87 * Get starting information
88 *
89  CALL blacs_pinfo( iam, nprocs )
90 *
91 *
92  IF( iam.EQ.0 ) THEN
93 *
94 * Open file and skip data file header
95 *
96  OPEN( unit = nin, file = 'SEP.dat', status = 'OLD' )
97  READ( nin, fmt = * )summry
98  summry = ' '
99 *
100 * Read in user-supplied info about machine type, compiler, etc.
101 *
102  READ( nin, fmt = 9999 )usrinfo
103 *
104 * Read name and unit number for summary output file
105 *
106  READ( nin, fmt = * )summry
107  READ( nin, fmt = * )nout
108  IF( nout.NE.0 .AND. nout.NE.6 )
109  $ OPEN( nout, file = summry, status = 'UNKNOWN' )
110  READ( nin, fmt = * )maxnodes
111  READ( nin, fmt = * )hetero
112  END IF
113 *
114  IF( nprocs.LT.1 ) THEN
115  CALL blacs_setup( iam, maxnodes )
116  nprocs = maxnodes
117  END IF
118 *
119  CALL blacs_get( -1, 0, context )
120  CALL blacs_gridinit( context, 'R', 1, nprocs )
121 *
122  CALL pdlasnbt( isieee )
123 *
124  CALL igamn2d( context, 'a', ' ', 1, 1, isieee, 1, 1, 1, -1, -1,
125  $ 0 )
126 *
127  IF( ( isieee.NE.0 ) ) THEN
128  IF( iam.EQ.0 ) THEN
129  WRITE( nout, fmt = 9998 )
130  WRITE( nout, fmt = 9997 )
131  WRITE( nout, fmt = 9996 )
132  WRITE( nout, fmt = 9995 )
133  WRITE( nout, fmt = 9994 )
134  WRITE( nout, fmt = 9993 )
135  WRITE( nout, fmt = 9992 )
136  WRITE( nout, fmt = 9991 )
137  WRITE( nout, fmt = 9990 )
138  END IF
139 *
140  CALL pdlachkieee( isieee, dlamch( 'O' ), dlamch( 'U' ) )
141 *
142  CALL igamn2d( context, 'a', ' ', 1, 1, isieee, 1, 1, 1, -1, -1,
143  $ 0 )
144 *
145  IF( isieee.EQ.0 ) THEN
146  IF( iam.EQ.0 ) THEN
147  WRITE( nout, fmt = 9989 )
148  WRITE( nout, fmt = 9988 )
149  WRITE( nout, fmt = 9987 )
150  END IF
151  GO TO 20
152  END IF
153 *
154  IF( iam.EQ.0 ) THEN
155  WRITE( nout, fmt = 9986 )
156  END IF
157 *
158  END IF
159  IF( iam.EQ.0 ) THEN
160  WRITE( nout, fmt = 9999 )
161  $ 'SCALAPACK Hermitian Eigendecomposition routines.'
162  WRITE( nout, fmt = 9999 )usrinfo
163  WRITE( nout, fmt = 9999 )' '
164  WRITE( nout, fmt = 9999 )'Running tests of the parallel ' //
165  $ 'Hermitian eigenvalue routine: PZHEEVX.'
166  WRITE( nout, fmt = 9999 )'The following scaled residual ' //
167  $ 'checks will be computed:'
168  WRITE( nout, fmt = 9999 )' ||AQ - QL|| ' //
169  $ '/ ((abstol + ||A|| * eps) * N)'
170  WRITE( nout, fmt = 9999 )' ||Q^T*Q - I|| ' // '/ (N * eps)'
171  WRITE( nout, fmt = 9999 )
172  WRITE( nout, fmt = 9999 )'An explanation of the ' //
173  $ 'input/output parameters follows:'
174  WRITE( nout, fmt = 9999 )'RESULT : passed; or ' //
175  $ 'an indication of which eigen request test failed'
176  WRITE( nout, fmt = 9999 )
177  $ 'N : The number of rows and columns ' //
178  $ 'of the matrix A.'
179  WRITE( nout, fmt = 9999 )
180  $ 'P : The number of process rows.'
181  WRITE( nout, fmt = 9999 )
182  $ 'Q : The number of process columns.'
183  WRITE( nout, fmt = 9999 )
184  $ 'NB : The size of the square blocks' //
185  $ ' the matrix A is split into.'
186  WRITE( nout, fmt = 9999 )
187  $ 'THRESH : If a residual value is less ' //
188  $ 'than THRESH, RESULT is flagged as PASSED.'
189  WRITE( nout, fmt = 9999 )
190  $ ' : the QTQ norm is allowed to exceed THRESH' //
191  $ ' for those eigenvectors'
192  WRITE( nout, fmt = 9999 )' : which could not be ' //
193  $ 'reorthogonalized for lack of workspace.'
194  WRITE( nout, fmt = 9999 )
195  $ 'TYP : matrix type (see pZSEPtst.f).'
196  WRITE( nout, fmt = 9999 )'SUB : Subtests ' //
197  $ '(see pZSEPtst).f'
198  WRITE( nout, fmt = 9999 )'CHK : ||AQ - QL|| ' //
199  $ '/ ((abstol + ||A|| * eps) * N)'
200  WRITE( nout, fmt = 9999 )'QTQ : ||Q^T*Q - I||/ (N * eps)'
201  WRITE( nout, fmt = 9999 )
202  $ ' : when the adjusted QTQ exceeds THRESH',
203  $ ' the adjusted QTQ norm is printed'
204  WRITE( nout, fmt = 9999 )
205  $ ' : otherwise the true QTQ norm is printed'
206  WRITE( nout, fmt = 9999 )
207  $ 'If NT>1, CHK and QTQ are the max over all ' //
208  $ 'eigen request tests'
209  WRITE( nout, fmt = 9999 )' '
210  END IF
211 *
212  ntests = 0
213  npassed = 0
214  nskipped = 0
215  nnocheck = 0
216 *
217  IF( iam.EQ.0 ) THEN
218  WRITE( nout, fmt = 9979 )
219  WRITE( nout, fmt = 9978 )
220  END IF
221 *
222  10 CONTINUE
223 *
224  iseed( 1 ) = 139
225  iseed( 2 ) = 1139
226  iseed( 3 ) = 2139
227  iseed( 4 ) = 3139
228 *
229  CALL pzsepreq( nin, mem, memsiz, nout, iseed, ntests, nskipped,
230  $ nnocheck, npassed, info )
231  IF( info.EQ.0 )
232  $ GO TO 10
233 *
234  IF( iam.EQ.0 ) THEN
235  WRITE( nout, fmt = 9985 )ntests
236  WRITE( nout, fmt = 9984 )npassed
237  WRITE( nout, fmt = 9983 )nnocheck
238  WRITE( nout, fmt = 9982 )nskipped
239  WRITE( nout, fmt = 9981 )ntests - npassed - nskipped -
240  $ nnocheck
241  WRITE( nout, fmt = * )
242  WRITE( nout, fmt = * )
243  WRITE( nout, fmt = 9980 )
244  END IF
245 *
246 * Uncomment this line on SUN systems to avoid the useless print out
247 *
248 * CALL IEEE_FLAGS( 'clear', 'exception', 'underflow', '')
249 *
250 *
251 *
252  20 CONTINUE
253  IF( iam.EQ.0 ) THEN
254  CLOSE ( nin )
255  IF( nout.NE.6 .AND. nout.NE.0 )
256  $ CLOSE ( nout )
257  END IF
258 *
259  CALL blacs_gridexit( context )
260 *
261  CALL blacs_exit( 0 )
262  stop
263 *
264 *
265  9999 FORMAT( a )
266  9998 FORMAT( ' I am about to check to make sure that overflow' )
267  9997 FORMAT( ' is handled in the ieee default manner. If this' )
268  9996 FORMAT( ' is the last output you see, you should assume' )
269  9995 FORMAT( ' that overflow caused a floating point exception.' )
270  9994 FORMAT( ' In that case, we recommend that you add -DNO_IEEE' )
271  9993 FORMAT( ' to the CDEFS line in SLmake.inc.' )
272  9992 FORMAT( ' Alternatively, you could set CDEFS in SLmake.inc ' )
273  9991 FORMAT( ' to enable the default ieee behaviour, However, this' )
274  9990 FORMAT( ' may result in good or very bad performance.' )
275  9989 FORMAT( ' Either signed zeroes or signed infinities ' )
276  9988 FORMAT( ' work incorrectly or your system. Change your' )
277  9987 FORMAT( ' SLmake.inc as suggested above.' )
278 *
279  9986 FORMAT( ' Your system appears to handle ieee overflow.' )
280 *
281  9985 FORMAT( 'Finished ', i6, ' tests, with the following results:' )
282  9984 FORMAT( i5, ' tests completed and passed residual checks.' )
283  9983 FORMAT( i5, ' tests completed without checking.' )
284  9982 FORMAT( i5, ' tests skipped for lack of memory.' )
285  9981 FORMAT( i5, ' tests completed and failed.' )
286  9980 FORMAT( 'END OF TESTS.' )
287  9979 FORMAT( ' N NB P Q TYP SUB WALL CPU ',
288  $ ' CHK QTQ CHECK' )
289  9978 FORMAT( ' ----- --- --- --- --- --- -------- --------',
290  $ ' --------- --------- -----' )
291 *
292 * End of PZSEPDRIVER
293 *
294  END
pzsepreq
subroutine pzsepreq(NIN, MEM, MEMSIZE, NOUT, ISEED, NTESTS, NSKIPPED, NNOCHECK, NPASSED, INFO)
Definition: pzsepreq.f:5
dlamch
double precision function dlamch(CMACH)
Definition: tools.f:10
pzsepdriver
program pzsepdriver
Definition: pzsepdriver.f:3