ScaLAPACK  2.0.2
ScaLAPACK: Scalable Linear Algebra PACKage
pdsepdriver.f
Go to the documentation of this file.
00001 *
00002 *
00003       PROGRAM PDSEPDRIVER
00004 *
00005 *  -- ScaLAPACK routine (version 1.7) --
00006 *     University of Tennessee, Knoxville, Oak Ridge National Laboratory,
00007 *     and University of California, Berkeley.
00008 *     May 1, 1997
00009 *
00010 *     Parallel DOUBLE PRECISION symmetric eigenproblem test driver
00011 *
00012 *     The user should modify TOTMEM to indicate the maximum amount of
00013 *     memory in bytes her system has.  Remember to leave room in memory
00014 *     for operating system, the BLACS buffer, etc.  INTSIZ and DBLSIZ
00015 *     indicate the length in bytes on the given platform for an integer
00016 *     and a double precision real.
00017 *     For example, on our system with 8 MB of memory, TOTMEM=6500000
00018 *     (leaves 1.5 MB for OS, code, BLACS buffer, etc), the length of a
00019 *     DOUBLE is 8, and an integer takes up 4 bytes.  Some playing around
00020 *     to discover what the maximum value you can set MEMSIZ to may be
00021 *     required.
00022 *     All arrays used by factorization and solve are allocated out of
00023 *     big array called MEM.
00024 *
00025 *     The full tester requires approximately (5 n + 5 n^2/p + slop)
00026 *     DOUBLE PRECISION words and 6*n integer words.
00027 *     So, TOTMEM should be set to at least 1.1 * 8 * (5n + 5n^2/p)
00028 *
00029 *     WHAT WE TEST
00030 *     ============
00031 *
00032 *     This routine tests PDSYEVX, the expert driver for the parallel
00033 *     symmetric eigenvalue problem, PDSYEV and PDSYEVD.  We would like 
00034 *     to cover all possible combinations of:  matrix size, process 
00035 *     configuration (nprow and npcol), block size (nb), 
00036 *     matrix type (??), range of eigenvalue (all, by value, 
00037 *     by position), sorting options, and upper vs. lower storage.
00038 *
00039 *     As PDSYEV returns an error message when heterogeneity is detected,
00040 *     the PDSYEV tests can be suppressed by changing the appropiate
00041 *     entry in the input file.
00042 *
00043 *     We intend to provide two types of test input files, an
00044 *     installation test and a thorough test.
00045 *
00046 *     We also intend that the reports be meaningful.  Our input file
00047 *     will allow multiple requests where each request is a cross product
00048 *     of the following sets:
00049 *       matrix sizes:                     n
00050 *       process configuration triples:  nprow, npcol, nb
00051 *       matrix types:
00052 *       eigenvalue requests:              all, by value, by position
00053 *       storage (upper vs. lower):        uplo
00054 *
00055 *     TERMS:
00056 *       Request - means a set of tests, which is the cross product of
00057 *       a set of specifications from the input file.
00058 *       Test - one element in the cross product, i.e. a specific input
00059 *       size and type, process configuration, etc.
00060 *
00061 *     .. Parameters ..
00062 *
00063       INTEGER            TOTMEM, DBLESZ, NIN
00064       PARAMETER          ( TOTMEM = 2000000, DBLESZ = 8, NIN = 11 )
00065       INTEGER            MEMSIZ
00066       PARAMETER          ( MEMSIZ = TOTMEM / DBLESZ )
00067 *     ..
00068 *     .. Local Scalars ..
00069       CHARACTER          HETERO
00070       CHARACTER*80       SUMMRY, USRINFO
00071       INTEGER            CONTEXT, IAM, INFO, ISIEEE, MAXNODES, NNOCHECK,
00072      $                   NOUT, NPASSED, NPROCS, NSKIPPED, NTESTS
00073 *     ..
00074 *     .. Local Arrays ..
00075 *
00076       INTEGER            ISEED( 4 )
00077       DOUBLE PRECISION   MEM( MEMSIZ )
00078 *     ..
00079 *     .. External Functions ..
00080       DOUBLE PRECISION   DLAMCH
00081       EXTERNAL           DLAMCH
00082 *     ..
00083 *     .. External Subroutines ..
00084 *
00085       EXTERNAL           BLACS_EXIT, BLACS_GET, BLACS_GRIDEXIT, 
00086      $                   BLACS_GRIDINIT, BLACS_PINFO, BLACS_SETUP, 
00087      $                   IGAMN2D, PDLACHKIEEE, PDLASNBT, PDSEPREQ 
00088 *     ..
00089 *     .. Executable Statements ..
00090 *
00091 *     Get starting information
00092 *
00093       CALL BLACS_PINFO( IAM, NPROCS )
00094 *
00095 *
00096       IF( IAM.EQ.0 ) THEN
00097 *
00098 *        Open file and skip data file header
00099 *
00100          OPEN( UNIT = NIN, FILE = 'SEP.dat', STATUS = 'OLD' )
00101          READ( NIN, FMT = * )SUMMRY
00102          SUMMRY = ' '
00103 *
00104 *        Read in user-supplied info about machine type, compiler, etc.
00105 *
00106          READ( NIN, FMT = 9999 )USRINFO
00107 *
00108 *        Read name and unit number for summary output file
00109 *
00110          READ( NIN, FMT = * )SUMMRY
00111          READ( NIN, FMT = * )NOUT
00112          IF( NOUT.NE.0 .AND. NOUT.NE.6 )
00113      $      OPEN( NOUT, FILE = SUMMRY, STATUS = 'UNKNOWN' )
00114          READ( NIN, FMT = * )MAXNODES
00115          READ( NIN, FMT = * )HETERO
00116       END IF
00117 *
00118       IF( NPROCS.LT.1 ) THEN
00119          CALL BLACS_SETUP( IAM, MAXNODES )
00120          NPROCS = MAXNODES
00121       END IF
00122 *
00123       CALL BLACS_GET( -1, 0, CONTEXT )
00124       CALL BLACS_GRIDINIT( CONTEXT, 'R', 1, NPROCS )
00125 *
00126       CALL PDLASNBT( ISIEEE )
00127 *
00128       CALL IGAMN2D( CONTEXT, 'a', ' ', 1, 1, ISIEEE, 1, 1, 1, -1, -1,
00129      $              0 )
00130 *
00131       IF( ( ISIEEE.NE.0 ) ) THEN
00132          IF( IAM.EQ.0 ) THEN
00133             WRITE( NOUT, FMT = 9998 )
00134             WRITE( NOUT, FMT = 9997 )
00135             WRITE( NOUT, FMT = 9996 )
00136             WRITE( NOUT, FMT = 9995 )
00137             WRITE( NOUT, FMT = 9994 )
00138             WRITE( NOUT, FMT = 9993 )
00139             WRITE( NOUT, FMT = 9992 )
00140             WRITE( NOUT, FMT = 9991 )
00141             WRITE( NOUT, FMT = 9990 )
00142          END IF
00143 *
00144          CALL PDLACHKIEEE( ISIEEE, DLAMCH( 'O' ), DLAMCH( 'U' ) )
00145 *
00146          CALL IGAMN2D( CONTEXT, 'a', ' ', 1, 1, ISIEEE, 1, 1, 1, -1, -1,
00147      $                 0 )
00148 *
00149          IF( ISIEEE.EQ.0 ) THEN
00150             IF( IAM.EQ.0 ) THEN
00151                WRITE( NOUT, FMT = 9989 )
00152                WRITE( NOUT, FMT = 9988 )
00153                WRITE( NOUT, FMT = 9987 )
00154             END IF
00155             GO TO 20
00156          END IF
00157 *
00158          IF( IAM.EQ.0 ) THEN
00159             WRITE( NOUT, FMT = 9986 )
00160          END IF
00161 *
00162       END IF
00163 *
00164       IF( IAM.EQ.0 ) THEN
00165          WRITE( NOUT, FMT = 9999 )
00166      $      'SCALAPACK symmetric Eigendecomposition routines.'
00167          WRITE( NOUT, FMT = 9999 )USRINFO
00168          WRITE( NOUT, FMT = 9999 )' '
00169          WRITE( NOUT, FMT = 9999 )'Running tests of the parallel ' //
00170      $      'symmetric eigenvalue routine:  PDSYEVX & '//
00171      $       ' PDSYEV & PDSYEVD.'
00172          WRITE( NOUT, FMT = 9999 )'The following scaled residual ' //
00173      $      'checks will be computed:'
00174          WRITE( NOUT, FMT = 9999 )' ||AQ - QL|| ' //
00175      $      '/ ((abstol + ||A|| * eps) * N)'
00176          WRITE( NOUT, FMT = 9999 )' ||Q^T*Q - I|| ' // '/ (N * eps)'
00177          WRITE( NOUT, FMT = 9999 )
00178          WRITE( NOUT, FMT = 9999 )'An explanation of the ' //
00179      $      'input/output parameters follows:'
00180          WRITE( NOUT, FMT = 9999 )'RESULT   : passed; or ' //
00181      $      'an indication of which eigen request test failed'
00182          WRITE( NOUT, FMT = 9999 )
00183      $      'N        : The number of rows and columns ' //
00184      $      'of the matrix A.'
00185          WRITE( NOUT, FMT = 9999 )
00186      $      'P        : The number of process rows.'
00187          WRITE( NOUT, FMT = 9999 )
00188      $      'Q        : The number of process columns.'
00189          WRITE( NOUT, FMT = 9999 )
00190      $      'NB       : The size of the square blocks' //
00191      $      ' the matrix A is split into.'
00192          WRITE( NOUT, FMT = 9999 )
00193      $      'THRESH   : If a residual value is less ' //
00194      $      'than THRESH, RESULT is flagged as PASSED.'
00195          WRITE( NOUT, FMT = 9999 )
00196      $      '         : the QTQ norm is allowed to exceed THRESH' //
00197      $      ' for those eigenvectors'
00198          WRITE( NOUT, FMT = 9999 )'         :  which could not be ' //
00199      $      'reorthogonalized for lack of workspace.'
00200          WRITE( NOUT, FMT = 9999 )
00201      $      'TYP      : matrix type (see PDSEPtst.f).'
00202          WRITE( NOUT, FMT = 9999 )'SUB      : Subtests ' //
00203      $      '(see PDSEPtst).f'
00204          WRITE( NOUT, FMT = 9999 )'CHK      : ||AQ - QL|| ' //
00205      $      '/ ((abstol + ||A|| * eps) * N)'
00206          WRITE( NOUT, FMT = 9999 )'QTQ      : ||Q^T*Q - I||/ (N * eps)'
00207          WRITE( NOUT, FMT = 9999 )
00208      $      '         : when the adjusted QTQ exceeds THRESH',
00209      $      ' the adjusted QTQ norm is printed'
00210          WRITE( NOUT, FMT = 9999 )
00211      $      '         : otherwise the true QTQ norm is printed'
00212          WRITE( NOUT, FMT = 9999 )
00213      $      '           If NT>1, CHK and QTQ are the max over all ' //
00214      $      'eigen request tests'
00215          WRITE( NOUT, FMT = 9999 )
00216      $      'TEST     : EVX - testing PDSYEVX, EV - testing PDSYEV, '//
00217      $        'EVD - testing PDSYEVD'
00218          WRITE( NOUT, FMT = 9999 )' '
00219       END IF
00220 *
00221       NTESTS = 0
00222       NPASSED = 0
00223       NSKIPPED = 0
00224       NNOCHECK = 0
00225 *
00226       IF( IAM.EQ.0 ) THEN
00227          WRITE( NOUT, FMT = 9979 )
00228          WRITE( NOUT, FMT = 9978 )
00229       END IF
00230 *
00231    10 CONTINUE
00232 *
00233       ISEED( 1 ) = 139
00234       ISEED( 2 ) = 1139
00235       ISEED( 3 ) = 2139
00236       ISEED( 4 ) = 3139
00237 *
00238       CALL PDSEPREQ( HETERO, NIN, MEM, MEMSIZ, NOUT, ISEED, NTESTS,
00239      $               NSKIPPED, NNOCHECK, NPASSED, INFO )
00240       IF( INFO.EQ.0 )
00241      $   GO TO 10
00242 *
00243       IF( IAM.EQ.0 ) THEN
00244          WRITE( NOUT, FMT = 9985 )NTESTS
00245          WRITE( NOUT, FMT = 9984 )NPASSED
00246          WRITE( NOUT, FMT = 9983 )NNOCHECK
00247          WRITE( NOUT, FMT = 9982 )NSKIPPED
00248          WRITE( NOUT, FMT = 9981 )NTESTS - NPASSED - NSKIPPED -
00249      $      NNOCHECK
00250          WRITE( NOUT, FMT = * )
00251          WRITE( NOUT, FMT = * )
00252          WRITE( NOUT, FMT = 9980 )
00253       END IF
00254 *
00255 *     Uncomment this line on SUN systems to avoid the useless print out
00256 *
00257 c      CALL IEEE_FLAGS( 'clear', 'exception', 'underflow', ' ')
00258 *
00259 *
00260 *
00261    20 CONTINUE
00262       IF( IAM.EQ.0 ) THEN
00263          CLOSE ( NIN )
00264          IF( NOUT.NE.6 .AND. NOUT.NE.0 )
00265      $      CLOSE ( NOUT )
00266       END IF
00267 *
00268       CALL BLACS_GRIDEXIT( CONTEXT )
00269 *
00270       CALL BLACS_EXIT( 0 )
00271       STOP
00272 *
00273 *
00274  9999 FORMAT( A )
00275  9998 FORMAT( ' I am about to check to make sure that overflow' )
00276  9997 FORMAT( ' is handled in the ieee default manner.  If this' )
00277  9996 FORMAT( ' is the last output you see, you should assume' )
00278  9995 FORMAT( ' that overflow caused a floating point exception.' )
00279  9994 FORMAT( ' In that case, we recommend that you add -DNO_IEEE' )
00280  9993 FORMAT( ' to the CDEFS line in SLmake.inc.' )
00281  9992 FORMAT( ' Alternatively, you could set CDEFS in SLmake.inc ' )
00282  9991 FORMAT( ' to enable the default ieee behaviour, However, this' )
00283  9990 FORMAT( ' may result in good or very bad performance.' )
00284  9989 FORMAT( ' Either signed zeroes or signed infinities ' )
00285  9988 FORMAT( ' work incorrectly or your system.  Change your' )
00286  9987 FORMAT( ' SLmake.inc as suggested above.' )
00287 *
00288  9986 FORMAT( ' Your system appears to handle ieee overflow.' )
00289 *
00290  9985 FORMAT( 'Finished ', I6, ' tests, with the following results:' )
00291  9984 FORMAT( I5, ' tests completed and passed residual checks.' )
00292  9983 FORMAT( I5, ' tests completed without checking.' )
00293  9982 FORMAT( I5, ' tests skipped for lack of memory.' )
00294  9981 FORMAT( I5, ' tests completed and failed.' )
00295  9980 FORMAT( 'END OF TESTS.' )
00296  9979 FORMAT( '     N  NB   P   Q TYP SUB   WALL      CPU  ',
00297      $      '    CHK       QTQ    CHECK    TEST' )
00298  9978 FORMAT( ' ----- --- --- --- --- --- -------- --------',
00299      $      ' --------- --------- -----    ----' )
00300 *
00301 *     End of PDSEPDRIVER
00302 *
00303       END