OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
pzevcinfo.f
Go to the documentation of this file.
1 SUBROUTINE pzevcinfo( SUMMRY, NOUT, NMAT, NVAL, LDNVAL, NNB,
2 $ NBVAL, LDNBVAL, NGRIDS, PVAL, LDPVAL, QVAL,
3 $ LDQVAL, THRESH, WORK, IAM, NPROCS )
4*
5* -- ScaLAPACK routine (version 1.7) --
6* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
7* and University of California, Berkeley.
8* March, 2000
9*
10* .. Scalar Arguments ..
11 CHARACTER*( * ) SUMMRY
12 INTEGER IAM, LDNBVAL, LDNVAL, LDPVAL, LDQVAL, NGRIDS,
13 $ nmat, nnb, nout, nprocs
14 REAL THRESH
15* ..
16* .. Array Arguments ..
17 INTEGER NBVAL( LDNBVAL ), NVAL( LDNVAL ),
18 $ PVAL( LDPVAL ), QVAL( LDQVAL ), WORK( * )
19* ..
20*
21* Purpose
22* =======
23*
24* PZEVCINFO gets needed startup information for PZTREVC driver
25* and transmits it to all processes.
26*
27* Arguments
28* =========
29*
30* SUMMRY (global output) CHARACTER*(*)
31* Name of output (summary) file (if any). Only defined for
32* process 0.
33*
34* NOUT (global output) INTEGER
35* The unit number for output file. NOUT = 6, ouput to screen,
36* NOUT = 0, output to stderr. Only defined for process 0.
37*
38* NMAT (global output) INTEGER
39* The number of different values that can be used for N.
40*
41* NVAL (global output) INTEGER array, dimension (LDNVAL)
42* The values of N (the order of the matrix) to run the code
43* with.
44*
45* LDNVAL (global input) INTEGER
46* The maximum number of different values that can be used for
47* N, LDNVAL > = NMAT.
48*
49* NNB (global output) INTEGER
50* The number of different values that can be used for NB.
51*
52* NBVAL (global output) INTEGER array, dimension (LDNBVAL)
53* The values of NB (blocksize) to run the code with.
54*
55* LDNBVAL (global input) INTEGER
56* The maximum number of different values that can be used for
57* NB, LDNBVAL >= NNB.
58*
59* NGRIDS (global output) INTEGER
60* The number of different values that can be used for P & Q.
61*
62* PVAL (global output) INTEGER array, dimension (LDPVAL)
63* The values of P (number of process rows) to run the code
64* with.
65*
66* LDPVAL (global input) INTEGER
67* The maximum number of different values that can be used for
68* P, LDPVAL >= NGRIDS.
69*
70* QVAL (global output) INTEGER array, dimension (LDQVAL)
71* The values of Q (number of process columns) to run the code
72* with.
73*
74* LDQVAL (global input) INTEGER
75* The maximum number of different values that can be used for
76* Q, LDQVAL >= NGRIDS.
77*
78* THRESH (global output) REAL
79* Indicates what error checks shall be run and printed out:
80* < 0 : Perform no error checking
81* > 0 : report all residuals greater than THRESH
82*
83* WORK (local workspace) INTEGER array of dimension >=
84* MAX( 3, LDNVAL+LDNBVAL+LDPVAL+LDQVAL ), used to pack all
85* input arrays in order to send info in one message.
86*
87* IAM (local input) INTEGER
88* My process number.
89*
90* NPROCS (global input) INTEGER
91* The total number of processes.
92*
93* Further Details
94* ===============
95*
96* Implemented by: M. Fahey, June 2000
97*
98* ======================================================================
99*
100* Note: For packing the information we assumed that the length in bytes
101* ===== of an integer is equal to the length in bytes of a real single
102* precision.
103*
104* ======================================================================
105*
106* .. Parameters ..
107 INTEGER NIN
108 PARAMETER ( NIN = 11 )
109* ..
110* .. Local Scalars ..
111 CHARACTER*79 USRINFO
112 INTEGER I, ICTXT
113 DOUBLE PRECISION EPS
114* ..
115* .. External Subroutines ..
116 EXTERNAL blacs_abort, blacs_get, blacs_gridexit,
117 $ blacs_gridinit, blacs_setup, icopy, igebr2d,
118 $ igebs2d, sgebr2d, sgebs2d
119* ..
120* .. External Functions ..
121 DOUBLE PRECISION PDLAMCH
122 EXTERNAL PDLAMCH
123* ..
124* .. Intrinsic Functions ..
125 INTRINSIC max, min
126* ..
127* .. Executable Statements ..
128*
129* Process 0 reads the input data, broadcasts to other processes and
130* writes needed information to NOUT
131*
132 IF( iam.EQ.0 ) THEN
133*
134* Open file and skip data file header
135*
136 OPEN( nin, file = 'evc.dat', STATUS = 'old' )
137 READ( NIN, FMT = * )SUMMRY
138 SUMMRY = ' '
139*
140* Read in user-supplied info about machine type, compiler, etc.
141*
142 READ( NIN, FMT = 9999 )USRINFO
143*
144* Read name and unit number for summary output file
145*
146 READ( NIN, FMT = * )SUMMRY
147 READ( NIN, FMT = * )NOUT
148.NE..AND..NE. IF( NOUT0 NOUT6 )
149 $ OPEN( NOUT, FILE = SUMMRY, STATUS = 'unknown' )
150*
151* Read and check the parameter values for the tests.
152*
153* Get number of matrices and their dimensions
154*
155 READ( NIN, FMT = * )NMAT
156.LT..OR..GT. IF( NMAT1 NMATLDNVAL ) THEN
157 WRITE( NOUT, FMT = 9994 )'n', LDNVAL
158 GO TO 30
159 END IF
160 READ( NIN, FMT = * )( NVAL( I ), I = 1, NMAT )
161*
162* Get values of NB
163*
164 READ( NIN, FMT = * )NNB
165.GT. IF( NNBLDNBVAL ) THEN
166 WRITE( NOUT, FMT = 9994 )'nb', LDNBVAL
167 GO TO 30
168 END IF
169 READ( NIN, FMT = * )( NBVAL( I ), I = 1, NNB )
170*
171 DO 10 I = 1, NNB
172.LT. IF( NBVAL( I )6 ) THEN
173 WRITE( NOUT, FMT = 9992 )NBVAL( I )
174 GO TO 30
175 END IF
176 10 CONTINUE
177*
178* Get number of grids
179*
180 READ( NIN, FMT = * )NGRIDS
181.LT..OR..GT. IF( NGRIDS1 NGRIDSLDPVAL ) THEN
182 WRITE( NOUT, FMT = 9994 )'grids', LDPVAL
183 GO TO 30
184.GT. ELSE IF( NGRIDSLDQVAL ) THEN
185 WRITE( NOUT, FMT = 9994 )'grids', LDQVAL
186 GO TO 30
187 END IF
188*
189* Get values of P and Q
190*
191 READ( NIN, FMT = * )( PVAL( I ), I = 1, NGRIDS )
192 READ( NIN, FMT = * )( QVAL( I ), I = 1, NGRIDS )
193*
194* Get level of checking
195*
196 READ( NIN, FMT = * )THRESH
197*
198* Close input file
199*
200 CLOSE ( NIN )
201*
202* For pvm only: if virtual machine not set up, allocate it and
203* spawn the correct number of processes.
204*
205.LT. IF( NPROCS1 ) THEN
206 NPROCS = 0
207 DO 20 I = 1, NGRIDS
208 NPROCS = MAX( NPROCS, PVAL( I )*QVAL( I ) )
209 20 CONTINUE
210 CALL BLACS_SETUP( IAM, NPROCS )
211 END IF
212*
213* Temporarily define blacs grid to include all processes so
214* information can be broadcast to all processes
215*
216 CALL BLACS_GET( -1, 0, ICTXT )
217 CALL BLACS_GRIDINIT( ICTXT, 'row-major', 1, NPROCS )
218*
219* Compute machine epsilon
220*
221 EPS = PDLAMCH( ICTXT, 'eps' )
222*
223* Pack information arrays and broadcast
224*
225 CALL SGEBS2D( ICTXT, 'all', ' ', 1, 1, THRESH, 1 )
226*
227 WORK( 1 ) = NMAT
228 WORK( 2 ) = NNB
229 WORK( 3 ) = NGRIDS
230 CALL IGEBS2D( ICTXT, 'all', ' ', 3, 1, WORK, 3 )
231*
232 I = 1
233 CALL ICOPY( NMAT, NVAL, 1, WORK( I ), 1 )
234 I = I + NMAT
235 CALL ICOPY( NNB, NBVAL, 1, WORK( I ), 1 )
236 I = I + NNB
237 CALL ICOPY( NGRIDS, PVAL, 1, WORK( I ), 1 )
238 I = I + NGRIDS
239 CALL ICOPY( NGRIDS, QVAL, 1, WORK( I ), 1 )
240 I = I + NGRIDS - 1
241 CALL IGEBS2D( ICTXT, 'all', ' ', I, 1, WORK, I )
242*
243* regurgitate input
244*
245 WRITE( NOUT, FMT = 9999 )
246 $ 'scalapack nonsymmetric eigenvector calculation.'
247 WRITE( nout, fmt = 9999 )usrinfo
248 WRITE( nout, fmt = * )
249 WRITE( nout, fmt = 9999 )'Tests of the parallel ' //
250 $ 'complex double precision eigenvector calculation.'
251 WRITE( nout, fmt = 9999 )'The following scaled residual ' //
252 $ 'checks will be computed:'
253 WRITE( nout, fmt = 9999 )
254 $ ' Residual = max( ||T*R-R*D||/(||H||*eps*N)' //
255 $ ' , ||T^H*L-L*D^H||/(||H||*eps*N) )'
256 WRITE( nout, fmt = 9999 )
257 $ ' Normalization residual = max(max_j(max|R(j)|-1),' //
258 $ ' max_j(max|L(j)|-1))/(eps*N)'
259 WRITE( nout, fmt = 9999 )'The matrix A is randomly ' //
260 $ 'generated for each test.'
261 WRITE( nout, fmt = * )
262 WRITE( nout, fmt = 9999 )'An explanation of the input/output '
263 $ // 'parameters follows:'
264 WRITE( nout, fmt = 9999 )
265 $ 'TIME : Indicates whether WALL or ' //
266 $ 'CPU time was used.'
267*
268 WRITE( nout, fmt = 9999 )
269 $ 'N : The number of columns in the ' // 'matrix A.'
270 WRITE( nout, fmt = 9999 )
271 $ 'NB : The size of the square blocks the' //
272 $ ' matrix A is split into.'
273 WRITE( nout, fmt = 9999 )
274 $ 'P : The number of process rows.'
275 WRITE( nout, fmt = 9999 )
276 $ 'Q : The number of process columns.'
277 WRITE( nout, fmt = 9999 )
278 $ 'THRESH : If a residual value is less than' //
279 $ ' THRESH, CHECK is flagged as PASSED'
280 WRITE( nout, fmt = 9999 )
281 $ 'NEP time : Time in seconds to decompose the ' // ' matrix'
282 WRITE( NOUT, FMT = 9999 )'mflops : rate of execution '
283 WRITE( NOUT, FMT = * )
284 WRITE( NOUT, FMT = 9999 )
285 $ 'the following parameter values will be used:'
286 WRITE( NOUT, FMT = 9996 )'n ',
287 $ ( NVAL( I ), I = 1, MIN( NMAT, 10 ) )
288.GT. IF( NMAT10 )
289 $ WRITE( NOUT, FMT = 9997 )( NVAL( I ), I = 11, NMAT )
290 WRITE( NOUT, FMT = 9996 )'nb ',
291 $ ( NBVAL( I ), I = 1, MIN( NNB, 10 ) )
292.GT. IF( NNB10 )
293 $ WRITE( NOUT, FMT = 9997 )( NBVAL( I ), I = 11, NNB )
294 WRITE( NOUT, FMT = 9996 )'p ',
295 $ ( PVAL( I ), I = 1, MIN( NGRIDS, 10 ) )
296.GT. IF( NGRIDS10 )
297 $ WRITE( NOUT, FMT = 9997 )( PVAL( I ), I = 11, NGRIDS )
298 WRITE( NOUT, FMT = 9996 )'q ',
299 $ ( QVAL( I ), I = 1, MIN( NGRIDS, 10 ) )
300.GT. IF( NGRIDS10 )
301 $ WRITE( NOUT, FMT = 9997 )( QVAL( I ), I = 11, NGRIDS )
302 WRITE( NOUT, FMT = * )
303 WRITE( NOUT, FMT = 9995 )EPS
304 WRITE( NOUT, FMT = 9998 )THRESH
305*
306 ELSE
307*
308* If in pvm, must participate setting up virtual machine
309*
310.LT. IF( NPROCS1 )
311 $ CALL BLACS_SETUP( IAM, NPROCS )
312*
313* Temporarily define blacs grid to include all processes so
314* information can be broadcast to all processes
315*
316 CALL BLACS_GET( -1, 0, ICTXT )
317 CALL BLACS_GRIDINIT( ICTXT, 'row-major', 1, NPROCS )
318*
319* Compute machine epsilon
320*
321 EPS = PDLAMCH( ICTXT, 'eps' )
322*
323 CALL SGEBR2D( ICTXT, 'all', ' ', 1, 1, THRESH, 1, 0, 0 )
324 CALL IGEBR2D( ICTXT, 'all', ' ', 3, 1, WORK, 3, 0, 0 )
325 NMAT = WORK( 1 )
326 NNB = WORK( 2 )
327 NGRIDS = WORK( 3 )
328*
329 I = NMAT + NNB + 2*NGRIDS
330 CALL IGEBR2D( ICTXT, 'all', ' ', I, 1, WORK, I, 0, 0 )
331 I = 1
332 CALL ICOPY( NMAT, WORK( I ), 1, NVAL, 1 )
333 I = I + NMAT
334 CALL ICOPY( NNB, WORK( I ), 1, NBVAL, 1 )
335 I = I + NNB
336 CALL ICOPY( NGRIDS, WORK( I ), 1, PVAL, 1 )
337 I = I + NGRIDS
338 CALL ICOPY( NGRIDS, WORK( I ), 1, QVAL, 1 )
339*
340 END IF
341*
342 CALL BLACS_GRIDEXIT( ICTXT )
343*
344 RETURN
345*
346 30 CONTINUE
347 WRITE( NOUT, FMT = 9993 )
348 CLOSE ( NIN )
349.NE..AND..NE. IF( NOUT6 NOUT0 )
350 $ CLOSE ( NOUT )
351 CALL BLACS_ABORT( ICTXT, 1 )
352*
353 STOP
354*
355 9999 FORMAT( A )
356 9998 FORMAT( 'routines pass computational tests if scaled residual ',
357 $ 'is less than ', G12.5 )
358 9997 FORMAT( ' ', 10I6 )
359 9996 FORMAT( 2X, A5, ' : ', 10I6 )
360 9995 FORMAT( 'relative machine precision(eps) is taken to be ',
361 $ E18.6 )
362 9994 FORMAT( ' number of values of ', 5A,
363 $ ' is less than 1 or greater ', 'than ', I2 )
364 9993 FORMAT( ' illegal input in file ', 40A, '. aborting run.' )
365 9992 FORMAT( ' blocking size too small at ', I2, ' must be >=6.' )
366*
367* End of PZEVCINFO
368*
369 END
end diagonal values have been computed in the(sparse) matrix id.SOL
subroutine icopy(n, sx, incx, sy, incy)
ICOPY
Definition icopy.f:75
#define min(a, b)
Definition macros.h:20
#define max(a, b)
Definition macros.h:21
subroutine sgebs2d(contxt, scope, top, m, n, a, lda)
Definition mpi.f:1072
subroutine blacs_gridinit(cntxt, c, nprow, npcol)
Definition mpi.f:745
subroutine sgebr2d(contxt, scope, top, m, n, a, lda)
Definition mpi.f:1113
subroutine blacs_gridexit(cntxt)
Definition mpi.f:762
subroutine pzevcinfo(summry, nout, nmat, nval, ldnval, nnb, nbval, ldnbval, ngrids, pval, ldpval, qval, ldqval, thresh, work, iam, nprocs)
Definition pzevcinfo.f:4