Changeset 147 for trunk/bench/bench.c


Ignore:
Timestamp:
06/07/10 14:21:35 (4 years ago)
Author:
faltet
Message:

Supported a new parameter maxbytes for blosc_compress().

It represents a maximum of bytes for output. Tests unit added too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bench/bench.c

    r142 r147  
    143143 
    144144 
    145 do_bench(int nthreads, unsigned int size, int elsize, int rshift) { 
     145void do_bench(int nthreads, unsigned int size, int elsize, int rshift) { 
    146146  void *src, *srccpy; 
    147147  void **dest[NCHUNKS], *dest2; 
    148   int nbytes, cbytes; 
     148  int nbytes = 0, cbytes = 0; 
    149149  size_t i, j; 
    150150  struct timeval last, current; 
     
    164164  memcpy(srccpy, src, size); 
    165165  for (j = 0; j < nchunks; j++) { 
    166     dest[j] = malloc(size); 
     166    /* 16 additional bytes should be enough for encoding everything */ 
     167    dest[j] = malloc(size+16); 
    167168  } 
    168169 
     
    210211    for (i = 0; i < niter; i++) { 
    211212      for (j = 0; j < nchunks; j++) { 
    212         cbytes = blosc_compress(clevel, doshuffle, elsize, size, src, dest[j]); 
     213        cbytes = blosc_compress(clevel, doshuffle, elsize, size, src, 
     214                                dest[j], size); 
    213215      } 
    214216    } 
     
    307309  char *usage = "Usage: bench ['single' | 'suite' | 'hardsuite' | 'extremesuite' | 'debugsuite'] [nthreads [bufsize(bytes) [typesize [sbits ]]]]"; 
    308310 
     311 
     312  if (argc == 1) { 
     313    printf("%s\n", usage); 
     314    exit(1); 
     315  } 
    309316 
    310317  if (strcmp(argv[1], "single") == 0) { 
Note: See TracChangeset for help on using the changeset viewer.