Changeset 83 for trunk/src/bench.c
- Timestamp:
- 05/04/10 03:38:19 (3 years ago)
- File:
-
- 1 edited
-
trunk/src/bench.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bench.c
r77 r83 37 37 /* #define NCHUNKS (100) */ 38 38 /* #define NITER (10) /\* Number of iterations *\/ */ 39 #define NCHUNKS (1 00)39 #define NCHUNKS (128) 40 40 #define NITER (10) /* Number of iterations */ 41 41 … … 106 106 107 107 v = (i<<26)^(i<<18)^(i<<11)^(i<<3)^i; 108 v &= (1 << (32-rshift)) - 1;108 v &= (1 << rshift) - 1; 109 109 return v; 110 110 } … … 126 126 //_src[i] = i * 1/.3; 127 127 //_src[i] = i; 128 //_src[i] = rand() >> rshift;128 //_src[i] = rand() >> (32-rshift); 129 129 _src[i] = get_value(i, rshift); 130 130 } … … 132 132 133 133 134 int main( void) {134 int main(int argc, char *argv[]) { 135 135 int nbytes, cbytes; 136 136 void *src, *srccpy; … … 140 140 float tmemcpy, tshuf, tunshuf; 141 141 int clevel; 142 unsigned int size = 1 28*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? */ 147 147 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 } 148 171 149 172 blosc_set_nthreads(nthreads); … … 163 186 printf("********************** Setup info *****************************\n"); 164 187 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); 168 192 printf("********************** Running benchmarks *********************\n"); 169 193
Note: See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/images/blosc-logo-small.png)