summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2008-11-14 20:55:59 +0000
committerMatt Turner <mattst88@gmail.com>2008-11-14 20:55:59 +0000
commitc11b34f0a5ec28f8c66f40054e4eb351cc1d1f05 (patch)
treed46f9330bc1c3b9f00ac652f3c7bc24c1d17d4ad
parent912a8f45cbe9300b7425702f85bb0af6b3026d2a (diff)
Remove more useless stuff
git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@38 0d43b9a7-5ab2-4d7b-af9d-f64450cef757
-rw-r--r--cleanbench.c129
-rw-r--r--cleanbench.h5
-rw-r--r--hardware.c2
-rw-r--r--hardware.h2
4 files changed, 10 insertions, 128 deletions
diff --git a/cleanbench.c b/cleanbench.c
index 3a9a6a0..a1f1c53 100644
--- a/cleanbench.c
+++ b/cleanbench.c
@@ -46,7 +46,6 @@
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
-#include <time.h>
#include <math.h>
#include "nmglobal.h"
#include "cleanbench.h"
@@ -56,32 +55,21 @@
**** main ****
*************/
int main(int argc, char *argv[]) {
-int i; /* Index */
-time_t time_and_date; /* Self-explanatory */
-struct tm *loctime;
double bmean; /* Benchmark mean */
double bstdev; /* Benchmark stdev */
-double lx_memindex; /* Linux memory index (mainly integer operations)*/
-double lx_intindex; /* Linux integer index */
-double lx_fpindex; /* Linux floating-point index */
-double intindex; /* Integer index */
-double fpindex; /* Floating-point index */
+double lx_memindex = 1.0; /* Linux memory index (mainly integer operations)*/
+double lx_intindex = 1.0; /* Linux integer index */
+double lx_fpindex = 1.0; /* Linux floating-point index */
+double intindex = 1.0; /* Integer index */
+double fpindex = 1.0; /* Floating-point index */
unsigned long bnumrun; /* # of runs */
+int i; /* Index */
/*
** Set global parameters to default.
*/
global_min_ticks=MINIMUM_TICKS;
global_min_seconds=MINIMUM_SECONDS;
-global_allstats=0;
-global_custrun=0;
-global_align=8;
-write_to_file=0;
-lx_memindex=(double)1.0; /* set for geometric mean computations */
-lx_intindex=(double)1.0;
-lx_fpindex=(double)1.0;
-intindex=(double)1.0;
-fpindex=(double)1.0;
/*
** We presume all tests will be run unless told
@@ -122,41 +110,9 @@ global_nnetstruct.adjust=0;
global_lustruct.adjust=0;
-puts("\nBYTEmark* Native Mode Benchmark ver. 2 (10/95)");
+puts("BYTEmark* Native Mode Benchmark ver. 2 (10/95)");
puts("Index-split by Andrew D. Balsa (11/97)");
puts("Linux/Unix* port by Uwe F. Mayer (12/96,11/97)");
-/*
-** See if the user wants all stats. Output heading info
-** if so.
-*/
-if(global_allstats)
-{
- puts("\n============================== ALL STATISTICS ===============================");
- time(&time_and_date);
- loctime=localtime(&time_and_date);
- printf("**Date and time of benchmark run: %s", asctime(loctime));
- printf("**Sizeof: char:%d short:%u int:%u long:%u uint8_t:%u uint16_t:%u uint32_t:%u int32:%u\n",
- sizeof(char),
- sizeof(short),
- sizeof(int),
- sizeof(long),
- sizeof(uint8_t),
- sizeof(uint16_t),
- sizeof(uint32_t),
- sizeof(int32_t));
-#ifdef __linux__
-#include "sysinfo.c"
-#else
- printf("**%s\n",sysname);
- printf("**%s\n",compilername);
- printf("**%s\n",compilerversion);
-#endif
- puts("=============================================================================");
-}
-
-/*
-** Execute the tests.
-*/
puts("\nTEST : Iterations/sec. : Old Index : New Index");
puts(" : : Pentium 90* : AMD K6/233*");
puts("--------------------:------------------:-------------:------------");
@@ -194,28 +150,8 @@ for(i=0;i<NUMTESTS;i++)
/* Linux memory index */
lx_memindex=lx_memindex*(bmean/lx_bindex[i]);
}
-
- if(global_allstats)
- {
- printf(" Absolute standard deviation: %g\n",bstdev);
- if (bmean>(double)1e-100){
- /* avoid division by zero */
- printf(" Relative standard deviation: %g %%\n",
- (double)100*bstdev/bmean);
- }
- printf(" Number of runs: %lu\n",bnumrun);
- show_stats(i);
- printf("Done with %s\n\n",ftestnames[i]);
- }
}
}
-/* printf("...done...\n"); */
-
-/*
-** Output the total indexes
-*/
-if(global_custrun==0)
-{
puts("==========================ORIGINAL BYTEMARK RESULTS==========================");
printf("INTEGER INDEX : %.3f\n",
pow(intindex,(double).142857));
@@ -224,7 +160,7 @@ if(global_custrun==0)
puts("Baseline (MSDOS*) : Pentium* 90, 256 KB L2-cache, Watcom* compiler 10.0");
#ifdef __linux__
puts("==============================LINUX DATA BELOW===============================");
- hardware(write_to_file, global_ofile);
+ hardware(global_ofile);
#include "sysinfoc.c"
printf("MEMORY INDEX : %.3f\n",
pow(lx_memindex,(double).3333333333));
@@ -235,7 +171,6 @@ if(global_custrun==0)
puts("Baseline (LINUX) : AMD K6/233*, 512 KB L2-cache, gcc 2.7.2.3, libc-5.4.38");
#endif
puts("* Trademarks are property of their respective holder.");
-}
return 0;
}
@@ -427,51 +362,3 @@ static double getscore(int fid) {
}
return 0.0;
}
-
-/***************
-** show_stats **
-****************
-** This routine displays statistics for a particular benchmark.
-** The benchmark is identified by its id.
-*/
-static void show_stats (int bid) {
- switch(bid) {
- case NUMSORT: /* Numeric sort */
- printf(" Number of arrays: %d\n", global_numsortstruct.numarrays);
- printf(" Array size: %ld\n", global_numsortstruct.arraysize);
- break;
- case STRINGSORT: /* String sort */
- printf(" Number of arrays: %d\n", global_strsortstruct.numarrays);
- printf(" Array size: %ld\n", global_strsortstruct.arraysize);
- break;
- case BITFIELD: /* Bitmap operation */
- printf(" Operations array size: %ld\n", global_bitopstruct.bitoparraysize);
- printf(" Bitfield array size: %ld\n", global_bitopstruct.bitfieldarraysize);
- break;
- case FPEMULATION: /* Floating-point emulation */
- printf(" Number of loops: %lu\n", global_emfloatstruct.loops);
- printf(" Array size: %lu\n", global_emfloatstruct.arraysize);
- break;
- case FOURIER: /* Fourier test */
- printf(" Number of coefficients: %lu\n", global_fourierstruct.arraysize);
- break;
- case ASSIGNMENT:
- printf(" Number of arrays: %lu\n", global_assignstruct.numarrays);
- break;
- case IDEA:
- printf(" Array size: %lu\n", global_ideastruct.arraysize);
- printf(" Number of loops: %lu\n", global_ideastruct.loops);
- break;
- case HUFFMAN:
- printf(" Array size: %lu\n", global_huffstruct.arraysize);
- printf(" Number of loops: %lu\n", global_huffstruct.loops);
- break;
- case NEURAL:
- printf(" Number of loops: %lu\n", global_nnetstruct.loops);
- break;
- case LINEAR:
- printf(" Number of arrays: %lu\n", global_lustruct.numarrays);
- break;
- }
- return;
-}
diff --git a/cleanbench.h b/cleanbench.h
index 0318fbf..3f35f8a 100644
--- a/cleanbench.h
+++ b/cleanbench.h
@@ -211,12 +211,8 @@ char buffer[BUF_SIZ];
*/
unsigned long global_min_ticks; /* Minimum ticks */
unsigned long global_min_seconds; /* Minimum seconds tests run */
-int global_allstats; /* Statistics dump flag */
char global_ofile_name[BUF_SIZ];/* Output file name */
FILE *global_ofile; /* Output file */
-int global_custrun; /* Custom run flag */
-int write_to_file; /* Write output to file */
-int global_align; /* Memory alignment */
/*
** Following are global structures, one built for
@@ -262,7 +258,6 @@ static int calc_confidence(double scores[],
double *c_half_interval,double *smean,
double *sdev);
static double getscore(int fid);
-static void show_stats(int bid);
/*
** EXTERNAL PROTOTYPES
diff --git a/hardware.c b/hardware.c
index 5f29d1a..7823b4a 100644
--- a/hardware.c
+++ b/hardware.c
@@ -145,7 +145,7 @@ static void readProcCpuInfo (char *model, char *cache) {
** Reads /proc/cpuinfo if on a linux system
** Writes output
*/
-void hardware(const int write_to_file, FILE *global_ofile) {
+void hardware(FILE *global_ofile) {
char os[BUF_SIZ];
char model[BUF_SIZ];
char cache[BUF_SIZ];
diff --git a/hardware.h b/hardware.h
index 2a07934..b9085bc 100644
--- a/hardware.h
+++ b/hardware.h
@@ -1,2 +1,2 @@
extern
-void hardware(const int write_to_file, FILE *global_ofile);
+void hardware(FILE *global_ofile);