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