home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / benchmar / 1378 < prev    next >
Encoding:
Internet Message Format  |  1992-09-07  |  63.0 KB

  1. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!jvnc.net!netnews.upenn.edu!msuinfo!vthnw.cvm.msu.edu!eoq
  2. From: eoq@vthnw.cvm.msu.edu (Edward Quillen)
  3. Newsgroups: comp.benchmarks
  4. Subject: Fortran source of Livermore Loops benchmark
  5. Message-ID: <eoq.41.0@vthnw.cvm.msu.edu>
  6. Date: 6 Sep 92 01:43:52 GMT
  7. Sender: news@msuinfo.cl.msu.edu
  8. Organization: Veterinary Teaching Hospital, Michigan State Univ.
  9. Lines: 1636
  10.  
  11. C     PROGRAM MFLOPS(TAPE6=OUTPUT)
  12. C                             LATEST FILE MODIFICATION DATE:  22/DEC/86R
  13. C****************************************************************************
  14. C MEASURES CPU PERFORMANCE RANGE OF THE COMPUTER/COMPILER/COMPUTATION COMPLEX
  15. C****************************************************************************
  16. C                                                                           *
  17. C     L. L. N. L.   F O R T R A N   K E R N E L S:   M F L O P S            *
  18. C                                                                           *
  19. C     These kernels measure  Fortran  numerical  computation rates for a    *
  20. C     spectrum of  CPU-limited  computational  structures.  Mathematical    *
  21. C     through-put is measured  in  units  of  millions of floating-point    *
  22. C     operations executed per second, called Megaflops/sec.                 *
  23. C                                                                           *
  24. C     This program  measures  a realistic  CPU performance range for the    *
  25. C     Fortran programming system  on  a  given day.  The CPU performance    *
  26. C     rates depend  strongly  on  the maturity of the Fortran compiler's    *
  27. C     ability to translate Fortran code into efficient machine code.        *
  28. C                                                                           *
  29. C     [ The CPU hardware  capability  apart  from  compiler maturity (or    *
  30. C     availability), could be measured (or simulated) by programming the    *
  31. C     kernels in assembly  or machine code directly.  These measurements    *
  32. C     can also  serve  as a framework for tracking the maturation of the    *
  33. C     Fortran compiler during system development.]                          *
  34. C                                                                           *
  35. C     While this test evaluates  the  performance of a broad sampling of    *
  36. C     Fortran computations,  it  is not an application program and hence    *
  37. C     it is not a benchmark  per  se.  The performance of benchmarks and    *
  38. C     even workloads,  if  CPU  limited,  could  be roughly estimated by    *
  39. C     choosing appropriate weights  and loop limits for each kernel (see    *
  40. C     Block Data). The LFK methodology is discussed in subroutine REPORT.   *
  41. C     The glossary and module hierarchy are documented in subr. INDEX.      *
  42. C                                                                           *
  43. C     Use of this program is granted with the request that a copy of the    *
  44. C     results be sent to  the  author  at the address shown below, to be    *
  45. C     added to  our studies of  computer performance.   Please send your    *
  46. C     complete MFLOPS output file on a 5" PC/DOS  diskette, if possible.    *
  47. C     Your timing results will be held as proprietary data, if so marked.   *
  48. C     In return, you will recieve a copy of our latest report.              *
  49. C                                                                           *
  50. C                                                                           *
  51. C          F.H. McMahon     L-35                                            *
  52. C          Lawrence Livermore National Laboratory                           *
  53. C          P.0. Box 808                                                     *
  54. C          Livermore, CA.   94550                                           *
  55. C                                                                           *
  56. C                                                                           *
  57. C                    (C) Copyright 1983 the Regents of the                  *
  58. C                University of California. All Rights Reserved.             *
  59. C                                                                           *
  60. C               This work was produced under the sponsorship of             *
  61. C                the U.S. Department of Energy. The Government              *
  62. C                       retains certain rights therein.                     *
  63. C                                                                           *
  64. C****************************************************************************
  65. C
  66. C
  67. C
  68. C
  69. C
  70. C
  71. C                             DIRECTIONS
  72. C
  73. C  1. We REQUIRE one test-run of the Fortran kernels as is, that is, with
  74. C     no reprogramming.  Standard product compiler directives may be
  75. C     used for optimization as these do not constitute reprogramming.
  76. C
  77. C     In addition, the vendor may, if so desired, reprogram the kernels to
  78. C     demonstrate high performance hardware features.  Kernels 13,14,23
  79. C     are partially vectorisable and kernels 15,16,24 are vectorisable if
  80. C     re-written. Kernels 5,11,17,19,20 are implicit computations that
  81. C     must not be explicitly vectorised using compiler directives to
  82. C     ignore dependencies.  In any case, compiler listings of the codes
  83. C     actually used should be returned along with the timing results.
  84. C
  85. C  2. For vector processors, we REQUIRE an ALL-scalar compilation test-run
  86. C     to measure the basic scalar performance range of the processor.
  87. C
  88. C  3. On computers where default single precision is REAL*4 we REQUIRE an
  89. C     additional test-run with all mantissas.ge.47 .  Declare all REAL
  90. C     variables REAL*8 using one of the following declarations in each routine:
  91. C
  92. cANSI IMPLICIT  DOUBLE PRECISION (A-H,O-Z)
  93. cIBM  IMPLICIT  REAL*8           (A-H,O-Z)
  94. c     ( Then there is a redundant declaration in subrs SIGNAL and SUMO.)
  95. C
  96. C  4. On computers with Cache memories and high resolution CPU clocks we
  97. C     REQUIRE, if feasible, another ALL-scalar test-run setting Loop= 1
  98. C     in SIZES to test un-primed cache (as well as encached) cpu rates.
  99. C     Increase the size of array CACHE(in subr. VALUES) from 8192 to cache size.
  100. C
  101. C  5. Installation includes verifying or changing the following:
  102. C
  103. C      First :  the I/O output device number= IOU assignment in MAIN.
  104. C      Second:  the definition of function SECOND for CPU time only, and
  105. C               the value of TIC:= minimum cpu clock time(sec) in SIZES.
  106. C      Third :  the definition of function MOD2N in KERNEL
  107. C      Fourth:  the system names Komput, Kontrl, and Kompil in REPORT
  108. C      Fifth :  after checkout set Nruns=7 in SIZES for Standard Benchmark Test
  109. C
  110. C  6. Each kernel's computation is check-summed for easy validation.
  111. C     Verify correct processing using the checksums in subroutine REPORT
  112. C     which were computed setting  MULTI= 10  in  BLOCK DATA.
  113. C     Your checksums should compare to the precision used, within round-off.
  114. C
  115. C  7. Verify CPU Time measurements from function SECOND by comparing the clock
  116. C     calibration printout of total CPU time with system or real-time measures.
  117. C     The accuracy of SECOND is also tested using the test routine VERIFY.
  118. C
  119. C  8. On computers with Virtual Storage Systems assure a working-set space
  120. C     larger than the entire program so that page faults are negligible,
  121. C     because we must measure the CPU-limited computation rates.
  122. C     IT IS ALSO NECESSARY to run this test stand-alone, i.e. NO timesharing.
  123. C     In VS Systems a series of runs are needed to show stable CPU timings.
  124. C
  125. C  9. On parallel computer systems which compile vectors or Multi-tasking
  126. C     at the Do-loop level (Micro-tasking) parallelisation of the first
  127. C     DO (on L) in each kernel must be prevented by using a compiler directive
  128. C     or by setting Loop= 1. This outermost DO Loop is merely repitition
  129. C     used to increase timing accuracy and could distort the computation
  130. C     sample if parallelisation is based on this artificial iteration level.
  131. C****************************************************************************
  132. C
  133. C
  134. C
  135. c
  136. C/      PARAMETER( kn= 47, kn2= 95, np= 3, ls= 3*47, krs= 24)
  137. C/      PARAMETER( nk= 47, nl= 3, nr= 8 )
  138. c
  139.       COMMON /ALPHA/ mk,ik,ml,il,Nruns,jr, NPFS(8,3,47)
  140.       DIMENSION  FLOPS(141), TR(141), RATES(141), ID(141)
  141.       DIMENSION  LSPAN(141), WG(141), OSUM (141), TERR(141)
  142. c
  143. CLOX  REAL*8     SECOND
  144. c
  145.               t= SECOND(0.0)
  146.             iou= 6
  147.            OPEN  (UNIT=6, FILE='output', STATUS='NEW')
  148. cLLNL      call  Q8EBM
  149. cLLNL      call  PFM( 0, iou)
  150. c
  151. c                        Record name in active linkage chain in COMMON /DEBUG/
  152.            CALL  TRACKS(' MAIN.  ')
  153. c
  154. c                        Verify Sufficient Loop Size Versus Cpu Clock Accuracy
  155.            CALL  VERIFY( iou)
  156. c
  157. c                        Define control limits:  Nruns(runs), Loop(time), tic,
  158.            CALL  SIZES(-1)
  159. c
  160. c
  161. c                        Run test Nruns times Cpu-limited; I/O is deferred:
  162.       DO 1    k= 1,Nruns
  163.              jr= k
  164. c                        Run test using one of 3 sets of DO-Loop spans:
  165. c                        Set iou Negative to supress all I/O during Cpu timing.
  166.       DO 1    j= 1,ml
  167.              il= j
  168.            tock= TICK( -iou)
  169. c
  170.            CALL  KERNEL
  171.     1 continue
  172. c
  173. c
  174. c
  175. c                        Report timing errors, Mflops statistics:
  176.       DO 2    j= 1,ml
  177.              il= j
  178.            CALL  RESULT( iou,FLOPS,TR,RATES,LSPAN,WG,OSUM,TERR,ID)
  179. c
  180.            CALL  REPORT( iou,   mk,mk,FLOPS,TR,RATES,LSPAN,WG,OSUM,ID)
  181.     2 continue
  182. c
  183.            CALL  REPORT( iou,3*mk,mk,FLOPS,TR,RATES,LSPAN,WG,OSUM,ID)
  184. c
  185. c
  186.               t= SECOND(0.0) - t
  187.           WRITE( iou,9) t
  188.     9    FORMAT( 1H1,//,26H Version: 22/DEC/86R      ,/,
  189.      .                  26H CHECK CLOCK CALIBRATION: ,/,
  190.      .                  18H Total cpu Time = ,e14.5, 5H Sec. )
  191.       STOP
  192. c
  193. c
  194. c
  195. c
  196. c
  197. c
  198. c
  199. c
  200. c
  201. c
  202. c          Subroutine timing of all-scalar execution on CRAY-1:
  203. c
  204. c          Subroutine     Time(%)
  205. c
  206. c          KERNEL         43.46%
  207. c          SUPPLY         21.82%
  208. c          VERIFY         13.12%
  209. c          STATS           8.83%
  210. c          SQRT            1.84%
  211. c          SORDID          1.21%
  212. c          VALUES           .74%
  213. c          SUMO             .47%
  214. c          SIGNAL           .34%
  215. c          IQRANF           .26%
  216. c          STATW            .17%
  217. c
  218.       END
  219. c***********************************************
  220.       BLOCK DATA
  221. C***********************************************
  222. C
  223. cANSI IMPLICIT  DOUBLE PRECISION (A-H,O-Z)
  224. cIBM  IMPLICIT  REAL*8           (A-H,O-Z)
  225.       DOUBLE PRECISION  SUMS
  226. C
  227. C     l1 :=  param-dimension governs the size of most 1-d arrays
  228. C     l2 :=  param-dimension governs the size of most 2-d arrays
  229. C
  230. C  ISPAN :=  Array of limits for DO loop control in the kernels
  231. C  IPASS :=  Array of limits for multiple pass execution of each kernel
  232. C  FLOPN :=  Array of floating-point operation counts for one pass thru kernel
  233. C     WT :=  Array of weights to average kernel execution rates.
  234. C  SKALE :=  Array of scale factors for SIGNAL data generator.
  235. C   BIAS :=  Array of scale factors for SIGNAL data generator.
  236. C
  237. C    MUL :=  Array of multipliers * FLOPN  for each pass
  238. C    WTP :=  Array of multipliers *    WT  for each pass
  239. C     FR :=  Array of vectorisation fractions in REPORT
  240. C   SUMW :=  Array of quartile weights in REPORT
  241. C     IQ :=  Array of workload weights in REPORT
  242. C   SUMS :=  Array of Verified Checksums of Kernels results: Nruns= 1 and 7.
  243. C
  244. C/      PARAMETER( l1= 1001, l2=  101, l1d= 2*1001 )
  245. C/      PARAMETER( l13=  64, l13h= l13/2, l213= l13+l13h, l813= 8*l13 )
  246. C/      PARAMETER( l14=2048, l16=  75, l416= 4*l16 , l21= 25 )
  247. C
  248. C/      PARAMETER( l1=   27, l2=   15, l1d= 2*1001 )
  249. C/      PARAMETER( l13=   8, l13h= 8/2, l213= 8+4, l813= 8*8 )
  250. C/      PARAMETER( l14=  16, l16= 15, l416= 4*15 , l21= 15)
  251. C
  252. C
  253. C/      PARAMETER( l1=   1001, l2=   101, l1d= 2*1001 )
  254. C/      PARAMETER( l13= 64, l13h= 64/2, l213= 64+32, l813= 8*64 )
  255. C/      PARAMETER( l14= 2048, l16= 75, l416= 4*75 , l21= 25)
  256. C
  257. C/      PARAMETER( kn= 47, kn2= 95, np= 3, ls= 3*47, krs= 24)
  258. C/      PARAMETER( m1= 1001-1, m2= 101-1, m7= 1001-6 )
  259. C
  260.       COMMON /SPACES/ ion,j5,k2,k3,MULTI,Loop,m,kr,it,n13h,ibuf,
  261.      1                n,n1,n2,n13,n213,n813,n14,n16,n416,n21,nt1,nt2
  262. C
  263.       COMMON /SPACE0/ TIME(47), CSUM(47), WW(47), WT(47), ticks,
  264.      1                FR(9), TERR1(47), SUMW(7), START,
  265.      2              SKALE(47), BIAS(47), WS(95), TOTAL(47), FLOPN(47),
  266.      3                IQ(7), NPF, NPFS1(47)
  267. C
  268.       COMMON /SPACEI/ WTP(3), MUL(3), ISPAN(47,3), IPASS(47,3)
  269. C
  270.       COMMON /ORDER/ index, match, NSTACK(20)
  271. C
  272.       COMMON /PROOF/  SUMS(24,3,2)
  273. C     ****************************************************************
  274. C
  275.       DATA  ( ISPAN(i,1), i= 1,47) /
  276.      : 1001, 101, 1001, 1001, 1001, 64, 995, 100,
  277.      : 101, 101, 1001, 1000, 64, 1001, 101, 75,
  278.      : 101, 100, 101, 1000, 101, 101, 100, 1001, 23*0/
  279. C
  280. C*   : l1, l2, l1, l1, l1, l13, m7, m2,
  281. C*   : l2, l2, l1, m1, l13, l1, l2, l16,
  282. C*   : l2, m2, l2, m1, l21, l2, m2, l1, 23*0/
  283. C
  284.       DATA  ( ISPAN(i,2), i= 1,47) /
  285.      : 101, 101, 101, 101, 101,  32, 101, 100,
  286.      : 101, 101, 101, 100,  32, 101, 101,  40,
  287.      : 101, 100, 101, 100,  50, 101, 100, 101,  23*0/
  288. C
  289.       DATA  ( ISPAN(i,3), i= 1,47) /
  290.      : 27, 15, 27, 27, 27,  8, 21, 14,
  291.      : 15, 15, 27, 26,  8, 27, 15, 15,
  292.      : 15, 14, 15, 26, 20, 15, 14, 27,  23*0/
  293. C
  294.       DATA  ( IPASS(i,1), i= 1,47) /
  295.      :   7, 67,  9, 14, 10,  3,  4, 10, 36, 34, 11, 12,
  296.      :  36,  2,  1, 25, 35,  2, 39,  1,  1, 11,  8,  5,  23*0/
  297. C
  298.       DATA  ( IPASS(i,2), i= 1,47) /
  299.      :   40, 40, 53, 70, 55,  7, 22,  6, 21, 19, 64, 68,
  300.      :   41, 10,  1, 27, 20,  1, 23,  8,  1,  7,  5, 31,  23*0/
  301. C
  302.       DATA  ( IPASS(i,3), i= 1,47) /
  303.      :   28, 46, 37, 38, 40, 21, 20,  9, 26, 25, 46, 48,
  304.      :   31,  8,  1, 14, 26,  2, 28,  7,  1,  8,  7, 23,  23*0/
  305. C
  306.       DATA  (  MUL(i), i= 1,3) / 1, 2, 8 /
  307.       DATA  (  WTP(i), i= 1,3) / 1.0, 2.0, 1.0 /
  308. c
  309. c     The following flop-counts (FLOPN) are required for scalar or serial
  310. c     execution.  The scalar version defines the NECESSARY computation
  311. c     generally, in the absence of proof to the contrary.  The vector
  312. c     or parallel executions are only credited with executing the same
  313. c     necessary computation.  If the parallel methods do more computation
  314. c     than is necessary then the extra flops are not counted as through-put.
  315. c
  316.       DATA  ( FLOPN(i), i= 1,47)
  317.      :     /5., 4., 2., 2., 2., 2., 16., 36., 17., 9., 1., 1.,
  318.      :     7., 11., 33., 7., 9., 44., 6., 26., 2., 17., 11., 1., 23*0.0/
  319. C
  320.       DATA  ( WT(i), i= 1,47) /
  321.      : 1.0,  1.0,  1.0,  1.0,  1.0,  1.0,  1.0,  1.0,
  322.      : 1.0,  1.0,  1.0,  1.0,  1.0,  1.0,  1.0,  1.0,
  323.      : 1.0,  1.0,  1.0,  1.0,  1.0,  1.0,  1.0,  1.0, 23*0.0/
  324. C
  325. C/   :  .08, .04, .02, .03, .03, .04, .10, .05, .04, .03,                   HLN
  326. C/   :  .01, .02, .03, .02, .03, .05, .03, .20, .02, .02,                   HLN
  327. C/   :  .03, .03, .04, .01, 23*0.0/                                         HLN
  328. C
  329.       DATA  ( SKALE(i), i= 1,47) /
  330.      & 0.100D0, 0.100D0, 0.100D0, 0.100D0, 0.100D0, 0.100D0,
  331.      & 0.100D0, 0.100D0, 0.100D0, 0.100D0, 0.100D0, 0.100D0,
  332.      & 0.100D0, 0.100D0, 0.100D0, 0.100D0, 0.100D0, 0.100D0,
  333.      & 0.100D0, 0.100D0, 0.100D0, 0.100D0, 0.100D0, 0.100D0,
  334.      &       23*0.000D0 /
  335. C
  336. c    : 0.1,  0.1,  0.1,  0.1,  0.1,  0.1,  0.1,  0.1,
  337. c    : 0.1,  0.1,  0.1,  0.1,  0.1,  0.1,  0.1,  0.1,
  338. c    : 0.1,  0.1,  0.1,  0.1,  0.1,  0.1,  0.1,  0.1,  23*0.0/
  339. C
  340.       DATA  ( BIAS(i), i= 1,47) /
  341.      : 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
  342.      : 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
  343.      : 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  23*0.0/
  344. C
  345.       DATA  ( FR(i), i= 1,9) /
  346.      :  0.0, 0.2, 0.4, 0.6, 0.7, 0.8, 0.9, 0.95, 1.0/
  347. C
  348.       DATA  ( SUMW(i), i= 1,7) /
  349.      : 1.0, 0.95, 0.9, 0.8, 0.7, 0.6, 0.5/
  350. C
  351.       DATA  ( IQ(i), i= 1,7) /
  352.      : 1, 2, 1, 2, 1, 2, 1/
  353. C
  354.       DATA  START /0.0/, NPF/0/, ibuf/0/, match/0/, MULTI/10/
  355. C
  356.       DATA  ( SUMS(i,1,1), i= 1,24 ) /
  357.      &.5114652693224705D+05,.5150345372943066D+03,.1000742883066623D+02,
  358.      &.5999250595474070D+00,.4548871642388544D+04,.5229095383954675D+13,
  359.      &.6104251075163778D+05,.1501268005627157D+06,.1189443609975085D+06,
  360.      &.7310369784325972D+05,.3342910972650531D+08,.2907141428639174D-04,
  361.      &.4057110454105263D+10,.2982036205992255D+10,.3943816690352311D+05,
  362.      &.2832600000000000D+05,.1114641772903091D+04,.5165625410757306D+05,
  363.      &.5421816960150398D+03,.3040644339317275D+08,.8289464835786202D+07,
  364.      &.2938604376567099D+03,.3549834542446150D+05,.5000000000000000D+03/
  365. c
  366.       DATA  ( SUMS(i,2,1), i= 1,24 ) /
  367.      &.5253344778938000D+03,.5150345372943066D+03,.1009741436579188D+01,
  368.      &.5999250595474070D+00,.4589031939602131D+02,.2693280957416549D+16,
  369.      &.6345586315772524D+03,.1501268005627157D+06,.1189443609975085D+06,
  370.      &.7310369784325972D+05,.3433560407476162D+05,.7127569144561925D-05,
  371.      &.2325318944820836D+10,.3045676741897511D+08,.3943816690352311D+05,
  372.      &.3244100000000000D+05,.1114641772903091D+04,.5165625410757306D+05,
  373.      &.5421816960150398D+03,.3126205178811007D+05,.3986531136462291D+07,
  374.      &.2938604376567099D+03,.3549894609776936D+05,.5000000000000000D+02/
  375. c
  376.       DATA  ( SUMS(i,3,1), i= 1,24 ) /
  377.      &.3855104502494983D+02,.1199847611437483D+02,.2699309089321296D+00,
  378.      &.5999250595474070D+00,.3182615248448271D+01,.8303480073326955D+12,
  379.      &.2845720217638848D+02,.2960543667877649D+04,.2623968460874419D+04,
  380.      &.1651291227698377D+04,.6551161335846537D+03,.1943435981776804D-05,
  381.      &.4755211251524563D+09,.2547733008933910D+07,.1108997288135066D+04,
  382.      &.2577600000000000D+05,.2947368618590713D+02,.9700646212341513D+03,
  383.      &.1268230698051747D+02,.5987713249471801D+03,.2516870081042209D+07,
  384.      &.6109968728264795D+01,.4850340602751675D+03,.1300000000000000D+02/
  385. c
  386.       DATA  ( SUMS(i,1,2), i= 1,7 ) /
  387.      &.2982036205992255D+10,.6118901630090488D+10,.9103526877478772D+10,
  388.      &.1215176334476067D+11,.1519764492169999D+11,.1820312504465359D+11,
  389.      &.2116750694993432D+11/
  390. c
  391.       DATA  ( SUMS(i,2,2), i= 1,7 ) /
  392.      &.3045676741897511D+08,.5718526521576222D+08,.8885029941358330D+08,
  393.      &.1174925822726987D+09,.1501582054695641D+09,.1819691693283694D+09,
  394.      &.2130649341195080D+09/
  395. c
  396.       DATA  ( SUMS(i,3,2), i= 1,7 ) /
  397.      &.2547733008933910D+07,.5131714230651644D+07,.7946120246231201D+07,
  398.      &.1008019578807808D+08,.1269997234773526D+08,.1504905863862026D+08,
  399.      &.1721399839433381D+08/
  400.       END
  401. C
  402. C***********************************************
  403.       SUBROUTINE INDEX
  404. C***********************************************
  405. C
  406. C       MODULE     PURPOSE
  407. C       ------     -----------------------------------------------
  408. C       IQRANF     computes a vector of pseudo-random indices
  409. C
  410. C       KERNEL     executes 24 samples of Fortran computation
  411. C
  412. C       PFM        optional call to system hardware performance monitor
  413. C
  414. C       REPORT     prints timing results
  415. C
  416. C       RESULT     computes execution rates  into pushdown store
  417. C
  418. C       SECOND     cumulative CPU time for task in seconds (MKS units)
  419. C
  420. C       SENSIT     sensitivity analysis of harmonic mean to 49 workloads
  421. C
  422. C       SIGNAL     generates a set of floating-point numbers near 1.0
  423. C
  424. C       SIMD       sensitivity analysis of harmonic mean to SISD/SIMD model
  425. C
  426. C       SIZES      test and set the loop controls before each kernel test
  427. C
  428. C       SORDID     simple sort
  429. C
  430. C       SPACE      sets memory pointers for array variables.  optional.
  431. C
  432. C       STATS      calculates unweighted statistics
  433. C
  434. C       STATW      calculates   weighted statistics
  435. C
  436. C       SUMO       check-sum with ordinal dependency
  437. C
  438. C       SUPPLY     initializes common blocks containing type real arrays.
  439. C
  440. C       TALLY      computes average and minimum Cpu timings and variances.
  441. C
  442. C       TDIGIT     counts lead digits followed by trailing zeroes
  443. C
  444. C       TEST       times, tests, and initializes each kernel test
  445. C
  446. C       TICK       measures timing overhead of subroutine test
  447. C
  448. C       TILE       computes  m-tile value and corresponding index
  449. C
  450. C       TRACKS,TRACKX   push/pop caller's name and serial nr. in /DEBUG/
  451. C
  452. C       TRAP       checks that index-list values are in valid domain
  453. C
  454. C       VALID      compresses valid timing results
  455. C
  456. C       VALUES     initializes special values
  457. C
  458. C       VERIFY     verifies sufficient Loop size versus cpu clock accuracy
  459. C       ------     -----------------------------------------------
  460. c
  461. c  ------------ -------- -------- -------- -------- -------- --------
  462. c  ENTRY LEVELS:   1        2        3        4        5        6
  463. c  ------------ -------- -------- -------- -------- -------- --------
  464. c               MAIN.    SECOND
  465. c                        VERIFY   SECOND
  466. c                                 SIZES
  467. c                                 STATS    SQRT
  468. c                                 TDIGIT   LOG10
  469. c                        SIZES
  470. c
  471. c                        TICK     TEST     SECOND
  472. c                                          SIZES
  473. c                                          SUMO
  474. c                                          VALUES   SUPPLY   SIGNAL
  475. c                                                   IQRANF   MOD
  476. c                                 VALID    TRAP              TRAP
  477. c                                 STATS    SQRT
  478. c                                 IQRANF   MOD
  479. c                                          TRAP
  480. c                        KERNEL   SPACE
  481. c                                 SQRT
  482. c                                 EXP
  483. c                                 TEST     SECOND
  484. c                                          SIZES
  485. c                                          SUMO
  486. c                                          VALUES   SUPPLY   SIGNAL
  487. c                                                   IQRANF   MOD
  488. c                        RESULT   TALLY    SIZES             TRAP
  489. c                                          PAGE
  490. c                                          STATS    SQRT
  491. c                                 LOG10
  492. c
  493. c                        REPORT   VALID    TRAP
  494. c                                 MOD
  495. c                                 STATW    SORDID   TRAP
  496. c                                          TILE
  497. c                                          SQRT
  498. c                                          LOG10
  499. c                                 PAGE
  500. c                                 TRAP
  501. c                                 SENSIT   VALID    TRAP
  502. c                                          SORDID   TRAP
  503. c                                          PAGE
  504. c                                          STATW    SORDID   TRAP
  505. c                                                   TILE
  506. c                                 SIMD     VALID    TRAP
  507. c                                          STATW    SORDID   TRAP
  508. c                                                   TILE
  509. C                        STOP
  510. C
  511. C
  512. C
  513. C
  514. C
  515. C
  516. C
  517. C
  518. C
  519. C
  520. C
  521. C
  522. c    ------ ---- ------     -----   ------------------------------------
  523. c    BASE   TYPE CLASS      NAME    GLOSSARY
  524. c    ------ ---- ------     -----   ------------------------------------
  525. c    SPACE0    R Array      BIAS  - scale factors for SIGNAL data generator
  526. c    SPACE0    R Array      CSUM  - checksums of KERNEL result arrays
  527. c    BETA      R Array      CSUMS - sets of CSUM for all test runs
  528. c    BETA      R Array      DOS   - sets of TOTAL flops for all test runs
  529. c    SPACE0    R Array      FLOPN - flop counts for one execution pass
  530. c    BETA      R Array      FOPN  - sets of FLOPN for all test runs
  531. c    SPACE0    R Array      FR    - vectorisation fractions; abscissa for REPORT
  532. c    SPACES    I scalar     ibuf  - flag enables one call to SIGNAL
  533. c    ALPHA     I scalar     ik    - current number of executing kernel
  534. c    ALPHA     I scalar     il    - selects one of three sets of loop spans
  535. c    SPACES    I scalar     ion   - logical I/O unit number for output
  536. c    SPACEI    I Array      IPASS - Loop control limits for multiple-pass loops
  537. c    SPACE0    I Array      IQ    - set of workload weights for REPORT
  538. c    SPACEI    I Array      ISPAN - loop control limits for each kernel
  539. c    SPACES    I scalar     it    - flags timing call to TEST from TICK
  540. c    SPACES    I scalar     j5    - datum in kernel 16
  541. c    ALPHA     I scalar     jr    - current test run number (1 thru 7)
  542. c    SPACES    I scalar     k2    - counter in kernel 16
  543. c    SPACES    I scalar     k3    - counter in kernel 16
  544. c    SPACES    I scalar     kr    - a copy of mk
  545. c    SPACES    I scalar     Loop  - current multiple-pass loop limit in KERNEL
  546. c    SPACES    I scalar     MULTI - Multiplier used to compute Loop in SIZES
  547. c    SPACES    I scalar     m     - temp integer datum
  548. c    ALPHA     I scalar     mk    - number of kernels to evaluate .LE.24
  549. c    ALPHA     I scalar     ml    - maximum value of il=  3
  550. c    SPACEI    I Array      MUL   - multipliers * IPASS defines Loop
  551. c    SPACES    I scalar     n     - current DO loop limit in KERNEL
  552. c    SPACES    I scalar     n1    - dimension of most 1-D arrays
  553. c    SPACES    I scalar     n13   - dimension used in kernel 13
  554. c    SPACES    I scalar     n13h  - dimension used in kernel 13
  555. c    SPACES    I scalar     n14   - dimension used in kernel 14
  556. c    SPACES    I scalar     n16   - dimension used in kernel 16
  557. c    SPACES    I scalar     n2    - dimension of most 2-D arrays
  558. c    SPACES    I scalar     n21   - dimension used in kernel 21
  559. c    SPACES    I scalar     n213  - dimension used in kernel 21
  560. c    SPACES    I scalar     n416  - dimension used in kernel 16
  561. c    SPACES    I scalar     n813  - dimension used in kernel 13
  562. c    SPACE0    I scalar     npf   - temp integer datum
  563. c    ALPHA     I Array      NPFS  - sets of NPFS1 for all test runs
  564. c    SPACE0    I Array      NPFS1 - number of page-faults for each kernel
  565. c    ALPHA     I scalar     Nruns - number of complete test runs
  566. c    SPACES    I scalar     nt1   - total size of common -SPACE1- words
  567. c    SPACES    I scalar     nt2   - total size of common -SPACE2- words
  568. c    BETA      R Array      SEE   - (i,1,jr,il) sets of TEST overhead times
  569. c    BETA      R Array      SEE   - (i,2,jr,il) sets of csums of SPACE1
  570. c    BETA      R Array      SEE   - (i,3,jr,il) sets of csums of SPACE2
  571. c    SPACE0    R Array      SKALE - scale factors for SIGNAL data generator
  572. c    SPACE0    R scalar     start - temp start time of each kernel
  573. c    PROOF     R Array      SUMS  - sets of verified checksums for all test runs
  574. c    SPACE0    R Array      SUMW  - set of quartile weights for REPORT
  575. c    SPACE0    R Array      TERR1 - overhead-time errors for each kernel
  576. c    BETA      R Array      TERRS - sets of TERR1 for all runs
  577. c    BETA      R scalar     tic   - minimum cpu clock time= resolution
  578. c    SPACE0    R scalar     ticks - average overhead time in TEST linkage
  579. c    SPACE0    R Array      TIME  - net execution times for all kernels
  580. c    BETA      R Array      TIMES - sets of TIME for all test runs
  581. c    SPACE0    R Array      TOTAL - total flops computed by each kernel
  582. c    SPACE0    R Array      WS    - unused
  583. c    SPACE0    R Array      WT    - weights for each kernel sample
  584. c    SPACEI    R Array      WTP   - weights for the 3 span-varying passes
  585. c    SPACE0    R Array      WW    - unused
  586. C
  587. C
  588. c  --------- -----------------------------------------------------------------
  589. c   COMMON   Usage
  590. c  --------- -----------------------------------------------------------------
  591. C
  592. C   /ALPHA /
  593. C            VERIFY    TICK      TALLY     SIZES     RESULT    REPORT    KERNEL
  594. C            MAIN.
  595. C   /BASE1 /
  596. C            SUPPLY
  597. C   /BASE2 /
  598. C            SUPPLY
  599. C   /BASER /
  600. C            SUPPLY
  601. C   /BETA  /
  602. C            TICK      TALLY     SIZES     RESULT    REPORT    KERNEL
  603. C   /DEBUG /
  604. C            TRACKS    TRACKX    TRAP
  605. C   /ORDER /
  606. C            TRACKS    TRACKX    TRAP
  607. C   /PROOF /
  608. C            RESULT    BLOCKDATA
  609. C   /SPACE0/
  610. C            VALUES    TICK      TEST      TALLY     SUPPLY    SIZES     RESULT
  611. C            REPORT    KERNEL    BLOCKDATA
  612. C   /SPACE1/
  613. C            VERIFY    VALUES    TICK      TEST      SUPPLY    SPACE     KERNEL
  614. C   /SPACE2/
  615. C            VERIFY    VALUES    TICK      TEST      SUPPLY    SPACE     KERNEL
  616. C   /SPACE3/
  617. C            VALUES
  618. C   /SPACEI/
  619. C            VERIFY    VALUES    TICK      TEST      SIZES     RESULT    REPORT
  620. C            KERNEL    BLOCKDATA
  621. C   /SPACER/
  622. C            VALUES    TICK      TEST      SUPPLY    SIZES     KERNEL
  623. C   /SPACES/
  624. C            VERIFY    VALUES    TICK      TEST      SUPPLY    SIZES     KERNEL
  625. C            BLOCKDATA
  626. c  --------- -----------------------------------------------------------------
  627.       RETURN
  628.       END
  629. C
  630. C
  631. C***************************************
  632.       SUBROUTINE IQRANF( M, Mmin,Mmax, n)
  633. C***********************************************************************
  634. C                                                                      *
  635. c     IQRANF  - computes a vector of psuedo-random indices             *
  636. c               in the domain (Mmin,Mmax)                              *
  637. C                                                                      *
  638. C     M     - result array ,  psuedo-random positive integers          *
  639. C     Mmin  - input integer,  lower bound for random integers          *
  640. C     Mmax  - input integer,  upper bound for random integers          *
  641. C     n     - input integer,  number of results in M.                  *
  642. C                                                                      *
  643. C       M(i)= Mmin + INT( (Mmax-Mmin) * RANF(0))                       *
  644. C                                                                      *
  645. c        CALL IQRANF( IX, 1,1001, 30)      should produce in IX:       *
  646. c           3  674  435  415  389   54   44  790  900  282             *
  647. c         177  971  728  851  687  604  815  971  155  112             *
  648. c         877  814  779  192  619  894  544  404  496  505  ...        *
  649. C                                                                      *
  650. C***********************************************************************
  651. C
  652. cANSI IMPLICIT  DOUBLE PRECISION (A-H,K,O-Z)
  653. cIBM  IMPLICIT  REAL*8           (A-H,K,O-Z)
  654.       DOUBLE PRECISION  dq, dp, per, dk, spin, span
  655. C
  656.       dimension  M(n)
  657.       save k
  658.       CALL TRACKS('IQRANF  ')
  659.             IF( n.LE.0 )  GO TO 73
  660.          inset= Mmin
  661.           span= Mmax - Mmin
  662. c         spin= 16807.00D0
  663. c          per= 2147483647.00D0
  664.           spin= 16807
  665.            per= 2147483647
  666.          realn= n
  667.          scale= 1.0000100D0
  668.              q= scale*(span/realn)
  669. C
  670.             dk= k
  671.       DO  1  i= 1,n
  672.             dp= dk*spin
  673. c           dk=    DMOD( dp, per)
  674.             dk= dp -INT( dp/per)*per
  675.             dq= dk*span
  676.           M(i)= inset + ( dq/ per)
  677.             IF( M(i).LT.Mmin .OR. M(i).GT.Mmax )  M(i)= inset + i*q
  678.     1 continue
  679.              k= dk
  680. C
  681. C
  682. ciC     double precision  k, ip, iq, id
  683. ci         inset= Mmin
  684. ci         ispan= Mmax - Mmin
  685. ci         ispin= 16807
  686. ci            id= 2147483647
  687. ci             q= (REAL(ispan)/REAL(n))*1.00001
  688. ciC
  689. ci      DO  2  i= 1,n
  690. ci            ip= k*ispin
  691. ci             k=      MOD( ip, id)
  692. ci            iq= k*ispan
  693. ci          M(i)= inset + ( iq/ id)
  694. ci            IF( M(i).LT.Mmin .OR. M(i).GT.Mmax )  M(i)= inset + i*q
  695. ci    2 continue
  696. C
  697.       CALL TRAP( M, 8H IQRANF  , 1, Mmax, n)
  698. C
  699.    73 CONTINUE
  700.       CALL TRACKX
  701.       RETURN
  702.       DATA  k /256/
  703.       END
  704. C***********************************************
  705.       SUBROUTINE KERNEL
  706. C***********************************************************************
  707. C                                                                      *
  708. C            KERNEL     executes 24 samples of Fortran computation     *
  709. C                                                                      *
  710. C***********************************************************************
  711. C                                                                      *
  712. C     L. L. N. L.   F O R T R A N   K E R N E L S:   M F L O P S       *
  713. C                                                                      *
  714. C     These kernels measure  Fortran  numerical computation            *
  715. C     rates for  a  spectrum  of  cpu-limited computational            *
  716. C     structures or benchmarks.   Mathematical  through-put            *
  717. C     is measured  in  units  of millions of floating-point            *
  718. C     operations executed per second, called Megaflops/sec.            *
  719. C                                                                      *
  720. C     Fonzi's Law: There is not now and there never will be a language *
  721. C                  in which it is the least bit difficult to write     *
  722. C                  bad programs.                                       *
  723. C                                                    F.H.MCMAHON  1972 *
  724. C***********************************************************************
  725. C
  726. C     l1 :=  param-dimension governs the size of most 1-d arrays
  727. C     l2 :=  param-dimension governs the size of most 2-d arrays
  728. C
  729. C     Loop :=  multiple pass control to execute kernel long enough to time.
  730. C     n  :=  DO loop control for each kernel.  Controls are set in subr. SIZES
  731. C
  732. C     ******************************************************************
  733. C
  734. cANSI IMPLICIT  DOUBLE PRECISION (A-H,O-Z)
  735. cIBM  IMPLICIT  REAL*8           (A-H,O-Z)
  736. C
  737. C/      PARAMETER( l1= 1001, l2=  101, l1d= 2*1001 )
  738. C/      PARAMETER( l13=  64, l13h= l13/2, l213= l13+l13h, l813= 8*l13 )
  739. C/      PARAMETER( l14=2048, l16=  75, l416= 4*l16 , l21= 25 )
  740. C/      PARAMETER( kn= 47, kn2= 95, np= 3, ls= 3*47, krs= 24)
  741. C
  742. C
  743. C/      PARAMETER( nk= 47, nl= 3, nr= 8 )
  744. C
  745.       COMMON /ALPHA/ mk,ik,ml,il,Nruns,jr, NPFS(8,3,47)
  746.       COMMON /BETA / tic, TIMES(8,3,47), SEE(5,3,8,3),
  747.      1              TERRS(8,3,47), CSUMS(8,3,47),
  748.      2              FOPN(8,3,47), DOS(8,3,47)
  749. C
  750.       COMMON /SPACES/ ion,j5,k2,k3,MULTI,Loop,m,kr,it,n13h,ibuf,
  751.      1                n,n1,n2,n13,n213,n813,n14,n16,n416,n21,nt1,nt2
  752. C
  753.       COMMON /SPACER/ A11,A12,A13,A21,A22,A23,A31,A32,A33,
  754.      2                AR,BR,C0,CR,DI,DK,
  755.      3  DM22,DM23,DM24,DM25,DM26,DM27,DM28,DN,E3,E6,EXPMAX,FLX,
  756.      4  Q,QA,R,RI,S,SCALE,SIG,STB5,T,XNC,XNEI,XNM
  757. C
  758.       COMMON /SPACE0/ TIME(47), CSUM(47), WW(47), WT(47), ticks,
  759.      1                FR(9), TERR1(47), SUMW(7), START,
  760.      2              SKALE(47), BIAS(47), WS(95), TOTAL(47), FLOPN(47),
  761.      3                IQ(7), NPF, NPFS1(47)
  762. C
  763.       COMMON /SPACEI/ WTP(3), MUL(3), ISPAN(47,3), IPASS(47,3)
  764. C
  765. C/      INTEGER    E,F,ZONE
  766. C/      COMMON /ISPACE/ E(l213), F(l213),
  767. C/     1  IX(l1), IR(l1), ZONE(l416)
  768. C/C
  769. C/      COMMON /SPACE1/ U(l1), V(l1), W(l1),
  770. C/     1  X(l1), Y(l1), Z(l1), G(l1),
  771. C/     2  DU1(l2), DU2(l2), DU3(l2), GRD(l1), DEX(l1),
  772. C/     3  XI(l1), EX(l1), EX1(l1), DEX1(l1),
  773. C/     4  VX(l14), XX(l14), RX(l14), RH(l14),
  774. C/     5  VSP(l2), VSTP(l2), VXNE(l2), VXND(l2),
  775. C/     6  VE3(l2), VLR(l2), VLIN(l2), B5(l2),
  776. C/     7  PLAN(l416), D(l416), SA(l2), SB(l2)
  777. C/C
  778. C/      COMMON /SPACE2/ P(4,l813), PX(l21,l2), CX(l21,l2),
  779. C/     1  VY(l2,l21), VH(l2,7), VF(l2,7), VG(l2,7), VS(l2,7),
  780. C/     2  ZA(l2,7)  , ZP(l2,7), ZQ(l2,7), ZR(l2,7), ZM(l2,7),
  781. C/     3  ZB(l2,7)  , ZU(l2,7), ZV(l2,7), ZZ(l2,7),
  782. C/     4  B(l13,l13), C(l13,l13), H(l13,l13),
  783. C/     5  U1(5,l2,2),  U2(5,l2,2),  U3(5,l2,2)
  784. C
  785. C     ******************************************************************
  786. C
  787. C
  788. C/      PARAMETER( l1=   1001, l2=   101, l1d= 2*1001 )
  789. C/      PARAMETER( l13= 64, l13h= 64/2, l213= 64+32, l813= 8*64 )
  790. C/      PARAMETER( l14= 2048, l16= 75, l416= 4*75 , l21= 25)
  791. C
  792. C
  793. care
  794. C
  795.       INTEGER    E,F,ZONE
  796.       COMMON /ISPACE/ E(96), F(96),
  797.      1  IX(1001), IR(1001), ZONE(300)
  798. C
  799.       COMMON /SPACE1/ U(1001), V(1001), W(1001),
  800.      1  X(1001), Y(1001), Z(1001), G(1001),
  801.      2  DU1(101), DU2(101), DU3(101), GRD(1001), DEX(1001),
  802.      3  XI(1001), EX(1001), EX1(1001), DEX1(1001),
  803.      4  VX(1001), XX(1001), RX(1001), RH(2048),
  804.      5  VSP(101), VSTP(101), VXNE(101), VXND(101),
  805.      6  VE3(101), VLR(101), VLIN(101), B5(101),
  806.      7  PLAN(300), D(300), SA(101), SB(101)
  807. C
  808.       COMMON /SPACE2/ P(4,512), PX(25,101), CX(25,101),
  809.      1  VY(101,25), VH(101,7), VF(101,7), VG(101,7), VS(101,7),
  810.      2  ZA(101,7)  , ZP(101,7), ZQ(101,7), ZR(101,7), ZM(101,7),
  811.      3  ZB(101,7)  , ZU(101,7), ZV(101,7), ZZ(101,7),
  812.      4  B(64,64), C(64,64), H(64,64),
  813.      5  U1(5,101,2),  U2(5,101,2),  U3(5,101,2)
  814. C
  815. C     ******************************************************************
  816. C
  817.       DIMENSION       XZ(2001), ZX(2001)
  818.       EQUIVALENCE   ( XZ(1), X(1)), ( ZX(1), Z(1))
  819. C
  820. C
  821. C//      DIMENSION       E(96), F(96), U(1001), V(1001), W(1001),
  822. C//     1  X(1001), Y(1001), Z(1001), G(1001),
  823. C//     2  DU1(101), DU2(101), DU3(101), GRD(1001), DEX(1001),
  824. C//     3  IX(1001), XI(1001), EX(1001), EX1(1001), DEX1(1001),
  825. C//     4  VX(1001), XX(1001), IR(1001), RX(1001), RH(2048),
  826. C//     5  VSP(101), VSTP(101), VXNE(101), VXND(101),
  827. C//     6  VE3(101), VLR(101), VLIN(101), B5(101),
  828. C//     7  PLAN(300), ZONE(300), D(300), SA(101), SB(101)
  829. C//C
  830. C//      DIMENSION       P(4,512), PX(25,101), CX(25,101),
  831. C//     1  VY(101,25), VH(101,7), VF(101,7), VG(101,7), VS(101,7),
  832. C//     2  ZA(101,7)  , ZP(101,7), ZQ(101,7), ZR(101,7), ZM(101,7),
  833. C//     3  ZB(101,7)  , ZU(101,7), ZV(101,7), ZZ(101,7),
  834. C//     4  B(64,64), C(64,64), H(64,64),
  835. C//     5  U1(5,101,2),  U2(5,101,2),  U3(5,101,2)
  836. C//C
  837. C//C     ******************************************************************
  838. C//C
  839. C//      COMMON /POINT/ ME,MF,MU,MV,MW,MX,MY,MZ,MG,MDU1,MDU2,MDU3,MGRD,
  840. C//     1  MDEX,MIX,MXI,MEX,MEX1,MDEX1,MVX,MXX,MIR,MRX,MRH,MVSP,MVSTP,
  841. C//     2  MVXNE,MVXND,MVE3,MVLR,MVLIN,MB5,MPLAN,MZONE,MD,MSA,MSB,
  842. C//     3  MP,MPX,MCX,MVY,MVH,MVF,MVG,MVS,MZA,MZP,MZQ,MZR,MZM,MZB,MZU,
  843. C//     4  MZV,MZZ,MB,MC,MH,MU1,MU2,MU3
  844. C//C
  845. C//      POINTER  (ME,E), (MF,F), (MU,U), (MV,V), (MW,W),
  846. C//     1         (MX,X), (MY,Y), (MZ,Z), (MG,G),
  847. C//     2         (MDU1,DU1),(MDU2,DU2),(MDU3,DU3),(MGRD,GRD),(MDEX,DEX),
  848. C//     3         (MIX,IX), (MXI,XI), (MEX,EX), (MEX1,EX1), (MDEX1,DEX1),
  849. C//     4         (MVX,VX), (MXX,XX), (MIR,IR), (MRX,RX), (MRH,RH),
  850. C//     5         (MVSP,VSP), (MVSTP,VSTP), (MVXNE,VXNE), (MVXND,VXND),
  851. C//     6         (MVE3,VE3), (MVLR,VLR), (MVLIN,VLIN), (MB5,B5),
  852. C//     7         (MPLAN,PLAN), (MZONE,ZONE), (MD,D), (MSA,SA), (MSB,SB)
  853. C//C
  854. C//      POINTER  (MP,P), (MPX,PX), (MCX,CX),
  855. C//     1         (MVY,VY), (MVH,VH), (MVF,VF), (MVG,VG), (MVS,VS),
  856. C//     2         (MZA,ZA), (MZP,ZP), (MZQ,ZQ), (MZR,ZR), (MZM,ZM),
  857. C//     3         (MZB,ZB), (MZU,ZU), (MZV,ZV), (MZZ,ZZ),
  858. C//     4         (MB,B), (MC,C), (MH,H),
  859. C//     5         (MU1,U1), (MU2,U2), (MU3,U3)
  860. C..      COMMON DUMMY(2000)
  861. C..      LOC(X)  =.LOC.X
  862. C..      IQ8QDSP = 64*LOC(DUMMY)
  863. C
  864. C     ******************************************************************
  865. C
  866. C     STANDARD PRODUCT COMPILER DIRECTIVES MAY BE USED FOR OPTIMIZATION
  867. C
  868. CDIR$ VECTOR
  869. CLLL. OPTIMIZE LEVEL i
  870. CLLL. OPTION INTEGER (7)
  871. CLLL. OPTION ASSERT (NO HAZARD)
  872. CLLL. OPTION NODYNEQV
  873. C
  874. C     ******************************************************************
  875. C       BINARY MACHINES MAY USE THE  AND(P,Q)  FUNCTION IF AVAILABLE
  876. C       IN PLACE OF THE FOLLOWING CONGRUENCE FUNCTION (SEE KERNEL 13, 14)
  877. C
  878. c     IAND(j,k) = AND(j,k)
  879. CLLL. IAND(j,k) = j.INT.k
  880. c     MOD2N(i,j)= MOD(i,j)
  881.       MOD2N(i,j)= IAND(i,j-1)
  882. C                             i  is Congruent to  MOD2N(i,j)   mod(j)
  883. C     ******************************************************************
  884. C
  885. C
  886. C
  887. C
  888. C
  889. C
  890.       CALL TRACKS('KERNEL  ')
  891. C
  892.       CALL SPACE
  893. C
  894. cLLNL      call  PFM( 0, ion)
  895.       CALL TEST(0)
  896. C
  897. C*******************************************************************************
  898. C***  KERNEL 1      HYDRO FRAGMENT
  899. C*******************************************************************************
  900. C
  901.          DO 1 L = 1,Loop
  902.          DO 1 k = 1,n
  903.     1       X(k)= Q + Y(k)*(R*ZX(k+10) + T*ZX(k+11))
  904. C
  905. C...................
  906.       CALL TEST(1)
  907. C
  908. C*******************************************************************************
  909. C***  KERNEL 2      ICCG EXCERPT (INCOMPLETE CHOLESKY - CONJUGATE GRADIENT)
  910. C*******************************************************************************
  911. C
  912.       DO 200  L= 1,Loop
  913.           II= n
  914.        IPNTP= 0
  915.   222   IPNT= IPNTP
  916.        IPNTP= IPNTP+II
  917.           II= II/2
  918.            i= IPNTP
  919. CDIR$ IVDEP
  920. C
  921.       DO 2 k= IPNT+2,IPNTP,2
  922.            i= i+1
  923.     2   X(i)= X(k) - V(k)*X(k-1) - V(k+1)*X(k+1)
  924.           IF( II.GT.1) GO TO 222
  925.   200 CONTINUE
  926. C
  927. C...................
  928.       CALL TEST(2)
  929. C
  930. C*******************************************************************************
  931. C***  KERNEL 3      INNER PRODUCT
  932. C*******************************************************************************
  933. C
  934.       DO 3 L= 1,Loop
  935.            Q= 0.000D0
  936.       DO 3 k= 1,n
  937.     3      Q= Q + Z(k)*X(k)
  938. C
  939. C...................
  940.       CALL TEST(3)
  941. C
  942. C
  943. C
  944. C*******************************************************************************
  945. C***  KERNEL 4      BANDED LINEAR EQUATIONS
  946. C*******************************************************************************
  947. C
  948.               m= (1001-7)/2
  949.       DO 444  L= 1,Loop
  950.       DO 444  k= 7,1001,m
  951.              lw= k-6
  952.            temp= X(k-1)
  953. CDIR$ IVDEP
  954.       DO   4  j= 5,n,5
  955.          temp  = temp   - XZ(lw)*Y(j)
  956.     4        lw= lw+1
  957.          X(k-1)= Y(5)*temp
  958.  444  CONTINUE
  959. C
  960. C...................
  961.       CALL TEST(4)
  962. C
  963. C*******************************************************************************
  964. C***  KERNEL 5      TRI-DIAGONAL ELIMINATION, BELOW DIAGONAL (NO VECTORS)
  965. C*******************************************************************************
  966. C
  967.       DO 5 L = 1,Loop
  968. CDIR$ NOVECTOR
  969.       DO 5 i = 2,n
  970.     5    X(i)= Z(i)*(Y(i) - X(i-1))
  971. CDIR$ VECTOR
  972. C
  973. C...................
  974.       CALL TEST(5)
  975. C
  976. C*******************************************************************************
  977. C***  KERNEL 6      GENERAL LINEAR RECURRENCE EQUATIONS
  978. C*******************************************************************************
  979. C
  980.       DO  6  L= 1,Loop
  981.       DO  6  i= 2,n
  982. C         W(i)= 0.0100D0              use only if overflow occurs
  983.       DO  6  k= 1,i-1
  984.           W(i)= W(i)  + B(i,k) * W(i-k)
  985.     6 CONTINUE
  986. C
  987. C...................
  988.       CALL TEST(6)
  989. C
  990. C*******************************************************************************
  991. C***  KERNEL 7      EQUATION OF STATE FRAGMENT
  992. C*******************************************************************************
  993. C
  994.       DO 7 L= 1,Loop
  995.       DO 7 k= 1,n
  996.         X(k)=     U(k  ) + R*( Z(k  ) + R*Y(k  )) +
  997.      .        T*( U(k+3) + R*( U(k+2) + R*U(k+1)) +
  998.      .        T*( U(k+6) + R*( U(k+5) + R*U(k+4))))
  999.     7 CONTINUE
  1000. C
  1001. C...................
  1002.       CALL TEST(7)
  1003. C
  1004. C
  1005. C*******************************************************************************
  1006. C***  KERNEL 8      A.D.I. INTEGRATION
  1007. C*******************************************************************************
  1008. C
  1009.       DO  8      L = 1,Loop
  1010.                nl1 = 1
  1011.                nl2 = 2
  1012.                 fw= 2.000D0
  1013.       DO  8     kx = 2,3
  1014. CDIR$ IVDEP
  1015.       DO  8     ky = 2,n
  1016.             DU1(ky)=U1(kx,ky+1,nl1)  -  U1(kx,ky-1,nl1)
  1017.             DU2(ky)=U2(kx,ky+1,nl1)  -  U2(kx,ky-1,nl1)
  1018.             DU3(ky)=U3(kx,ky+1,nl1)  -  U3(kx,ky-1,nl1)
  1019.       U1(kx,ky,nl2)=U1(kx,ky,nl1) +A11*DU1(ky) +A12*DU2(ky) +A13*DU3(ky)
  1020.      .       + SIG*(U1(kx+1,ky,nl1) -fw*U1(kx,ky,nl1) +U1(kx-1,ky,nl1))
  1021.       U2(kx,ky,nl2)=U2(kx,ky,nl1) +A21*DU1(ky) +A22*DU2(ky) +A23*DU3(ky)
  1022.      .       + SIG*(U2(kx+1,ky,nl1) -fw*U2(kx,ky,nl1) +U2(kx-1,ky,nl1))
  1023.       U3(kx,ky,nl2)=U3(kx,ky,nl1) +A31*DU1(ky) +A32*DU2(ky) +A33*DU3(ky)
  1024.      .       + SIG*(U3(kx+1,ky,nl1) -fw*U3(kx,ky,nl1) +U3(kx-1,ky,nl1))
  1025.     8 CONTINUE
  1026. C
  1027. C...................
  1028.       CALL TEST(8)
  1029. C
  1030. C*******************************************************************************
  1031. C***  KERNEL 9      INTEGRATE PREDICTORS
  1032. C*******************************************************************************
  1033. C
  1034.       DO 9  L = 1,Loop
  1035.       DO 9  i = 1,n
  1036.       PX( 1,i)= DM28*PX(13,i) + DM27*PX(12,i) + DM26*PX(11,i) +
  1037.      .          DM25*PX(10,i) + DM24*PX( 9,i) + DM23*PX( 8,i) +
  1038.      .          DM22*PX( 7,i) +  C0*(PX( 5,i) +      PX( 6,i))+ PX( 3,i)
  1039.     9 CONTINUE
  1040. C
  1041. C...................
  1042.       CALL TEST(9)
  1043. C
  1044. C*******************************************************************************
  1045. C***  KERNEL 10     DIFFERENCE PREDICTORS
  1046. C*******************************************************************************
  1047. C
  1048.       DO 10  L= 1,Loop
  1049.       DO 10  i= 1,n
  1050.       AR      =      CX(5,i)
  1051.       BR      = AR - PX(5,i)
  1052.       PX(5,i) = AR
  1053.       CR      = BR - PX(6,i)
  1054.       PX(6,i) = BR
  1055.       AR      = CR - PX(7,i)
  1056.       PX(7,i) = CR
  1057.       BR      = AR - PX(8,i)
  1058.       PX(8,i) = AR
  1059.       CR      = BR - PX(9,i)
  1060.       PX(9,i) = BR
  1061.       AR      = CR - PX(10,i)
  1062.       PX(10,i)= CR
  1063.       BR      = AR - PX(11,i)
  1064.       PX(11,i)= AR
  1065.       CR      = BR - PX(12,i)
  1066.       PX(12,i)= BR
  1067.       PX(14,i)= CR - PX(13,i)
  1068.       PX(13,i)= CR
  1069.    10 CONTINUE
  1070. C
  1071. C...................
  1072.       CALL TEST(10)
  1073. C
  1074. C*******************************************************************************
  1075. C***  KERNEL 11     FIRST SUM.   PARTIAL SUMS.              (NO VECTORS)
  1076. C*******************************************************************************
  1077. C
  1078.             fw= 1.000D-25
  1079.       DO 11 L = 1,Loop
  1080. C         Y(1)= Y(1) + L*fw   use only if optimization eliminates L-loop.
  1081.           X(1)= Y(1)
  1082. CDIR$ NOVECTOR
  1083.       DO 11 k = 2,n
  1084.    11     X(k)= X(k-1) + Y(k)
  1085. CDIR$ VECTOR
  1086. C
  1087. C...................
  1088.       CALL TEST(11)
  1089. C
  1090. C*******************************************************************************
  1091. C***  KERNEL 12     FIRST DIFF.
  1092. C*******************************************************************************
  1093. C
  1094.             fw= 1.000D-25
  1095.       DO 12 L = 1,Loop
  1096. C         Y(1)= Y(1) + L*fw   use only if optimization eliminates L-loop.
  1097.       DO 12 k = 1,n
  1098.    12     X(k)= Y(k+1) - Y(k)
  1099. C
  1100. C...................
  1101.       CALL TEST(12)
  1102. C
  1103. C*******************************************************************************
  1104. C***  KERNEL 13      2-D PIC   Particle In Cell
  1105. C*******************************************************************************
  1106. C
  1107.                 fw= 1.000D0
  1108.       DO  13     L= 1,Loop
  1109.       DO  13    ip= 1,n
  1110.                 i1= P(1,ip)
  1111.                 j1= P(2,ip)
  1112.                 i1=        1 + MOD2N(i1,64)
  1113.                 j1=        1 + MOD2N(j1,64)
  1114.            P(3,ip)= P(3,ip)  + B(i1,j1)
  1115.            P(4,ip)= P(4,ip)  + C(i1,j1)
  1116.            P(1,ip)= P(1,ip)  + P(3,ip)
  1117.            P(2,ip)= P(2,ip)  + P(4,ip)
  1118.                 i2= P(1,ip)
  1119.                 j2= P(2,ip)
  1120.                 i2=            MOD2N(i2,64)
  1121.                 j2=            MOD2N(j2,64)
  1122.            P(1,ip)= P(1,ip)  + Y(i2+32)
  1123.            P(2,ip)= P(2,ip)  + Z(j2+32)
  1124.                 i2= i2       + E(i2+32)
  1125.                 j2= j2       + F(j2+32)
  1126.           H(i2,j2)= H(i2,j2) + fw
  1127.    13 CONTINUE
  1128. C
  1129. C...................
  1130.       CALL TEST(13)
  1131. C
  1132. C*******************************************************************************
  1133. C***  KERNEL 14      1-D PIC   Particle In Cell
  1134. C*******************************************************************************
  1135. C
  1136. C
  1137.                fw= 1.000D0
  1138.       DO   14   L= 1,Loop
  1139.       DO   141  k= 1,n
  1140.             VX(k)= 0.0
  1141.             XX(k)= 0.0
  1142.             IX(k)= INT(  GRD(k))
  1143.             XI(k)= REAL( IX(k))
  1144.            EX1(k)= EX   ( IX(k))
  1145.           DEX1(k)= DEX  ( IX(k))
  1146.  141  CONTINUE
  1147. C
  1148.       DO   142  k= 1,n
  1149.             VX(k)= VX(k) + EX1(k) + (XX(k) - XI(k))*DEX1(k)
  1150.             XX(k)= XX(k) + VX(k)  + FLX
  1151.             IR(k)= XX(k)
  1152.             RX(k)= XX(k) - IR(k)
  1153.             IR(k)= MOD2N(  IR(k),2048) + 1
  1154.             XX(k)= RX(k) + IR(k)
  1155.  142  CONTINUE
  1156. C
  1157.       DO  14    k= 1,n
  1158.       RH(IR(k)  )= RH(IR(k)  ) + fw - RX(k)
  1159.       RH(IR(k)+1)= RH(IR(k)+1) + RX(k)
  1160.   14  CONTINUE
  1161. C
  1162. C...................
  1163.       CALL TEST(14)
  1164. C
  1165. C
  1166. C
  1167. C
  1168. C
  1169. C
  1170. C
  1171. C
  1172. C
  1173. C
  1174. C
  1175. C
  1176. C
  1177. C
  1178. C
  1179. C
  1180. C
  1181. C
  1182. C
  1183. C*******************************************************************************
  1184. C***  KERNEL 15     CASUAL FORTRAN.  DEVELOPMENT VERSION.
  1185. C*******************************************************************************
  1186. C
  1187. C
  1188. C       CASUAL ORDERING OF SCALAR OPERATIONS IS TYPICAL PRACTICE.
  1189. C       THIS EXAMPLE DEMONSTRATES THE NON-TRIVIAL TRANSFORMATION
  1190. C       REQUIRED TO MAP INTO AN EFFICIENT MACHINE IMPLEMENTATION.
  1191. C
  1192.         DO 45  L = 1,Loop
  1193.                NG= 7
  1194.                NZ= n
  1195.                AR= 0.05300D0
  1196.                BR= 0.07300D0
  1197.    15   DO 45  j = 2,NG
  1198.         DO 45  k = 2,NZ
  1199.                IF( j-NG) 31,30,30
  1200.    30     VY(k,j)= 0.0
  1201.                    GO TO 45
  1202.    31          IF( VH(k,j+1) -VH(k,j)) 33,33,32
  1203.    32           T= AR
  1204.                    GO TO 34
  1205.    33           T= BR
  1206.    34          IF( VF(k,j) -VF(k-1,j)) 35,36,36
  1207.    35           R= MAX( VH(k-1,j), VH(k-1,j+1))
  1208.                 S= VF(k-1,j)
  1209.                    GO TO 37
  1210.    36           R= MAX( VH(k,j),   VH(k,j+1))
  1211.                 S= VF(k,j)
  1212.    37     VY(k,j)= SQRT( VG(k,j)**2 +R*R)*T/S
  1213.    38          IF( k-NZ) 40,39,39
  1214.    39     VS(k,j)= 0.0
  1215.                    GO TO 45
  1216.    40          IF( VF(k,j) -VF(k,j-1)) 41,42,42
  1217.    41           R= MAX( VG(k,j-1), VG(k+1,j-1))
  1218.                 S= VF(k,j-1)
  1219.                 T= BR
  1220.                    GO TO 43
  1221.    42           R= MAX( VG(k,j),   VG(k+1,j))
  1222.                 S= VF(k,j)
  1223.                 T= AR
  1224.    43     VS(k,j)= SQRT( VH(k,j)**2 +R*R)*T/S
  1225.    45    CONTINUE
  1226. C
  1227. C...................
  1228.       CALL TEST(15)
  1229. C
  1230. C
  1231. C
  1232. C
  1233. C
  1234. C
  1235. C
  1236. C
  1237. C
  1238. C
  1239. C
  1240. C
  1241. C
  1242. C
  1243. C*******************************************************************************
  1244. C***  KERNEL 16     MONTE CARLO SEARCH LOOP
  1245. C*******************************************************************************
  1246. C
  1247.             II= n/3
  1248.             LB= II+II
  1249.             k2= 0
  1250.             k3= 0
  1251. C
  1252.       DO 485 L= 1,Loop
  1253.              m= 1
  1254.   405       i1= m
  1255.   410       j2= (n+n)*(m-1)+1
  1256.       DO 470 k= 1,n
  1257.             k2= k2+1
  1258.             j4= j2+k+k
  1259.             j5= ZONE(j4)
  1260.             IF( j5-n      ) 420,475,450
  1261.   415       IF( j5-n+II   ) 430,425,425
  1262.   420       IF( j5-n+LB   ) 435,415,415
  1263.   425       IF( PLAN(j5)-R) 445,480,440
  1264.   430       IF( PLAN(j5)-S) 445,480,440
  1265.   435       IF( PLAN(j5)-T) 445,480,440
  1266.   440       IF( ZONE(j4-1)) 455,485,470
  1267.   445       IF( ZONE(j4-1)) 470,485,455
  1268.   450       k3= k3+1
  1269.             IF( D(j5)-(D(j5-1)*(T-D(j5-2))**2+(S-D(j5-3))**2
  1270.      .                        +(R-D(j5-4))**2)) 445,480,440
  1271.   455        m= m+1
  1272.             IF( m-ZONE(1) ) 465,465,460
  1273.   460        m= 1
  1274.   465       IF( i1-m) 410,480,410
  1275.   470 CONTINUE
  1276.   475 CONTINUE
  1277.   480 CONTINUE
  1278.   485 CONTINUE
  1279. C
  1280. C...................
  1281.       CALL TEST(16)
  1282. C
  1283. C*******************************************************************************
  1284. C***  KERNEL 17     IMPLICIT, CONDITIONAL COMPUTATION       (NO VECTORS)
  1285. C*******************************************************************************
  1286. C
  1287. C         RECURSIVE-DOUBLING VECTOR TECHNIQUES CAN NOT BE USED
  1288. C         BECAUSE CONDITIONAL OPERATIONS APPLY TO EACH ELEMENT.
  1289. C
  1290.                  dw= 5.0000D0/3.0000D0
  1291.                  fw= 1.0000D0/3.0000D0
  1292.                  tw= 1.0300D0/3.0700D0
  1293. CDIR$ NOVECTOR
  1294.             DO 62 L= 1,Loop
  1295.                   i= n
  1296.                   j= 1
  1297.                 INK= -1
  1298.               SCALE= dw
  1299.                 XNM= fw
  1300.                  E6= tw
  1301.                      GO TO 61
  1302. C                                            STEP MODEL
  1303.   60             E6= XNM*VSP(i)+VSTP(i)
  1304.             VXNE(i)= E6
  1305.                 XNM= E6
  1306.              VE3(i)= E6
  1307.                   i= i+INK
  1308.                  IF( i.EQ.j) GO TO  62
  1309.   61             E3= XNM*VLR(i) +VLIN(i)
  1310.                XNEI= VXNE(i)
  1311.             VXND(i)= E6
  1312.                 XNC= SCALE*E3
  1313. C                                            SELECT MODEL
  1314.                  IF( XNM .GT.XNC) GO TO  60
  1315.                  IF( XNEI.GT.XNC) GO TO  60
  1316. C                                            LINEAR MODEL
  1317.              VE3(i)= E3
  1318.                  E6= E3+E3-XNM
  1319.             VXNE(i)= E3+E3-XNEI
  1320.                 XNM= E6
  1321.                   i= i+INK
  1322.                  IF( i.NE.j) GO TO 61
  1323.    62 CONTINUE
  1324. CDIR$ VECTOR
  1325. C
  1326. C...................
  1327.       CALL TEST(17)
  1328. C
  1329. C*******************************************************************************
  1330. C***  KERNEL 18     2-D EXPLICIT HYDRODYNAMICS FRAGMENT
  1331. C*******************************************************************************
  1332. C
  1333.          DO 75  L= 1,Loop
  1334.                 T= 0.003700D0
  1335.                 S= 0.004100D0
  1336.                KN= 6
  1337.                JN= n
  1338.          DO 70  k= 2,KN
  1339.          DO 70  j= 2,JN
  1340.           ZA(j,k)= (ZP(j-1,k+1)+ZQ(j-1,k+1)-ZP(j-1,k)-ZQ(j-1,k))
  1341.      .            *(ZR(j,k)+ZR(j-1,k))/(ZM(j-1,k)+ZM(j-1,k+1))
  1342.           ZB(j,k)= (ZP(j-1,k)+ZQ(j-1,k)-ZP(j,k)-ZQ(j,k))
  1343.      .            *(ZR(j,k)+ZR(j,k-1))/(ZM(j,k)+ZM(j-1,k))
  1344.    70    CONTINUE
  1345. C
  1346.          DO 72  k= 2,KN
  1347.          DO 72  j= 2,JN
  1348.           ZU(j,k)= ZU(j,k)+S*(ZA(j,k)*(ZZ(j,k)-ZZ(j+1,k))
  1349.      .                    -ZA(j-1,k) *(ZZ(j,k)-ZZ(j-1,k))
  1350.      .                    -ZB(j,k)   *(ZZ(j,k)-ZZ(j,k-1))
  1351.      .                    +ZB(j,k+1) *(ZZ(j,k)-ZZ(j,k+1)))
  1352.           ZV(j,k)= ZV(j,k)+S*(ZA(j,k)*(ZR(j,k)-ZR(j+1,k))
  1353.      .                    -ZA(j-1,k) *(ZR(j,k)-ZR(j-1,k))
  1354.      .                    -ZB(j,k)   *(ZR(j,k)-ZR(j,k-1))
  1355.      .                    +ZB(j,k+1) *(ZR(j,k)-ZR(j,k+1)))
  1356.    72    CONTINUE
  1357. C
  1358.          DO 75  k= 2,KN
  1359.          DO 75  j= 2,JN
  1360.           ZR(j,k)= ZR(j,k)+T*ZU(j,k)
  1361.           ZZ(j,k)= ZZ(j,k)+T*ZV(j,k)
  1362.    75    CONTINUE
  1363. C
  1364. C...................
  1365.       CALL TEST(18)
  1366. C
  1367. C*******************************************************************************
  1368. C***  KERNEL 19      GENERAL LINEAR RECURRENCE EQUATIONS    (NO VECTORS)
  1369. C*******************************************************************************
  1370. C
  1371. C                  IF( JR.GT.1 ) GO TO 192
  1372.                  KB5I= 0
  1373. CDIR$ NOVECTOR
  1374.              DO 194 L= 1,Loop
  1375.              DO 191 k= 1,n
  1376.            B5(k+KB5I)= SA(k) +STB5*SB(k)
  1377.                  STB5= B5(k+KB5I) -STB5
  1378.   191        CONTINUE
  1379. C     GO TO 194
  1380. C
  1381.   192        DO 193 i= 1,n
  1382.                     k= n-i+1
  1383.            B5(k+KB5I)= SA(k) +STB5*SB(k)
  1384.                  STB5= B5(k+KB5I) -STB5
  1385.   193        CONTINUE
  1386.   194 CONTINUE
  1387. CDIR$ VECTOR
  1388. C
  1389. C...................
  1390.       CALL TEST(19)
  1391. C
  1392. C*******************************************************************************
  1393. C***  KERNEL 20     DISCRETE ORDINATES TRANSPORT: RECURRENCE (NO VECTORS)
  1394. C*******************************************************************************
  1395. C
  1396.            dw= 0.200D0
  1397. CDIR$ NOVECTOR
  1398.       DO 20 L= 1,Loop
  1399.       DO 20 k= 1,n
  1400.            DI= Y(k)-G(k)/( XX(k)+DK)
  1401.            DN= dw
  1402.            IF( DI.NE.0.0) DN= MAX( S,MIN( Z(k)/DI, T))
  1403.          X(k)= ((W(k)+V(k)*DN)* XX(k)+U(k))/(VX(k)+V(k)*DN)
  1404.       XX(k+1)= (X(k)- XX(k))*DN+ XX(k)
  1405.    20 CONTINUE
  1406. CDIR$ VECTOR
  1407. C
  1408. C...................
  1409.       CALL TEST(20)
  1410. C
  1411. C*******************************************************************************
  1412. C***  KERNEL 21     MATRIX*MATRIX PRODUCT
  1413. C*******************************************************************************
  1414. C
  1415.       DO 21 L= 1,Loop
  1416.       DO 21 k= 1,25
  1417.       DO 21 i= 1,25
  1418.       DO 21 j= 1,n
  1419.       PX(i,j)= PX(i,j) +VY(i,k) * CX(k,j)
  1420.    21 CONTINUE
  1421. C
  1422. C...................
  1423.       CALL TEST(21)
  1424. C
  1425. C
  1426. C
  1427. C
  1428. C
  1429. C
  1430. C
  1431. C*******************************************************************************
  1432. C***  KERNEL 22     PLANCKIAN DISTRIBUTION
  1433. C*******************************************************************************
  1434. C
  1435. C
  1436. C      EXPMAX= 234.500D0
  1437.        EXPMAX= 20.0000D0
  1438.            fw= 1.00000D0
  1439.          U(n)= 0.99000D0*EXPMAX*V(n)
  1440.       DO 22 L= 1,Loop
  1441.       DO 22 k= 1,n
  1442. CARE       IF( U(k) .LT. EXPMAX*V(k))  THEN
  1443.                                             Y(k)= U(k)/V(k)
  1444. CARE                                   ELSE
  1445. CARE                                        Y(k)= EXPMAX
  1446. CARE    ENDIF
  1447.          W(k)= X(k)/( EXP( Y(k)) -fw)
  1448.    22 CONTINUE
  1449. C...................
  1450.       CALL TEST(22)
  1451. C
  1452. C*******************************************************************************
  1453. C***  KERNEL 23     2-D IMPLICIT HYDRODYNAMICS FRAGMENT
  1454. C*******************************************************************************
  1455. C
  1456.             fw= 0.17500D0
  1457.       DO 23  L= 1,Loop
  1458.       DO 23  j= 2,6
  1459.       DO 23  k= 2,n
  1460.             QA= ZA(k,j+1)*ZR(k,j) +ZA(k,j-1)*ZB(k,j) +
  1461.      .          ZA(k+1,j)*ZU(k,j) +ZA(k-1,j)*ZV(k,j) +ZZ(k,j)
  1462.    23  ZA(k,j)= ZA(k,j) +fw*(QA -ZA(k,j))
  1463. C
  1464. C...................
  1465.       CALL TEST(23)
  1466. C
  1467. C*******************************************************************************
  1468. C***  KERNEL 24     FIND LOCATION OF FIRST MINIMUM IN ARRAY
  1469. C*******************************************************************************
  1470. C
  1471. C      X( n/2)= -1.000D+50
  1472.        X( n/2)= -1.000D+10
  1473.       DO 24  L= 1,Loop
  1474.              m= 1
  1475.       DO 24  k= 2,n
  1476.             IF( X(k).LT.X(m))  m= k
  1477.    24 CONTINUE
  1478. C
  1479. C            m= imin1( n,x,1)        35 nanosec./element STACKLIBE/CRAY
  1480. C...................
  1481.       CALL TEST(24)
  1482. C
  1483. C*******************************************************************************
  1484. C
  1485. C
  1486.       IF( jr .LT.  1)  jr= 1
  1487.       IF( jr .GT. 8)  jr= 8-1
  1488.       IF( il .LT.  1)  il= 1
  1489.       IF( il .GT. 3)  il= 3
  1490. C
  1491.       DO 999 k= 1,mk
  1492.       TIMES(jr,il,k)= TIME (k)
  1493.       TERRS(jr,il,k)= TERR1(k)
  1494.       NPFS (jr,il,k)= NPFS1(k)
  1495.       CSUMS(jr,il,k)= CSUM (k)
  1496.       DOS  (jr,il,k)= TOTAL(k)
  1497.       FOPN (jr,il,k)= FLOPN(k)
  1498.   999 continue
  1499. C
  1500.       CALL TRACKX
  1501.       RETURN
  1502.       END
  1503. C
  1504. C***********************************************
  1505.       SUBROUTINE  PAGE( iou)
  1506. C***********************************************
  1507.       CALL TRACKS('PAGE    ')
  1508.       WRITE(iou,1)
  1509.     1 FORMAT(1H1)
  1510. c   1 FORMAT(1H )
  1511.       CALL TRACKX
  1512.       RETURN
  1513.       END
  1514. C***********************************************
  1515.       SUBROUTINE REPORT( iou, ntk,nek,FLOPS,TR,RATES,LSPAN,WG,OSUM,ID)
  1516. C***********************************************************************
  1517. C                                                                      *
  1518. C     REPORT -  Prints Statistical Evaluation Of Fortran Kernel Timings*
  1519. C                                                                      *
  1520. C     iou    -  Logical Output Device Number                           *
  1521. C     ntk    -  Total number of Kernels to Edit in Report              *
  1522. C     nek    -  Number of Effective Kernels in each set to Edit        *
  1523. C     FLOPS  -  Array:  Number of Flops executed by each kernel        *
  1524. C     TR     -  Array:  Time of execution of each kernel(microsecs)    *
  1525. C     RATES  -  Array:  Rate of execution of each kernel(megaflops/sec)*
  1526. C     LSPAN  -  Array:  Span of inner DO loop in each kernel           *
  1527. C     WG     -  Array:  Weight assigned to each kernel for statistics  *
  1528. C     OSUM   -  Array:  Checksums of the results of each kernel        *
  1529. C***********************************************************************
  1530. c
  1531. c                                REFERENCE
  1532. c
  1533. c               F.H.McMahon,   The Livermore Fortran Kernels:
  1534. c               A Computer Test Of The Numerical Performance Range,
  1535. c               Lawrence Livermore National Laboratory,
  1536. c               Livermore, California, UCRL-53745, December 1986.
  1537. c
  1538. c        from:  National Technical Information Service
  1539. c               U.S. Department of Commerce
  1540. c               5285 Port Royal Road
  1541. c               Springfield, VA.  22161
  1542. c
  1543. c                                NOTICE
  1544. c
  1545. c               "This report was  prepared  as an account
  1546. c               of work  sponsored  by  the United States
  1547. c               Government.  Neither  the  United  States
  1548. c               nor the   United   States  Department  of
  1549. c               Energy, nor any  of  their employees, nor
  1550. c               any of their contractors, subcontractors,
  1551. c               or their employees,  makes  any warranty,
  1552. c               express or  implied, or assumes any legal
  1553. c               liability or   responsibility   for   the
  1554. c               accuracy, completeness  or  usefulness of
  1555. c               any information,  apparatus,  product  or
  1556. c               process disclosed, or represents that its
  1557. c               use would  not  infringe  privateiy-owned
  1558. c               rights."
  1559. c
  1560. c               Reference to  a  company  or product name
  1561. c               does not impiy approval or recommendation
  1562. c               of the   product  by  the  University  of
  1563. c               California or  the   U.S. Department   of
  1564. c               Energy to  the  exclusion  of others that
  1565. c               may be suitable.
  1566. c
  1567. c
  1568. c               Work performed under  the auspices of the
  1569. c               U.S. Department of Energy by the Lawrence
  1570. c               Livermore Laboratory    under    contract
  1571. c               number W-7405-ENG-48.
  1572. c
  1573. c***********************************************************************
  1574. c
  1575. c  Abstract
  1576. c
  1577. c  A computer performance  test that measures a realistic floating-point
  1578. c  performance range  for  Fortran applications is described.  A variety
  1579. c  of computer performance analyses may be easily carried out using this
  1580. c  small central  processing unit (cpu) test that would be infeasible or
  1581. c  too costly using complete applications as benchmarks, particularly in
  1582. c  the developmental  phase of an immature computer system.  The problem
  1583. c  of benchmarking numerical  applications  sufficiently,  especially on
  1584. c  new supercomputers,  is analyzed to identify several useful roles for
  1585. c  the Livermore Fortran  Kernal  (LFK) test.  The 24 LFK contain enough
  1586. c  samples of Fortran practice to expose many specific inefficiencies in
  1587. c  the formulation of the Fortran source, in the quality of compiled cpu
  1588. c  code, and   in   the  capability  of  the  instruction  architecture.
  1589. c  Examples show how the  LFK may be used to study compiled Fortran code
  1590. c  efficiency, to test the ability of compilers to vectorize Fortran, to
  1591. c  simulate mature coding  of  Fortran on new computers, and to estimate
  1592. c  the effective  subrange  of  supercomputer  performance  for  Fortran
  1593. c  applications.
  1594. c
  1595. c  Cpu performance  measurements   of  several  Fortran  benchmarks  and
  1596. c  numerical applications  that  correlate well with the cpu performance
  1597. c  range measured  by  the   LFK  test  are  presented.   The  numerical
  1598. c  performance metric  Mflops, first introduced in 1970 in this cpu test
  1599. c  to quantify the cpu  performance  range of numerical applications, is
  1600. c  discussed.  Analyses  of  the  LFK  performance results argue against
  1601. c  reducing the cpu performance  range  of  supercomputers  to  a single
  1602. c  number.  The  24  LFK  measured  rates  show  a realistic variance in
  1603. c  Fortran cpu  performance  that  is  essential  data  for  circumspect
  1604. c  computer evaluations.   Cpu performance data measured by the LFK test
  1605. c  on a number of recent computer systems are tabulated for reference.
  1606. c
  1607. c
  1608. c
  1609. c  I: FORTRAN CPU PERFORMANCE ANALYSIS
  1610. c
  1611. c
  1612. c     These kernels measure  Fortran numerical computation rates for a
  1613. c     spectrum of  CPU-limited computational structures or benchmarks.
  1614. c     The kernels benchmark  contains  extracts  or  kernels from more
  1615. c     than a score CPU-limited scientific application programs.  These
  1616. c     kernels are The most  important  CPU  time  components  from The
  1617. c     application programs.   This  benchmark  may  be easily extended
  1618. c     with important new kernels leaving performance statistics intact.
  1619. c
  1620. c     The time required  to  convert,  debug,  execute  and time many,
  1621. c     entire, large  programs  on  new  machines  each  having  a  new
  1622. c     implementation of  Fortran,   or   several   implementations  or
  1623. c     dialects rapidly  becomes  excessive.  Almost all The conversion
  1624. c     costs are in segments  of  The programs which are irrelevant for
  1625. c     evaluation of  The  CPU,  e.g.,  I/O, Fortran variations, memory
  1626. c     allocation, overlays,   job  control,   etc.    all   of   these
  1627. c     complexities are reduced to a single, small benchmark which uses
  1628. c     a minimum of I/O  and  a  single level of storage.  further, the
  1629. c     computation in  the  kernels  is  the  most  stable  part of the
  1630. c     Fortran language.
  1631. c
  1632. c     The kernels benchmark  is sufficient to determine a range of CPU
  1633. c     performance for  many  different  computational  structures in a
  1634. c     single computer run.   Since The range in performance is usually
  1635. c     large the  mean  has  a secondary significance.  To estimate the
  1636. c
  1637. c
  1638. c
  1639. c
  1640. c
  1641.  
  1642. +++++++++++++++++++++++++++++++++++++++++++++++++
  1643. +++ ED (Edward Quillen)   (517) 336-1293      +++
  1644. +++ Vet Teaching Hosp.    System Admin.       +++
  1645. +++ Email: quillen@cps.msu.edu                +++
  1646. +++++++++++++++++++++++++++++++++++++++++++++++++
  1647.