Changeset 142 for trunk/bench/bench.c


Ignore:
Timestamp:
06/07/10 05:25:23 (4 years ago)
Author:
faltet
Message:

Added a new suite in bench.c called debugsuite that is
appropriate for debugging purposes.

Now, the extremesuite can be used for running the complete
(and extremely long) suite.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bench/bench.c

    r138 r142  
    296296  int hard_suite = 0; 
    297297  int extreme_suite = 0; 
     298  int debug_suite = 0; 
    298299  int nthreads = 1;                     /* The number of threads */ 
    299300  int size = 2*MB;                      /* Buffer size */ 
     
    304305  struct timeval last, current; 
    305306  float totaltime; 
    306   char *usage = "Usage: bench ['single' | 'suite' | 'hardsuite' | 'extremesuite'] [nthreads [bufsize(bytes) [typesize [sbits ]]]]"; 
     307  char *usage = "Usage: bench ['single' | 'suite' | 'hardsuite' | 'extremesuite' | 'debugsuite'] [nthreads [bufsize(bytes) [typesize [sbits ]]]]"; 
    307308 
    308309 
     
    326327    workingset = 32*MB; 
    327328    niter = 1; 
     329    /* Values here are ending points for loops */ 
     330    nthreads = 4; 
     331    size = 16*MB; 
     332    elsize = 32; 
     333    rshift = 32; 
     334  } 
     335  else if (strcmp(argv[1], "debugsuite") == 0) { 
     336    debug_suite = 1; 
     337    workingset = 32*MB; 
     338    niter = 1; 
    328339    /* Warning: values here are starting points for loops.  This is 
    329340       useful for debugging. */ 
     
    365376  } 
    366377  else if (hard_suite) { 
    367     for (rshift_ = 0; rshift_ < rshift; rshift_ += 5) { 
     378    for (rshift_ = 0; rshift_ <= rshift; rshift_ += 5) { 
    368379      for (elsize_ = 1; elsize_ <= elsize; elsize_ *= 2) { 
    369380        /* The next loop is for getting sizes that are not power of 2 */ 
     
    374385            for (nthreads_ = 1; nthreads_ <= nthreads; nthreads_++) { 
    375386              do_bench(nthreads_, size_+i, elsize_, rshift_); 
    376               gettimeofday(&current, NULL); 
    377               totaltime = getseconds(last, current); 
    378               printf("Elapsed time:\t %6.1f s.  Processed data: %.1f GB\n", 
    379                      totaltime, totalsize / GB); 
     387              gettimeofday(&current, NULL); 
     388              totaltime = getseconds(last, current); 
     389              printf("Elapsed time:\t %6.1f s.  Processed data: %.1f GB\n", 
     390                     totaltime, totalsize / GB); 
    380391            } 
    381392          } 
     
    385396  } 
    386397  else if (extreme_suite) { 
     398    for (rshift_ = 0; rshift_ <= rshift; rshift_++) { 
     399      for (elsize_ = 1; elsize_ <= elsize; elsize_++) { 
     400        /* The next loop is for getting sizes that are not power of 2 */ 
     401        for (i = -elsize_*2; i <= elsize_*2; i += elsize_) { 
     402          for (size_ = 32*KB; size_ <= size; size_ *= 2) { 
     403            nchunks = get_nchunks(size_+i, workingset); 
     404            for (nthreads_ = 1; nthreads_ <= nthreads; nthreads_++) { 
     405              do_bench(nthreads_, size_+i, elsize_, rshift_); 
     406              gettimeofday(&current, NULL); 
     407              totaltime = getseconds(last, current); 
     408              printf("Elapsed time:\t %6.1f s.  Processed data: %.1f GB\n", 
     409                     totaltime, totalsize / GB); 
     410            } 
     411          } 
     412        } 
     413      } 
     414    } 
     415  } 
     416  else if (debug_suite) { 
    387417    for (rshift_ = rshift; rshift_ <= 32; rshift_++) { 
    388418      for (elsize_ = elsize; elsize_ <= 32; elsize_++) { 
     
    393423            for (nthreads_ = nthreads; nthreads_ <= 4; nthreads_++) { 
    394424              do_bench(nthreads_, size_+i, elsize_, rshift_); 
    395               gettimeofday(&current, NULL); 
    396               totaltime = getseconds(last, current); 
    397               printf("Elapsed time:\t %6.1f s.  Processed data: %.1f GB\n", 
    398                      totaltime, totalsize / GB); 
     425              gettimeofday(&current, NULL); 
     426              totaltime = getseconds(last, current); 
     427              printf("Elapsed time:\t %6.1f s.  Processed data: %.1f GB\n", 
     428                     totaltime, totalsize / GB); 
    399429            } 
    400430          } 
Note: See TracChangeset for help on using the changeset viewer.