1 SUBROUTINE pddbinfo( SUMMRY, NOUT, TRANS, NMAT, NVAL, LDNVAL, NBW,
2 $ BWLVAL, BWUVAL, LDBWVAL, NNB, NBVAL, LDNBVAL,
3 $ NNR, NRVAL, LDNRVAL, NNBR, NBRVAL, LDNBRVAL,
4 $ NGRIDS, PVAL, LDPVAL, QVAL, LDQVAL, THRESH,
18 $ LDBWVAL, LDNBRVAL, LDNBVAL, LDNRVAL, LDNVAL,
19 $ ldpval, ldqval, ngrids, nmat, nnb, nnbr, nbw,
24 INTEGER NBRVAL( LDNBRVAL ), NBVAL( LDNBVAL ),
25 $ nrval( ldnrval ), nval( ldnval ),
26 $ bwlval( ldbwval),bwuval( ldbwval),
27 $ pval( ldpval ), qval(ldqval), work( * )
151 PARAMETER ( NIN = 11 )
165 DOUBLE PRECISION PDLAMCH
166 EXTERNAL LSAME, PDLAMCH
180 OPEN( nin, file =
'BLU.dat', status =
'OLD' )
181 READ( nin, fmt = * ) summry
186 READ( nin, fmt = 9999 ) usrinfo
190 READ( nin, fmt = * ) summry
191 READ( nin, fmt = * ) nout
192 IF( nout.NE.0 .AND. nout.NE.6 )
193 $
OPEN( nout, file = summry, status =
'UNKNOWN' )
199 READ( nin, fmt = * ) trans
204 READ( nin, fmt = * ) nmat
205 IF( nmat.LT.1 .OR. nmat.GT.ldnval )
THEN
206 WRITE( nout, fmt = 9994 )
'N', ldnval
209 READ( nin, fmt = * ) ( nval( i ), i = 1, nmat )
213 READ( nin, fmt = * ) nbw
214 IF( nbw.LT.1 .OR. nbw.GT.ldbwval )
THEN
215 WRITE( nout, fmt = 9994 )
'BW', ldbwval
218 READ( nin, fmt = * ) ( bwlval( i ), i = 1, nbw )
219 READ( nin, fmt = * ) ( bwuval( i ), i = 1, nbw )
223 READ( nin, fmt = * ) nnb
224 IF( nnb.LT.1 .OR. nnb.GT.ldnbval )
THEN
225 WRITE( nout, fmt = 9994 )
'NB', ldnbval
228 READ( nin, fmt = * ) ( nbval( i ), i = 1, nnb )
232 READ( nin, fmt = * ) nnr
233 IF( nnr.LT.1 .OR. nnr.GT.ldnrval )
THEN
234 WRITE( nout, fmt = 9994 )
'NRHS', ldnrval
237 READ( nin, fmt = * ) ( nrval( i ), i = 1, nnr )
242 IF( nnbr.LT.1 .OR. nnbr.GT.ldnbrval )
THEN
243 WRITE( nout, fmt = 9994 )
'NBRHS', ldnbrval
246 READ( nin, fmt = * ) ( nbrval( i ), i = 1, nnbr )
250 READ( nin, fmt = * ) ngrids
251 IF( ngrids.LT.1 .OR. ngrids.GT.ldpval )
THEN
252 WRITE( nout, fmt = 9994 )
'Grids', ldpval
254 ELSE IF( ngrids.GT.ldqval )
THEN
255 WRITE( nout, fmt = 9994 )
'Grids', ldqval
260 DO 8738 i = 1, ngrids
266 READ( nin, fmt = * ) ( qval( i ), i = 1, ngrids )
270 READ( nin, fmt = * ) thresh
279 IF( nprocs.LT.1 )
THEN
282 nprocs =
max( nprocs, pval( i )*qval( i ) )
284 CALL blacs_setup( iam, nprocs )
290 CALL blacs_get( -1, 0, ictxt )
295 eps = pdlamch( ictxt,
'eps' )
299 CALL sgebs2d( ictxt,
'All',
' ', 1, 1, thresh, 1 )
313 IF( lsame( trans,
'N' ) )
THEN
321 CALL igebs2d( ictxt,
'All',
' ', 1, 1, i-1, 1 )
323 CALL igebs2d( ictxt,
'All',
' ', i-1, 1, work, i-1 )
326 CALL icopy( nmat, nval, 1, work( i ), 1 )
328 CALL icopy( nbw, bwlval, 1, work( i ), 1 )
330 CALL icopy( nbw, bwuval, 1, work( i ), 1 )
332 CALL icopy( nnb, nbval, 1, work( i ), 1 )
334 CALL icopy( nnr, nrval, 1, work( i ), 1 )
336 CALL icopy( nnbr, nbrval, 1, work( i ), 1 )
338 CALL icopy( ngrids, pval, 1, work( i ), 1 )
340 CALL icopy( ngrids, qval, 1, work( i ), 1 )
342 CALL igebs2d( ictxt,
'All',
' ', i-1, 1, work, i-1 )
346 WRITE( nout, fmt = 9999 )
347 $
'SCALAPACK banded linear systems.'
348 WRITE( nout, fmt = 9999 ) usrinfo
349 WRITE( nout, fmt = * )
350 WRITE( nout, fmt = 9999 )
351 $
'Tests of the parallel '//
352 $
'real double precision band matrix solve '
353 WRITE( nout, fmt = 9999 )
354 $
'The following scaled residual '//
355 $
'checks will be computed:'
356 WRITE( nout, fmt = 9999 )
357 $
' Solve residual = ||Ax - b|| / '//
358 $
'(||x|| * ||A|| * eps * N)'
359 WRITE( nout, fmt = 9999 )
360 $
' Factorization residual = ||A - LU|| /'//
361 $
' (||A|| * eps * N)'
362 WRITE( nout, fmt = 9999 )
363 $
'The matrix A is randomly '//
364 $
'generated for each test.'
365 WRITE( nout, fmt = * )
366 WRITE( nout, fmt = 9999 )
367 $
'An explanation of the input/output '//
368 $
'parameters follows:'
369 WRITE( nout, fmt = 9999 )
370 $
'TIME : Indicates whether WALL or '//
371 $
'CPU time was used.'
373 WRITE( nout, fmt = 9999 )
374 $
'N : The number of rows and columns '//
376 WRITE( nout, fmt = 9999 )
377 $
'bwl, bwu : The number of diagonals '//
379 WRITE( nout, fmt = 9999 )
380 $
'NB : The size of the column panels the'//
381 $
' matrix A is split into. [-1 for default]'
382 WRITE( nout, fmt = 9999 )
383 $
'NRHS : The total number of RHS to solve'//
385 WRITE( nout, fmt = 9999 )
386 $
'NBRHS : The number of RHS to be put on '//
387 $
'a column of processes before going'
388 WRITE( nout, fmt = 9999 )
389 $
' on to the next column of processes.'
390 WRITE( nout, fmt = 9999 )
391 $
'P : The number of process rows.'
392 WRITE( nout, fmt = 9999 )
393 $
'Q : The number of process columns.'
394 WRITE( nout, fmt = 9999 )
395 $ 'thresh :
If a residual
value is less than
'//
396 $ ' thresh, check is flagged as passed
'
397 WRITE( NOUT, FMT = 9999 )
398 $ 'fact time: time in seconds to factor
the'//
400 WRITE( NOUT, FMT = 9999 )
401 $ 'sol time: time in seconds to solve
the'//
403 WRITE( NOUT, FMT = 9999 )
404 $ 'mflops : rate of execution
for factor
'//
405 $ 'and solve using sequential operation count.
'
406 WRITE( NOUT, FMT = 9999 )
407 $ 'mflop2 : rough estimate of speed
'//
408 $ 'using actual op count(accurate big p,n).
'
409 WRITE( NOUT, FMT = * )
410 WRITE( NOUT, FMT = 9999 )
411 $ 'the following
parameter values will be used:
'
412 WRITE( NOUT, FMT = 9996 )
413 $ 'n
', ( NVAL(I), I = 1, MIN(NMAT, 10) )
415 $ WRITE( NOUT, FMT = 9997 ) ( NVAL(I), I = 11, NMAT )
416 WRITE( NOUT, FMT = 9996 )
417 $ 'bwl
', ( BWLVAL(I), I = 1, MIN(NBW, 10) )
419 $ WRITE( NOUT, FMT = 9997 ) ( BWLVAL(I), I = 11, NBW )
420 WRITE( NOUT, FMT = 9996 )
421 $ 'bwu
', ( BWUVAL(I), I = 1, MIN(NBW, 10) )
423 $ WRITE( NOUT, FMT = 9997 ) ( BWUVAL(I), I = 11, NBW )
424 WRITE( NOUT, FMT = 9996 )
425 $ 'nb
', ( NBVAL(I), I = 1, MIN(NNB, 10) )
427 $ WRITE( NOUT, FMT = 9997 ) ( NBVAL(I), I = 11, NNB )
428 WRITE( NOUT, FMT = 9996 )
429 $ 'nrhs
', ( NRVAL(I), I = 1, MIN(NNR, 10) )
431 $ WRITE( NOUT, FMT = 9997 ) ( NRVAL(I), I = 11, NNR )
432 WRITE( NOUT, FMT = 9996 )
433 $ 'nbrhs
', ( NBRVAL(I), I = 1, MIN(NNBR, 10) )
435 $ WRITE( NOUT, FMT = 9997 ) ( NBRVAL(I), I = 11, NNBR )
436 WRITE( NOUT, FMT = 9996 )
437 $ 'p
', ( PVAL(I), I = 1, MIN(NGRIDS, 10) )
439 $ WRITE( NOUT, FMT = 9997) ( PVAL(I), I = 11, NGRIDS )
440 WRITE( NOUT, FMT = 9996 )
441 $ 'q
', ( QVAL(I), I = 1, MIN(NGRIDS, 10) )
443 $ WRITE( NOUT, FMT = 9997 ) ( QVAL(I), I = 11, NGRIDS )
444 WRITE( NOUT, FMT = * )
445 WRITE( NOUT, FMT = 9995 ) EPS
446 WRITE( NOUT, FMT = 9998 ) THRESH
453 $ CALL BLACS_SETUP( IAM, NPROCS )
458 CALL BLACS_GET( -1, 0, ICTXT )
459 CALL BLACS_GRIDINIT( ICTXT, 'row-major
', 1, NPROCS )
463 EPS = PDLAMCH( ICTXT, 'eps
' )
465 CALL SGEBR2D( ICTXT, 'all
', ' ', 1, 1, THRESH, 1, 0, 0 )
466 CALL IGEBR2D( ICTXT, 'all
', ' ', 1, 1, I, 1, 0, 0 )
467 CALL IGEBR2D( ICTXT, 'all
', ' ', I, 1, WORK, I, 0, 0 )
481.EQ.
IF( WORK( I ) 1 ) THEN
488 I = NMAT + NBW + NNB + NNR + NNBR + 2*NGRIDS
491 CALL IGEBR2D( ICTXT, 'all
', ' ', 1, I, WORK, 1, 0, 0 )
493 CALL ICOPY( NMAT, WORK( I ), 1, NVAL, 1 )
495 CALL ICOPY( NBW, WORK( I ), 1, BWLVAL, 1 )
497 CALL ICOPY( NBW, WORK( I ), 1, BWUVAL, 1 )
499 CALL ICOPY( NNB, WORK( I ), 1, NBVAL, 1 )
501 CALL ICOPY( NNR, WORK( I ), 1, NRVAL, 1 )
503 CALL ICOPY( NNBR, WORK( I ), 1, NBRVAL, 1 )
505 CALL ICOPY( NGRIDS, WORK( I ), 1, PVAL, 1 )
507 CALL ICOPY( NGRIDS, WORK( I ), 1, QVAL, 1 )
511 CALL BLACS_GRIDEXIT( ICTXT )
515 20 WRITE( NOUT, FMT = 9993 )
517.NE..AND..NE.
IF( NOUT6 NOUT0 )
520 CALL BLACS_ABORT( ICTXT, 1 )
524 9998 FORMAT( 'routines pass computational tests
if scaled residual
',
525 $ 'is less than
', G12.5 )
526 9997 FORMAT( ' ', 10I6 )
527 9996 FORMAT( 2X, A5, ':
', 10I6 )
528 9995 FORMAT( 'relative machine precision(eps) is taken to be
',
530 9994 FORMAT( ' number of values of
',5A, ' is less than 1 or greater
',
532 9993 FORMAT( ' illegal input in file
',40A,'. aborting run.
' )
subroutine pddbinfo(summry, nout, trans, nmat, nval, ldnval, nbw, bwlval, bwuval, ldbwval, nnb, nbval, ldnbval, nnr, nrval, ldnrval, nnbr, nbrval, ldnbrval, ngrids, pval, ldpval, qval, ldqval, thresh, work, iam, nprocs)