Changeset f4f79dd
- Timestamp:
- Dec 18, 2020, 12:04:39 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:
- 720b1a9
- Parents:
- 41cde266
- Location:
- benchmark/readyQ
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/readyQ/bench.go
r41cde266 rf4f79dd 5 5 "flag" 6 6 "fmt" 7 "log" 7 8 "os" 8 9 "runtime" 10 "runtime/pprof" 9 11 "sync/atomic" 10 12 "time" … … 43 45 } 44 46 45 func bench_init() {47 func bench_init() func() { 46 48 nprocsOpt := flag.Int("p", 1, "The number of processors") 47 49 nthreadsOpt := flag.Int("t", 1, "The number of threads") 48 50 durationOpt := flag.Float64("d", 0, "Duration of the experiment in seconds") 49 51 stopOpt := flag.Uint64("i", 0, "Duration of the experiment in iterations") 52 cpuprofile := flag.String("cpuprofile", "", "write cpu profile to file") 50 53 51 54 flag.Parse() … … 72 75 73 76 runtime.GOMAXPROCS(nprocs) 77 78 if (*cpuprofile) != "" { 79 f, err := os.Create(*cpuprofile) 80 if err != nil { 81 log.Fatal(err) 82 } 83 pprof.StartCPUProfile(f) 84 } 85 86 return func() { 87 if (*cpuprofile) != "" { 88 pprof.StopCPUProfile() 89 } 90 } 74 91 } -
benchmark/readyQ/cycle.rs
r41cde266 rf4f79dd 14 14 use tokio::time; 15 15 16 extern crate isatty;17 16 use isatty::stdout_isatty; 18 17 19 extern crate num_format;20 18 use num_format::{Locale, ToFormattedString}; 21 19 22 extern crate clap;23 20 use clap::{Arg, App}; 24 21 -
benchmark/readyQ/locality.go
r41cde266 rf4f79dd 215 215 func main() { 216 216 // Benchmark specific command line arguments 217 work_sizeOpt := flag.Uint64("w", 2 , " Number of words (uint64) per threads")218 countOpt := flag.Uint64("c", 2 , "Number of words (uint64) to touch")217 work_sizeOpt := flag.Uint64("w", 2 , "Size of the array for each threads, in words (64bit)") 218 countOpt := flag.Uint64("c", 2 , "Number of words to touch when working (random pick, cells can be picked more than once)") 219 219 shareOpt := flag.Bool ("s", false, "Pass the work data to the next thread when blocking") 220 220 … … 266 266 267 267 // Join and accumulate results 268 global_result:= NewResult()268 results := NewResult() 269 269 for i := 0; i < nthreads; i++ { 270 270 r := <- result 271 global_result.count += r.count272 global_result.gmigs += r.gmigs273 global_result.dmigs += r.dmigs271 results.count += r.count 272 results.gmigs += r.gmigs 273 results.dmigs += r.dmigs 274 274 } 275 275 … … 280 280 p.Printf("Number of threads : %d\n", nthreads); 281 281 p.Printf("Work size (64bit words): %d\n", size); 282 p.Printf("Total Operations(ops) : %15d\n", global_result.count)283 p.Printf("Total G Migrations : %15d\n", global_result.gmigs)284 p.Printf("Total D Migrations : %15d\n", global_result.dmigs)285 p.Printf("Ops per second : %18.2f\n", float64( global_result.count) / delta.Seconds())286 p.Printf("ns per ops : %18.2f\n", float64(delta.Nanoseconds()) / float64( global_result.count))287 p.Printf("Ops per threads : %15d\n", global_result.count / uint64(nthreads))288 p.Printf("Ops per procs : %15d\n", global_result.count / uint64(nprocs))289 p.Printf("Ops/sec/procs : %18.2f\n", (float64( global_result.count) / float64(nprocs)) / delta.Seconds())290 p.Printf("ns per ops/procs : %18.2f\n", float64(delta.Nanoseconds()) / (float64( global_result.count) / float64(nprocs)))291 } 282 p.Printf("Total Operations(ops) : %15d\n", results.count) 283 p.Printf("Total G Migrations : %15d\n", results.gmigs) 284 p.Printf("Total D Migrations : %15d\n", results.dmigs) 285 p.Printf("Ops per second : %18.2f\n", float64(results.count) / delta.Seconds()) 286 p.Printf("ns per ops : %18.2f\n", float64(delta.Nanoseconds()) / float64(results.count)) 287 p.Printf("Ops per threads : %15d\n", results.count / uint64(nthreads)) 288 p.Printf("Ops per procs : %15d\n", results.count / uint64(nprocs)) 289 p.Printf("Ops/sec/procs : %18.2f\n", (float64(results.count) / float64(nprocs)) / delta.Seconds()) 290 p.Printf("ns per ops/procs : %18.2f\n", float64(delta.Nanoseconds()) / (float64(results.count) / float64(nprocs))) 291 }
Note: See TracChangeset
for help on using the changeset viewer.