Ignore:
Timestamp:
Dec 22, 2020, 9:16:13 AM (3 years ago)
Author:
caparsons <caparson@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
797a193
Parents:
0285efe (diff), 3f8baf4 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/readyQ/locality.go

    r0285efe rfe97de26  
    1818// ==================================================
    1919type MyData struct {
     20        _p1 [16]uint64 // padding
    2021        ttid int
    2122        id int
    2223        data [] uint64
     24        _p2 [16]uint64 // padding
    2325}
    2426
     
    2931                data[i] = 0
    3032        }
    31         return &MyData{syscall.Gettid(), id, data}
     33        return &MyData{[16]uint64{0}, syscall.Gettid(), id, data,[16]uint64{0}}
    3234}
    3335
     
    4648// ==================================================
    4749type MyCtx struct {
     50        _p1 [16]uint64 // padding
    4851        s * semaphore.Weighted
    4952        d unsafe.Pointer
     
    5154        ttid int
    5255        id int
     56        _p2 [16]uint64 // padding
    5357}
    5458
    5559func NewCtx( data * MyData, id int ) (MyCtx) {
    56         r := MyCtx{semaphore.NewWeighted(1), unsafe.Pointer(data), context.Background(), syscall.Gettid(), id}
     60        r := MyCtx{[16]uint64{0},semaphore.NewWeighted(1), unsafe.Pointer(data), context.Background(), syscall.Gettid(), id,[16]uint64{0}}
    5761        r.s.Acquire(context.Background(), 1)
    5862        return r
     
    7175// May exchanges data
    7276type Spot struct {
     77        _p1 [16]uint64 // padding
    7378        ptr uintptr // atomic variable use fo MES
    7479        id int      // id for debugging
     80        _p2 [16]uint64 // padding
    7581}
    7682
     
    215221func main() {
    216222        // 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")
     223        work_sizeOpt := flag.Uint64("w", 2    , "Size of the array for each threads, in words (64bit)")
     224        countOpt     := flag.Uint64("c", 2    , "Number of words to touch when working (random pick, cells can be picked more than once)")
    219225        shareOpt     := flag.Bool  ("s", false, "Pass the work data to the next thread when blocking")
    220226
     
    239245        channels := make([]Spot, nthreads - nprocs) // Number of spots
    240246        for i := range channels {
    241                 channels[i] = Spot{uintptr(0), i}     // init spots
     247                channels[i] = Spot{[16]uint64{0},uintptr(0), i,[16]uint64{0}}     // init spots
    242248        }
    243249
     
    266272
    267273        // Join and accumulate results
    268         global_result := NewResult()
     274        results := NewResult()
    269275        for i := 0; i < nthreads; i++ {
    270276                r := <- result
    271                 global_result.count += r.count
    272                 global_result.gmigs += r.gmigs
    273                 global_result.dmigs += r.dmigs
     277                results.count += r.count
     278                results.gmigs += r.gmigs
     279                results.dmigs += r.dmigs
    274280        }
    275281
     
    280286        p.Printf("Number of threads      : %d\n", nthreads);
    281287        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 }
     288        p.Printf("Total Operations(ops)  : %15d\n", results.count)
     289        p.Printf("Total G Migrations     : %15d\n", results.gmigs)
     290        p.Printf("Total D Migrations     : %15d\n", results.dmigs)
     291        p.Printf("Ops per second         : %18.2f\n", float64(results.count) / delta.Seconds())
     292        p.Printf("ns per ops             : %18.2f\n", float64(delta.Nanoseconds()) / float64(results.count))
     293        p.Printf("Ops per threads        : %15d\n", results.count / uint64(nthreads))
     294        p.Printf("Ops per procs          : %15d\n", results.count / uint64(nprocs))
     295        p.Printf("Ops/sec/procs          : %18.2f\n", (float64(results.count) / float64(nprocs)) / delta.Seconds())
     296        p.Printf("ns per ops/procs       : %18.2f\n", float64(delta.Nanoseconds()) / (float64(results.count) / float64(nprocs)))
     297}
Note: See TracChangeset for help on using the changeset viewer.