Changeset ebb6158 for benchmark/readyQ


Ignore:
Timestamp:
Sep 14, 2021, 12:47:47 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
a3769cc, fdfb0ba
Parents:
72bd9cd
Message:

Minor fixes to warnings, printing and ridiculous go/rust requirements.

Location:
benchmark/readyQ
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • benchmark/readyQ/cycle.cpp

    r72bd9cd rebb6158  
    4141                        Fibre * threads[tthreads];
    4242                        Partner thddata[tthreads];
    43                         for(int i = 0; i < tthreads; i++) {
     43                        for(unsigned i = 0; i < tthreads; i++) {
    4444                                unsigned pi = (i + nthreads) % tthreads;
    4545                                thddata[i].next = &thddata[pi].self;
    4646                        }
    47                         for(int i = 0; i < tthreads; i++) {
     47                        for(unsigned i = 0; i < tthreads; i++) {
    4848                                threads[i] = new Fibre( reinterpret_cast<void (*)(void *)>(partner_main), &thddata[i] );
    4949                        }
     
    5353                        start = timeHiRes();
    5454
    55                         for(int i = 0; i < nthreads; i++) {
     55                        for(unsigned i = 0; i < nthreads; i++) {
    5656                                thddata[i].self.post();
    5757                        }
     
    6262                        printf("\nDone\n");
    6363
    64                         for(int i = 0; i < tthreads; i++) {
     64                        for(unsigned i = 0; i < tthreads; i++) {
    6565                                thddata[i].self.post();
    6666                                fibre_join( threads[i], nullptr );
  • benchmark/readyQ/locality.rs

    r72bd9cd rebb6158  
    124124                                                return (r as *mut MyData, true);
    125125                                        }
    126                                         let got = self.ptr.compare_and_swap(expected, ctx as *mut MyCtx as u64, Ordering::SeqCst);
    127                                         if got == expected {
     126                                        let got = self.ptr.compare_exchange_weak(expected, ctx as *mut MyCtx as u64, Ordering::SeqCst, Ordering::SeqCst);
     127                                        if got == Ok(expected) {
    128128                                                break expected;// We got the seat
    129129                                        }
  • benchmark/readyQ/transfer.cfa

    r72bd9cd rebb6158  
    3939                        Pause();
    4040                        if( (timeHiRes() - start) > 5`s ) {
     41                                print_stats_now( bench_cluster, CFA_STATS_READY_Q | CFA_STATS_IO );
    4142                                serr | "Programs has been blocked for more than 5 secs";
    4243                                exit(1);
     
    110111        cfa_option opt[] = {
    111112                BENCH_OPT,
    112                 { 'e', "exhaust", "Whether or not threads that have seen the new epoch should yield or park.", exhaust, parse_yesno}
     113                { 'e', "exhaust", "Whether or not threads that have seen the new epoch should park instead of yielding.", exhaust, parse_yesno}
    113114        };
    114115        BENCH_OPT_PARSE("cforall transition benchmark");
  • benchmark/readyQ/transfer.rs

    r72bd9cd rebb6158  
    44use std::process;
    55use std::option;
     6use std::hint;
    67use std::sync::Arc;
    78use std::sync::atomic::{AtomicUsize, Ordering};
     
    104105                debug!( "Waiting for :{} ({})", t.id, t.idx.load(Ordering::Relaxed) );
    105106                while t.idx.load(Ordering::Relaxed) != idx {
    106                         std::sync::atomic::spin_loop_hint();
     107                        hint::spin_loop();
    107108                        if start.elapsed() > Duration::from_secs(5) {
    108109                                eprintln!("Programs has been blocked for more than 5 secs");
Note: See TracChangeset for help on using the changeset viewer.