Changeset 129


Ignore:
Timestamp:
06/04/10 07:20:07 (4 years ago)
Author:
faltet
Message:

Initialization of the source buffer to avoid valgrind warnings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bench/bench.c

    r127 r129  
    3939 
    4040#define NCHUNKS (32*1024)       /* maximum number of chunks */ 
    41 #define NITER  3                /* number of iterations for normal operation */ 
    4241 
    4342 
    4443int nchunks = NCHUNKS; 
    45 int niter = NITER; 
     44int niter = 3;                  /* default number of iterations */ 
    4645float totalsize = 0.;           /* total compressed/decompressed size */ 
    4746 
     
    160159  srccpy = malloc(size); 
    161160  dest2 = malloc(size); 
     161  /* zero src to initialize byte on it, and not only multiples of 4 */ 
     162  memset(src, 0, size); 
    162163  init_buffer(src, size, rshift); 
    163164  memcpy(srccpy, src, size); 
     
    305306  char *usage = "Usage: bench ['single' | 'suite' | 'hardsuite' | 'extremesuite'] [nthreads [bufsize(KB) [typesize [sbits ]]]]"; 
    306307 
    307    
     308 
    308309  if (strcmp(argv[1], "single") == 0) { 
    309     niter = 10; 
    310     workingset = 32*MB; 
     310    single = 1; 
    311311  } 
    312312  else if (strcmp(argv[1], "suite") == 0) { 
    313313    suite = 1; 
    314     nthreads = 1; 
    315     niter = 5; 
    316     size = 2*MB; 
    317     elsize = 8; 
    318     rshift = 19; 
    319314  } 
    320315  else if (strcmp(argv[1], "hardsuite") == 0) { 
    321316    hard_suite = 1; 
     317    workingset = 64*MB; 
     318    /* Values here are ending points for loops */ 
    322319    nthreads = 2; 
    323     niter = 3; 
    324320    size = 8*MB; 
    325321    elsize = 32; 
    326322    rshift = 32; 
    327     workingset = 64*MB; 
    328323  } 
    329324  else if (strcmp(argv[1], "extremesuite") == 0) { 
    330325    extreme_suite = 1; 
     326    workingset = 32*MB; 
     327    niter = 1; 
     328    /* Warning: values here are starting points for loops.  This is 
     329       useful for debugging. */ 
    331330    nthreads = 1; 
    332     niter = 1; 
    333     /* Values here are starting points.  This is useful for debugging. */ 
    334331    size = 16*KB; 
    335332    elsize = 1; 
    336333    rshift = 0; 
    337     workingset = 32*MB; 
    338334  } 
    339335  else { 
Note: See TracChangeset for help on using the changeset viewer.