Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/readyQ/locality.go

    rf4f79dd rc5a98f3  
    215215func main() {
    216216        // Benchmark specific command line arguments
    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)")
     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")
    219219        shareOpt     := flag.Bool  ("s", false, "Pass the work data to the next thread when blocking")
    220220
     
    266266
    267267        // Join and accumulate results
    268         results := NewResult()
     268        global_result := NewResult()
    269269        for i := 0; i < nthreads; i++ {
    270270                r := <- result
    271                 results.count += r.count
    272                 results.gmigs += r.gmigs
    273                 results.dmigs += r.dmigs
     271                global_result.count += r.count
     272                global_result.gmigs += r.gmigs
     273                global_result.dmigs += r.dmigs
    274274        }
    275275
     
    280280        p.Printf("Number of threads      : %d\n", nthreads);
    281281        p.Printf("Work size (64bit words): %d\n", size);
    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 }
     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}
Note: See TracChangeset for help on using the changeset viewer.