home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume21 / cloops / part01 / report.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-07-25  |  3.1 KB  |  89 lines

  1. /*
  2.  * This file is part of the Livermore Loops transliteration into C.
  3.  * Copyright (C) 1991 by Martin Fouts
  4.  *
  5.  * This program is free software; you can redistribute it and/or modify
  6.  * it under the terms of the GNU General Public License as published by
  7.  * the Free Software Foundation; either version 1, or (at your option)
  8.  * any later version.
  9.  *
  10.  * This program is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  * GNU General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program; if not, write to the Free Software
  17.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  */
  19.  
  20. #include <stdio.h>
  21. #include "types.h"
  22. #include "externs.h"
  23.  
  24. Void valid();
  25. Void statw();
  26.  
  27. Void report(logio, nk, tock, komput, kompil)
  28. Int logio, nk;
  29. Float tock;
  30. char *komput, *kompil;
  31. {
  32.   Float rt[NTESTS], tempo[NTESTS], stat1[12];
  33.   Float vl1[NTESTS], vl[NTESTS], tv[NTESTS], tv1[NTESTS];
  34.   Float rt1[NTESTS], wt1[NTESTS], csum1[NTESTS];
  35.  
  36.   Float mops[NTESTS], mops1[NTESTS];
  37.   Int map[NTESTS], in[NTESTS], ispan1[NTESTS];
  38.  
  39.   Float scaled;
  40.   Int k, neff, lv;
  41.  
  42.   if (logio < 0) return;
  43.   scaled= 1000000.0;
  44.  
  45.   for (k = 0; k < nk; k++) {
  46.     rt[k]= (Time[k] - tock)*scaled;
  47.     mops[k]= nrops[k]*loops[k];
  48.     tempo[k]= 0.0;
  49.     vl[k]= ispan[k];
  50.     if( rt[k] != 0.0) tempo[k]= mops[k]/rt[k];
  51.   }
  52.   valid( tv,map,&neff,  1.0e-8,tempo, 1.0e+4,nk);
  53.   for (k = 0; k < neff; k++) {
  54.     mops1[k]=  mops[ map[k]];
  55.     rt1[k]=    rt[ map[k]];
  56.     vl1[k]=    vl[ map[k]];
  57.     ispan1[k]= ispan[ map[k]];
  58.     wt1[k]=    wt[ map[k]];
  59.     tv1[k]= tempo[ map[k]];
  60.     csum1[k]=  csum[ map[k]];
  61.   }
  62.   statw( stat1,tv,in, vl1,wt1,neff);
  63.   lv= stat1[0];
  64.   statw( stat1,tv,in, tv1,wt1,neff);
  65.   fprintf(stdout,"********************************************\n");
  66.   fprintf(stdout,"The Livermore Fortran Kernels (In C!)\n");
  67.   fprintf(stdout,"********************************************\n");
  68.   fprintf(stdout,"Computer : %s\n", komput);
  69.   fprintf(stdout,"Compiler : %s\n", kompil);
  70.   fprintf(stdout,"Mean Vector L = %d\n", lv);
  71.   fprintf(stdout,"********************************************\n");
  72.   fprintf(stdout,
  73.       "KERNEL      FLOPS   MICROSEC   MFLOP/SEC  SPAN     WEIGHT   SUM\n");
  74.   fprintf(stdout,
  75.       "------      -----   --------   ---------  ----     ------   ---\n");
  76.   for (k = 0; k < neff; k++)
  77.     fprintf(stdout,"%6d%11.4e%11.4e%12.4e%6d%11.4e%20.12e\n", map[k]+1,
  78.         mops1[k], rt1[k], tv1[k], ispan1[k], wt1[k], csum1[k]);
  79.   fprintf(stdout,
  80.       "------      -----   --------   ---------  ----     ------   ---\n");
  81.   fprintf(stdout,"         MFLOPS  RANGE = %.4f  TO %.4f Mega-Flops/Sec.\n",
  82.       stat1[2], stat1[3]);
  83.   fprintf(stdout,"         HARMONIC MEAN = %.4f Mega-Flops/Sec.\n", stat1[4]);
  84.   fprintf(stdout,"         MEDIAN   RATE = %.4f Mega-Flops/Sec.\n", stat1[6]);
  85.   fprintf(stdout,"         MEDIAN   DEV. = %.4f Mega-Flops/Sec.\n", stat1[8]);
  86.   fprintf(stdout,"         AVERAGE  RATE = %.4f Mega-Flops/Sec.\n", stat1[0]);
  87.   fprintf(stdout,"         STANDARD DEV. = %.4f Mega-Flops/Sec.\n", stat1[1]);
  88. }
  89.