Changeset 74


Ignore:
Timestamp:
04/30/10 04:43:25 (4 years ago)
Author:
faltet
Message:

Removed SP_BLOCKSIZE constant and use min_buffersize_parallel only.

This is simpler and new benchmarks reveal that there is not much sense
to have very small blocks like 2 KB.

Following benchmark results, the hash value for blosclz has made to not
pass 13.

Location:
branches/threaded/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/threaded/src/bench.c

    r73 r74  
    138138  float tmemcpy, tshuf, tunshuf; 
    139139  int clevel; 
    140   unsigned int size = 256*1024;   /* Buffer size */ 
     140  unsigned int size = 1024*1024;   /* Buffer size */ 
    141141  unsigned int elsize = 8;        /* Datatype size */ 
    142142  int rshift = 12;                /* For random data */ 
  • branches/threaded/src/blosc.c

    r73 r74  
    3232#define MIN_BUFFERSIZE 128       /* Cannot be smaller than 66 */ 
    3333 
    34 /* Starting point for the blocksize computation */ 
    35 #define SP_BLOCKSIZE (2*1024) 
    36  
    3734/* Maximum typesize before considering buffer as a stream of bytes. */ 
    3835#define MAX_TYPESIZE 256         /* Cannot be larger than 256 */ 
     
    4542 
    4643 
    47 /* Minimal buffer size before allowing parallelization */ 
    48 size_t min_buffersize_parallel = 512*1024; 
     44/* Minimal buffer size beyond which parallelization is allowed.  Note 
     45   that the buffer size should be *strictly larger* than this minimum 
     46   before parallelization enters in action. */ 
     47size_t min_buffersize_parallel = 256*1024; 
    4948 
    5049/* Global variables for main logic */ 
     
    407406  /* Run the serial version when nthreads is 1 or when the buffers are 
    408407     just too small */ 
    409   if (nthreads == 1 || params.nbytes < min_buffersize_parallel) { 
     408  if (nthreads == 1 || params.nbytes <= min_buffersize_parallel) { 
    410409    ntbytes = serial_blosc(); 
    411410  } 
     
    434433    } 
    435434  } 
    436   else if (nbytes >= min_buffersize_parallel) { 
    437     /* Compute a blocksize depending on the optimization level */ 
    438     blocksize = SP_BLOCKSIZE; 
    439     for (i=2; i<=clevel; i++) { 
    440       /* Escape if blocksize grows more than nbytes */ 
    441       if (blocksize*2 > nbytes) break; 
     435  else if (nbytes > min_buffersize_parallel) { 
     436    blocksize = min_buffersize_parallel; 
     437    /* Duplicate blocksize for compression levels 8 and 9 */ 
     438    if (clevel > 7) { 
    442439      blocksize *= 2; 
    443440    } 
  • branches/threaded/src/blosc.h

    r73 r74  
    134134   Set the minimal buffer size before threads can run in parallel. 
    135135 
    136    In theory, and for multicore processors with 3 levels of cache, 
    137    this value should be close or slightly larger than the L2 cache 
    138    size.  But YMMV... 
     136   Note that the buffer size should be *strictly larger* than this 
     137   minimum before parallelization enters in action. 
     138 
     139   The optimal value that my experiments reveal for Quad Core2 
     140   processors is 256 KB.  But YMMV... 
    139141 
    140142*/ 
  • branches/threaded/src/blosclz.c

    r63 r74  
    111111 
    112112  /* Hash table depends on the opt level.  Hash_log cannot be larger than 15. */ 
    113   blzuint8 hash_log_[10] = {-1, 7, 8, 9, 10, 11, 12, 13, 14, 14}; 
     113  blzuint8 hash_log_[10] = {-1, 7, 8, 9, 10, 11, 12, 13, 13, 13}; 
    114114  blzuint8 hash_log = hash_log_[opt_level]; 
    115115  blzuint16 hash_size = 1 << hash_log; 
Note: See TracChangeset for help on using the changeset viewer.