Changeset 4d8fbf4 for benchmark/readyQ
- Timestamp:
- Sep 16, 2021, 2:22:01 PM (4 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
- Children:
- 432bffe, 7e7a076
- Parents:
- a8367eb (diff), 140eb16 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- benchmark/readyQ
- Files:
-
- 4 added
- 9 edited
-
cycle.cpp (modified) (3 diffs)
-
cycle.go (modified) (2 diffs)
-
cycle.rs (modified) (1 diff)
-
locality.go (modified) (1 diff)
-
locality.rs (modified) (2 diffs)
-
transfer.cfa (modified) (3 diffs)
-
transfer.cpp (modified) (1 diff)
-
transfer.go (added)
-
transfer.rs (added)
-
yield.cfa (modified) (1 diff)
-
yield.cpp (modified) (1 diff)
-
yield.go (added)
-
yield.rs (added)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/readyQ/cycle.cpp
ra8367eb r4d8fbf4 41 41 Fibre * threads[tthreads]; 42 42 Partner thddata[tthreads]; 43 for( inti = 0; i < tthreads; i++) {43 for(unsigned i = 0; i < tthreads; i++) { 44 44 unsigned pi = (i + nthreads) % tthreads; 45 45 thddata[i].next = &thddata[pi].self; 46 46 } 47 for( inti = 0; i < tthreads; i++) {47 for(unsigned i = 0; i < tthreads; i++) { 48 48 threads[i] = new Fibre( reinterpret_cast<void (*)(void *)>(partner_main), &thddata[i] ); 49 49 } … … 53 53 start = timeHiRes(); 54 54 55 for( inti = 0; i < nthreads; i++) {55 for(unsigned i = 0; i < nthreads; i++) { 56 56 thddata[i].self.post(); 57 57 } … … 62 62 printf("\nDone\n"); 63 63 64 for( inti = 0; i < tthreads; i++) {64 for(unsigned i = 0; i < tthreads; i++) { 65 65 thddata[i].self.post(); 66 66 fibre_join( threads[i], nullptr ); -
benchmark/readyQ/cycle.go
ra8367eb r4d8fbf4 60 60 atomic.StoreInt32(&stop, 1) 61 61 end := time.Now() 62 d elta:= end.Sub(start)62 duration := end.Sub(start) 63 63 64 64 fmt.Printf("\nDone\n") … … 74 74 75 75 p := message.NewPrinter(language.English) 76 p.Printf("Duration (ms) : % f\n", delta.Seconds());76 p.Printf("Duration (ms) : %d\n", duration.Milliseconds()) 77 77 p.Printf("Number of processors : %d\n", nprocs); 78 78 p.Printf("Number of threads : %d\n", tthreads); 79 79 p.Printf("Cycle size (# thrds) : %d\n", ring_size); 80 80 p.Printf("Total Operations(ops): %15d\n", global_counter) 81 p.Printf("Ops per second : %18.2f\n", float64(global_counter) / d elta.Seconds())82 p.Printf("ns per ops : %18.2f\n", float64(d elta.Nanoseconds()) / float64(global_counter))81 p.Printf("Ops per second : %18.2f\n", float64(global_counter) / duration.Seconds()) 82 p.Printf("ns per ops : %18.2f\n", float64(duration.Nanoseconds()) / float64(global_counter)) 83 83 p.Printf("Ops per threads : %15d\n", global_counter / uint64(tthreads)) 84 84 p.Printf("Ops per procs : %15d\n", global_counter / uint64(nprocs)) 85 p.Printf("Ops/sec/procs : %18.2f\n", (float64(global_counter) / float64(nprocs)) / d elta.Seconds())86 p.Printf("ns per ops/procs : %18.2f\n", float64(d elta.Nanoseconds()) / (float64(global_counter) / float64(nprocs)))85 p.Printf("Ops/sec/procs : %18.2f\n", (float64(global_counter) / float64(nprocs)) / duration.Seconds()) 86 p.Printf("ns per ops/procs : %18.2f\n", float64(duration.Nanoseconds()) / (float64(global_counter) / float64(nprocs))) 87 87 88 88 } -
benchmark/readyQ/cycle.rs
ra8367eb r4d8fbf4 46 46 47 47 let tthreads = nthreads * ring_size; 48 let exp = Arc::new(bench::BenchData::new(options, tthreads ));48 let exp = Arc::new(bench::BenchData::new(options, tthreads, None)); 49 49 50 50 let s = (1000000 as u64).to_formatted_string(&Locale::en); -
benchmark/readyQ/locality.go
ra8367eb r4d8fbf4 286 286 // Print with nice 's, i.e. 1'000'000 instead of 1000000 287 287 p := message.NewPrinter(language.English) 288 p.Printf("Duration ( s) : %f\n", delta.Seconds());288 p.Printf("Duration (ms) : %f\n", delta.Milliseconds()); 289 289 p.Printf("Number of processors : %d\n", nprocs); 290 290 p.Printf("Number of threads : %d\n", nthreads); -
benchmark/readyQ/locality.rs
ra8367eb r4d8fbf4 124 124 return (r as *mut MyData, true); 125 125 } 126 let got = self.ptr.compare_ and_swap(expected, ctx as *mut MyCtx as u64, Ordering::SeqCst);127 if got == expected{126 let got = self.ptr.compare_exchange_weak(expected, ctx as *mut MyCtx as u64, Ordering::SeqCst, Ordering::SeqCst); 127 if got == Ok(expected) { 128 128 break expected;// We got the seat 129 129 } … … 285 285 assert_eq!(&s, "1,000,000"); 286 286 287 let exp = Arc::new(bench::BenchData::new(options, nprocs ));287 let exp = Arc::new(bench::BenchData::new(options, nprocs, None)); 288 288 let mut results = Result::new(); 289 289 -
benchmark/readyQ/transfer.cfa
ra8367eb r4d8fbf4 39 39 Pause(); 40 40 if( (timeHiRes() - start) > 5`s ) { 41 print_stats_now( bench_cluster, CFA_STATS_READY_Q | CFA_STATS_IO ); 41 42 serr | "Programs has been blocked for more than 5 secs"; 42 43 exit(1); … … 110 111 cfa_option opt[] = { 111 112 BENCH_OPT, 112 { 'e', "exhaust", "Whether or not threads that have seen the new epoch should yield or park.", exhaust, parse_yesno}113 { 'e', "exhaust", "Whether or not threads that have seen the new epoch should park instead of yielding.", exhaust, parse_yesno} 113 114 }; 114 115 BENCH_OPT_PARSE("cforall transition benchmark"); … … 166 167 } 167 168 168 sout | "Duration : " | ws(3, 3, unit(eng((end - start)`ds))) | 's';169 sout | "Duration (ms) : " | ws(3, 3, unit(eng((end - start)`dms))); 169 170 sout | "Number of processors : " | nprocs; 170 171 sout | "Number of threads : " | nthreads; -
benchmark/readyQ/transfer.cpp
ra8367eb r4d8fbf4 173 173 } 174 174 175 std::cout << "Duration : " << to_miliseconds(end - start) << "ms"<< std::endl;175 std::cout << "Duration (ms) : " << to_miliseconds(end - start) << std::endl; 176 176 std::cout << "Number of processors : " << nprocs << std::endl; 177 177 std::cout << "Number of threads : " << nthreads << std::endl; -
benchmark/readyQ/yield.cfa
ra8367eb r4d8fbf4 80 80 } 81 81 82 printf("Took %'ld ms\n", (end - start)`ms); 82 printf("Duration (ms) : %'ld\n", (end - start)`dms); 83 printf("Number of processors: %'d\n", nprocs); 84 printf("Number of threads : %'d\n", nthreads); 85 printf("Total yields : %'15llu\n", global_counter); 83 86 printf("Yields per second : %'18.2lf\n", ((double)global_counter) / (end - start)`s); 84 87 printf("ns per yields : %'18.2lf\n", ((double)(end - start)`ns) / global_counter); 85 printf("Total yields : %'15llu\n", global_counter);86 88 printf("Yields per procs : %'15llu\n", global_counter / nprocs); 87 89 printf("Yields/sec/procs : %'18.2lf\n", (((double)global_counter) / nprocs) / (end - start)`s); -
benchmark/readyQ/yield.cpp
ra8367eb r4d8fbf4 154 154 155 155 auto dur_nano = duration_cast<std::nano>(duration); 156 auto dur_dms = duration_cast<std::milli>(duration); 156 157 157 std::cout << "Took " << duration << " s\n";158 printf("Duration (ms) : %'.2lf\n", dur_dms ); 158 159 printf("Total yields : %'15llu\n", global_counter ); 159 160 printf("Yields per procs : %'15llu\n", global_counter / nprocs );
Note:
See TracChangeset
for help on using the changeset viewer.