Changeset 3f8baf4


Ignore:
Timestamp:
Dec 21, 2020, 6:00:05 PM (3 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:
fe97de26
Parents:
7efb322
Message:

Fixed the padding

Location:
benchmark/readyQ
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • benchmark/readyQ/locality.cfa

    r7efb322 r3f8baf4  
    3636// ==================================================
    3737struct MyData {
    38         uint64_t[16] _p1;  // padding
     38        uint64_t _p1[16];  // padding
    3939        uint64_t * data;
    4040        size_t len;
    4141        processor * ttid;
    4242        size_t id;
    43         uint64_t[16] _p2;  // padding
     43        uint64_t _p2[16];  // padding
    4444};
    4545
     
    7474        MyThread * volatile ptr;
    7575        size_t id;
    76         uint64_t[16] _p1;  // padding
     76        uint64_t _p1[16];  // padding
    7777};
    7878
     
    256256        printf("Number of threads      : %'d\n", nthreads);
    257257        printf("Total Operations(ops)  : %'15llu\n", global_count);
    258         printf("Work size (64bit words): %'15llu", wsize);
    259         printf("Total Operations(ops)  : %'15llu", global_count);
    260         printf("Total G Migrations     : %'15llu", global_gmigs);
    261         printf("Total D Migrations     : %'15llu", global_dmigs);
     258        printf("Work size (64bit words): %'15llu\n", wsize);
     259        printf("Total Operations(ops)  : %'15llu\n", global_count);
     260        printf("Total G Migrations     : %'15llu\n", global_gmigs);
     261        printf("Total D Migrations     : %'15llu\n", global_dmigs);
    262262        printf("Ops per second         : %'18.2lf\n", ((double)global_count) / (end - start)`ds);
    263263        printf("ns per ops             : %'18.2lf\n", (end - start)`dns / global_count);
  • benchmark/readyQ/locality.go

    r7efb322 r3f8baf4  
    7575// May exchanges data
    7676type Spot struct {
     77        _p1 [16]uint64 // padding
    7778        ptr uintptr // atomic variable use fo MES
    7879        id int      // id for debugging
    79         _p [16]uint64 // padding
     80        _p2 [16]uint64 // padding
    8081}
    8182
     
    244245        channels := make([]Spot, nthreads - nprocs) // Number of spots
    245246        for i := range channels {
    246                 channels[i] = Spot{uintptr(0), i,[16]uint64{0}}     // init spots
     247                channels[i] = Spot{[16]uint64{0},uintptr(0), i,[16]uint64{0}}     // init spots
    247248        }
    248249
  • benchmark/readyQ/locality.rs

    r7efb322 r3f8baf4  
    1717// ==================================================
    1818struct MyData {
     19        _p1: [u64; 16],
    1920        data: Vec<u64>,
    2021        ttid: ThreadId,
    2122        _id: usize,
     23        _p2: [u64; 16],
    2224}
    2325
     
    2527        fn new(id: usize, size: usize) -> MyData {
    2628                MyData {
     29                        _p1: [0; 16],
    2730                        data: vec![0; size],
    2831                        ttid: thread::current().id(),
    2932                        _id: id,
     33                        _p2: [0; 16],
    3034                }
    3135        }
     
    5357// ==================================================
    5458struct MyCtx {
    55         _p1: [16]u64,
     59        _p1: [u64; 16],
    5660        s: sync::Semaphore,
    5761        d: MyDataPtr,
    5862        ttid: ThreadId,
    5963        _id: usize,
    60         _p2: [16]u64,
     64        _p2: [u64; 16],
    6165}
    6266
     
    6468        fn new(d: *mut MyData, id: usize) -> MyCtx {
    6569                MyCtx {
     70                        _p1: [0; 16],
    6671                        s: sync::Semaphore::new(0),
    6772                        d: MyDataPtr{ ptr: d },
    6873                        ttid: thread::current().id(),
    69                         _id: id
     74                        _id: id,
     75                        _p2: [0; 16],
    7076                }
    7177        }
     
    8389// May exchanges data
    8490struct MySpot {
     91        _p1: [u64; 16],
    8592        ptr: AtomicU64,
    8693        _id: usize,
     94        _p2: [u64; 16],
    8795}
    8896
     
    9098        fn new(id: usize) -> MySpot {
    9199                let r = MySpot{
     100                        _p1: [0; 16],
    92101                        ptr: AtomicU64::new(0),
    93102                        _id: id,
     103                        _p2: [0; 16],
    94104                };
    95105                r
Note: See TracChangeset for help on using the changeset viewer.