Changeset f03209d3 for benchmark/readyQ/locality.cpp
- Timestamp:
- Jan 5, 2021, 5:51:30 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 4468a70, 587a608
- Parents:
- ed1a6374
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/readyQ/locality.cpp
red1a6374 rf03209d3 201 201 202 202 void thread_main( MyCtx & ctx ) { 203 uint64_t state ;203 uint64_t state = ctx.id; 204 204 205 205 // Wait for start … … 237 237 unsigned wsize = 2; 238 238 unsigned wcnt = 2; 239 unsigned nspots = 0; 239 240 bool share = false; 240 241 option_t opt[] = { 241 242 BENCH_OPT, 243 { 'n', "nspots", "Number of spots where threads sleep (nthreads - nspots are active at the same time)", nspots}, 242 244 { 'w', "worksize", "Size of the array for each threads, in words (64bit)", wsize}, 243 245 { 'c', "workcnt" , "Number of words to touch when working (random pick, cells can be picked more than once)", wcnt }, … … 252 254 unsigned long long global_gmigs = 0; 253 255 unsigned long long global_dmigs = 0; 256 257 if( nspots == 0 ) { nspots = nthreads - nprocs; } 254 258 255 259 uint64_t start, end; … … 261 265 } 262 266 263 MySpot * spots[n threads - nprocs];264 for( size_t i = 0; i < (nthreads - nprocs); i++) {267 MySpot * spots[nspots]; 268 for(unsigned i = 0; i < nspots; i++) { 265 269 spots[i] = new MySpot{ i }; 266 270 } 267 271 268 threads_left = nthreads ;272 threads_left = nthreads - nspots; 269 273 Fibre * threads[nthreads]; 270 274 MyCtx * thddata[nthreads]; … … 274 278 data_arrays[i], 275 279 spots, 276 n threads - nprocs,280 nspots, 277 281 wcnt, 278 282 share, … … 307 311 } 308 312 309 for(size_t i = 0; i < (nthreads - nprocs); i++) {313 for(size_t i = 0; i < nspots; i++) { 310 314 delete( spots[i] ); 311 315 } … … 315 319 printf("Number of processors : %'d\n", nprocs); 316 320 printf("Number of threads : %'d\n", nthreads); 317 printf(" Total Operations(ops) : %'15llu\n", global_count);321 printf("Number of spots : %'d\n", nspots); 318 322 printf("Work size (64bit words): %'15u\n", wsize); 319 323 printf("Total Operations(ops) : %'15llu\n", global_count); 320 324 printf("Total G Migrations : %'15llu\n", global_gmigs); 321 325 printf("Total D Migrations : %'15llu\n", global_dmigs); 322 printf("Ops per second : %'18.2lf\n", ((double)global_count) / to_fseconds(end - start));323 printf("ns per ops : %'18.2lf\n", ((double)(end - start)) / global_count);324 printf("Ops per threads : %'15llu\n", global_count / nthreads);325 printf("Ops per procs : %'15llu\n", global_count / nprocs);326 printf("Ops/sec/procs : %'18.2lf\n", (((double)global_count) / nprocs) / to_fseconds(end - start));327 printf("ns per ops/procs : %'18.2lf\n", ((double)(end - start)) / (global_count / nprocs));326 printf("Ops per second : %'18.2lf\n", ((double)global_count) / to_fseconds(end - start)); 327 printf("ns per ops : %'18.2lf\n", ((double)(end - start)) / global_count); 328 printf("Ops per threads : %'15llu\n", global_count / nthreads); 329 printf("Ops per procs : %'15llu\n", global_count / nprocs); 330 printf("Ops/sec/procs : %'18.2lf\n", (((double)global_count) / nprocs) / to_fseconds(end - start)); 331 printf("ns per ops/procs : %'18.2lf\n", ((double)(end - start)) / (global_count / nprocs)); 328 332 fflush(stdout); 329 333 }
Note: See TracChangeset
for help on using the changeset viewer.