Changeset 3d19ae6


Ignore:
Timestamp:
Dec 21, 2020, 4:40:48 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
8339225
Parents:
7b1f6d4
Message:

Added padding to existing locality benchmarks

Location:
benchmark/readyQ
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • benchmark/readyQ/locality.go

    r7b1f6d4 r3d19ae6  
    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
     
    7377        ptr uintptr // atomic variable use fo MES
    7478        id int      // id for debugging
     79        _p [16]uint64 // padding
    7580}
    7681
     
    239244        channels := make([]Spot, nthreads - nprocs) // Number of spots
    240245        for i := range channels {
    241                 channels[i] = Spot{uintptr(0), i}     // init spots
     246                channels[i] = Spot{uintptr(0), i,[16]uint64{0}}     // init spots
    242247        }
    243248
  • benchmark/readyQ/locality.rs

    r7b1f6d4 r3d19ae6  
    5353// ==================================================
    5454struct MyCtx {
     55        _p1: [16]u64,
    5556        s: sync::Semaphore,
    5657        d: MyDataPtr,
    5758        ttid: ThreadId,
    5859        _id: usize,
     60        _p2: [16]u64,
    5961}
    6062
Note: See TracChangeset for help on using the changeset viewer.