Ignore:
Timestamp:
Jan 5, 2021, 5:51:30 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:
4468a70, 587a608
Parents:
ed1a6374
Message:

Locality benchmark now supports explicit number of spots instead of using nthreads - nprocs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/readyQ/locality.go

    red1a6374 rf03209d3  
    221221func main() {
    222222        // Benchmark specific command line arguments
     223        nspotsOpt    := flag.Int   ("n", 0    , "Number of spots where threads sleep (nthreads - nspots are active at the same time)")
    223224        work_sizeOpt := flag.Uint64("w", 2    , "Size of the array for each threads, in words (64bit)")
    224225        countOpt     := flag.Uint64("c", 2    , "Number of words to touch when working (random pick, cells can be picked more than once)")
     
    229230
    230231        // Eval command line arguments
     232        nspots:= *nspotsOpt
    231233        size  := *work_sizeOpt
    232234        cnt   := *countOpt
    233235        share := *shareOpt
     236
     237        if nspots == 0 { nspots = nthreads - nprocs; }
    234238
    235239        // Check params
     
    241245        // Make global data
    242246        barrierStart := make(chan struct{})         // Barrier used at the start
    243         threads_left = int64(nprocs)                // Counter for active threads (not 'nthreads' because at all times 'nthreads - nprocs' are blocked)
     247        threads_left = int64(nthreads - nspots)                // Counter for active threads (not 'nthreads' because at all times 'nthreads - nprocs' are blocked)
    244248        result  := make(chan Result)                // Channel for results
    245         channels := make([]Spot, nthreads - nprocs) // Number of spots
     249        channels := make([]Spot, nspots) // Number of spots
    246250        for i := range channels {
    247251                channels[i] = Spot{[16]uint64{0},uintptr(0), i,[16]uint64{0}}     // init spots
Note: See TracChangeset for help on using the changeset viewer.