OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
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.EQ. IF( IAM0 ) 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.EQ. IF( INFO0 )
232 $ GO TO 10
233*
234.EQ. IF( IAM0 ) 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.EQ. IF( IAM0 ) THEN
254 CLOSE ( NIN )
255.NE..AND..NE. IF( NOUT6 NOUT0 )
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
if(complex_arithmetic) id
end diagonal values have been computed in the(sparse) matrix id.SOL
norm(diag(diag(diag(inv(mat))) -id.SOL), 2) % destroy mumps instance id.JOB
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
#define max(a, b)
Definition macros.h:21
subroutine blacs_gridinit(cntxt, c, nprow, npcol)
Definition mpi.f:745
subroutine blacs_gridexit(cntxt)
Definition mpi.f:762
for(i8=*sizetab-1;i8 >=0;i8--)
void split(mapping_t *, PORD_INT, PORD_INT, PORD_INT, PORD_INT *, PORD_INT *, FLOAT *, PORD_INT)
subroutine pzheevx(jobz, range, uplo, n, a, ia, ja, desca, vl, vu, il, iu, abstol, m, nz, w, orfac, z, iz, jz, descz, work, lwork, rwork, lrwork, iwork, liwork, ifail, iclustr, gap, info)
Definition pzheevx.f:5
program pzsepdriver
Definition pzsepdriver.f:3
subroutine pzsepreq(nin, mem, memsize, nout, iseed, ntests, nskipped, nnocheck, npassed, info)
Definition pzsepreq.f:5
subroutine pzseptst(desca, uplo, n, mattype, subtests, thresh, order, abstol, iseed, a, copya, z, lda, win, wnew, ifail, iclustr, gap, iprepad, ipostpad, work, lwork, rwork, lrwork, iwork, liwork, nout, info)
Definition pzseptst.f:8