ScaLAPACK 2.1  2.1
ScaLAPACK: Scalable Linear Algebra PACKage
psgsepdriver.f
Go to the documentation of this file.
1 *
2 *
3  PROGRAM psgsepdriver
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 REAL 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 REALSZ
15 * indicate the length in bytes on the given platform for an integer
16 * and a single 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 * REAL 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 * REAL 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 PSSYGVX, the expert driver for the parallel
33 * symmetric 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, realsz, nin
60  parameter( totmem = 2000000, realsz = 4, nin = 11 )
61  INTEGER memsiz
62  parameter( memsiz = totmem / realsz )
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  REAL mem( memsiz )
74 * ..
75 * .. External Functions ..
76  REAL slamch
77  EXTERNAL slamch
78 * ..
79 * .. External Subroutines ..
80 *
81  EXTERNAL blacs_exit, blacs_get, blacs_gridexit,
82  $ blacs_gridinit, blacs_pinfo, blacs_setup,
83  $ igamn2d, psgsepreq, pslachkieee, pslasnbt
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 pslasnbt( 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 pslachkieee( isieee, slamch( 'O' ), slamch( '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 symmetric Eigendecomposition routines.'
162  WRITE( nout, fmt = 9999 )usrinfo
163  WRITE( nout, fmt = 9999 )' '
164  WRITE( nout, fmt = 9999 )'Running tests of the parallel ' //
165  $ 'generalized ' // 'symmetric eigenvalue routine: PSSYGVX.'
166  WRITE( nout, fmt = 9999 )'A scaled residual check, ' //
167  $ 'will be computed'
168  WRITE( nout, fmt = 9999 )
169  WRITE( nout, fmt = 9999 )'An explanation of the ' //
170  $ 'input/output parameters follows:'
171  WRITE( nout, fmt = 9999 )'RESULT : passed; or ' //
172  $ 'an indication of which eigen request test failed'
173  WRITE( nout, fmt = 9999 )
174  $ 'N : The number of rows and columns ' //
175  $ 'of the matrix A.'
176  WRITE( nout, fmt = 9999 )
177  $ 'P : The number of process rows.'
178  WRITE( nout, fmt = 9999 )
179  $ 'Q : The number of process columns.'
180  WRITE( nout, fmt = 9999 )
181  $ 'NB : The size of the square blocks' //
182  $ ' the matrix A is split into.'
183  WRITE( nout, fmt = 9999 )
184  $ 'THRESH : If a residual value is less ' //
185  $ 'than THRESH, RESULT is flagged as PASSED.'
186  WRITE( nout, fmt = 9999 )
187  $ ' : the QTQ norm is allowed to exceed THRESH' //
188  $ ' for those eigenvectors'
189  WRITE( nout, fmt = 9999 )' : which could not be ' //
190  $ 'reorthogonalized for lack of workspace.'
191  WRITE( nout, fmt = 9999 )
192  $ 'TYP : matrix type (see pSGSEPtst.f).'
193  WRITE( nout, fmt = 9999 )
194  $ 'IBTYPE : Generalized eigenproblem type' //
195  $ ' (see pSSYGVx.f)'
196  WRITE( nout, fmt = 9999 )'SUB : Subtests ' //
197  $ '(see pSGSEPtst).f'
198  WRITE( nout, fmt = 9999 )'CHK : The scaled residual'
199  WRITE( nout, fmt = 9999 )' '
200  END IF
201 *
202  ntests = 0
203  npassed = 0
204  nskipped = 0
205  nnocheck = 0
206 *
207  IF( iam.EQ.0 ) THEN
208  WRITE( nout, fmt = 9979 )
209  WRITE( nout, fmt = 9978 )
210  END IF
211 *
212  10 CONTINUE
213 *
214  iseed( 1 ) = 139
215  iseed( 2 ) = 1139
216  iseed( 3 ) = 2139
217  iseed( 4 ) = 3139
218 *
219  CALL psgsepreq( nin, mem, memsiz, nout, iseed, ntests, nskipped,
220  $ nnocheck, npassed, info )
221  IF( info.EQ.0 )
222  $ GO TO 10
223 *
224  IF( iam.EQ.0 ) THEN
225  WRITE( nout, fmt = 9985 )ntests
226  WRITE( nout, fmt = 9984 )npassed
227  WRITE( nout, fmt = 9983 )nnocheck
228  WRITE( nout, fmt = 9982 )nskipped
229  WRITE( nout, fmt = 9981 )ntests - npassed - nskipped -
230  $ nnocheck
231  WRITE( nout, fmt = * )
232  WRITE( nout, fmt = * )
233  WRITE( nout, fmt = 9980 )
234  END IF
235 *
236 * Uncomment this line on SUN systems to avoid the useless print out
237 *
238 * CALL IEEE_FLAGS( 'clear', 'exception', 'underflow', '')
239 *
240 *
241 *
242  20 CONTINUE
243  IF( iam.EQ.0 ) THEN
244  CLOSE ( nin )
245  IF( nout.NE.6 .AND. nout.NE.0 )
246  $ CLOSE ( nout )
247  END IF
248 *
249  CALL blacs_gridexit( context )
250 *
251  CALL blacs_exit( 0 )
252  stop
253 *
254 *
255  9999 FORMAT( a )
256  9998 FORMAT( ' I am about to check to make sure that overflow' )
257  9997 FORMAT( ' is handled in the ieee default manner. If this' )
258  9996 FORMAT( ' is the last output you see, you should assume' )
259  9995 FORMAT( ' that overflow caused a floating point exception.' )
260  9994 FORMAT( ' In that case, we recommend that you add -DNO_IEEE' )
261  9993 FORMAT( ' to the CDEFS line in SLmake.inc.' )
262  9992 FORMAT( ' Alternatively, you could set CDEFS in SLmake.inc ' )
263  9991 FORMAT( ' to enable the default ieee behaviour, However, this' )
264  9990 FORMAT( ' may result in good or very bad performance.' )
265  9989 FORMAT( ' Either signed zeroes or signed infinities ' )
266  9988 FORMAT( ' work incorrectly or your system. Change your' )
267  9987 FORMAT( ' SLmake.inc as suggested above.' )
268 *
269  9986 FORMAT( ' Your system appears to handle ieee overflow.' )
270 *
271  9985 FORMAT( 'Finished ', i6, ' tests, with the following results:' )
272  9984 FORMAT( i5, ' tests completed and passed residual checks.' )
273  9983 FORMAT( i5, ' tests completed without checking.' )
274  9982 FORMAT( i5, ' tests skipped for lack of memory.' )
275  9981 FORMAT( i5, ' tests completed and failed.' )
276  9980 FORMAT( 'END OF TESTS.' )
277  9979 FORMAT( ' N NB P Q TYP IBTYPE SUB WALL CPU ',
278  $ ' CHK CHECK' )
279  9978 FORMAT( ' ----- --- --- --- --- ------ --- -------- --------',
280  $ ' --------- -----' )
281 *
282 * End of PSGSEPDRIVER
283 *
284  END
psgsepdriver
program psgsepdriver
Definition: psgsepdriver.f:3
psgsepreq
subroutine psgsepreq(NIN, MEM, MEMSIZE, NOUT, ISEED, NTESTS, NSKIPPED, NNOCHECK, NPASSED, INFO)
Definition: psgsepreq.f:5
slamch
real function slamch(CMACH)
Definition: tools.f:867