Changeset 83


Ignore:
Timestamp:
05/04/10 03:38:19 (4 years ago)
Author:
faltet
Message:

New version of bench.c that accepts command line params.

Version bumped to 0.9.0.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bench.c

    r77 r83  
    3737/* #define NCHUNKS (100) */ 
    3838/* #define NITER  (10)               /\* Number of iterations *\/ */ 
    39 #define NCHUNKS (100) 
     39#define NCHUNKS (128) 
    4040#define NITER  (10)               /* Number of iterations */ 
    4141 
     
    106106 
    107107  v = (i<<26)^(i<<18)^(i<<11)^(i<<3)^i; 
    108   v &= (1 << (32-rshift)) - 1; 
     108  v &= (1 << rshift) - 1; 
    109109  return v; 
    110110} 
     
    126126    //_src[i] = i * 1/.3; 
    127127    //_src[i] = i; 
    128     //_src[i] = rand() >> rshift; 
     128    //_src[i] = rand() >> (32-rshift); 
    129129    _src[i] = get_value(i, rshift); 
    130130  } 
     
    132132 
    133133 
    134 int main(void) { 
     134int main(int argc, char *argv[]) { 
    135135  int nbytes, cbytes; 
    136136  void *src, *srccpy; 
     
    140140  float tmemcpy, tshuf, tunshuf; 
    141141  int clevel; 
    142   unsigned int size = 128*1024;   /* Buffer size */ 
    143   unsigned int elsize = 4;        /* Datatype size */ 
    144   int rshift = 12;                /* For random data */ 
    145   int nthreads = 1;               /* The number of threads */ 
    146   int doshuffle = 1;              /* Shuffle? */ 
     142  unsigned int size = 1024*1024;   /* Buffer size */ 
     143  unsigned int elsize = 4;         /* Datatype size */ 
     144  int rshift = 20;                 /* Significant bits */ 
     145  int nthreads = 1;                /* The number of threads */ 
     146  int doshuffle = 1;               /* Shuffle? */ 
    147147  unsigned char *orig, *round; 
     148 
     149  if (argc >= 2) { 
     150    nthreads = atoi(argv[1]); 
     151  } 
     152  if (argc >= 3) { 
     153    size = atoi(argv[2])*1024; 
     154    if (size > 2*1024*1024) { 
     155      printf("The test is going to require more than 256 MB of RAM!\n"); 
     156    } 
     157  } 
     158  if (argc >= 4) { 
     159    elsize = atoi(argv[3]); 
     160  } 
     161  if (argc >= 5) { 
     162    rshift = atoi(argv[4]); 
     163  } 
     164  if (argc >= 6) { 
     165    doshuffle = atoi(argv[5]); 
     166  } 
     167  if (argc >= 7) { 
     168    printf("Usage: bench [nthreads [bufsize(KB) [typesize [sbits [shuf]]]]]\n"); 
     169    exit(1); 
     170  } 
    148171 
    149172  blosc_set_nthreads(nthreads); 
     
    163186  printf("********************** Setup info *****************************\n"); 
    164187  printf("Blosc version: %s (%s)\n", BLOSC_VERSION_STRING, BLOSC_VERSION_DATE); 
    165   printf("Using random data with %d significant bits (out of 32)\n", 32-rshift); 
    166   printf("Dataset size: %d bytes\t Type size: %d bytes\n", size, elsize); 
    167   printf("Shuffle active?  %s\n", doshuffle ? "Yes" : "No"); 
     188  printf("Using random data with %d significant bits (out of 32)\n", rshift); 
     189  printf("Dataset size: %d bytes\tType size: %d bytes\n", size, elsize); 
     190  printf("Shuffle active?  %s\t\t", doshuffle ? "Yes" : "No"); 
     191  printf("Number of threads: %d\n", nthreads); 
    168192  printf("********************** Running benchmarks *********************\n"); 
    169193 
  • trunk/src/blosc.h

    r80 r83  
    1616#define BLOSC_VERSION_RELEASE  0    /* for tweaks, bug-fixes, or development */ 
    1717 
    18 #define BLOSC_VERSION_STRING   "0.9.0.dev"  /* string version.  Sync with above! */ 
    19 #define BLOSC_VERSION_DATE     "2010-05-03"      /* date version */ 
     18#define BLOSC_VERSION_STRING   "0.9.0"  /* string version.  Sync with above! */ 
     19#define BLOSC_VERSION_DATE     "2010-05-04"      /* date version */ 
    2020 
    2121/* The *_VERS_FORMAT should be just 1-byte long */ 
Note: See TracChangeset for help on using the changeset viewer.