Changes in / [a3769cc:347925c]
- Files:
-
- 1 deleted
- 11 edited
-
benchmark/Cargo.toml.in (modified) (1 diff)
-
benchmark/Makefile.am (modified) (3 diffs)
-
benchmark/bench.rs (modified) (4 diffs)
-
benchmark/readyQ/cycle.cpp (modified) (3 diffs)
-
benchmark/readyQ/cycle.rs (modified) (1 diff)
-
benchmark/readyQ/locality.rs (modified) (2 diffs)
-
benchmark/readyQ/transfer.cfa (modified) (2 diffs)
-
benchmark/readyQ/transfer.rs (deleted)
-
benchmark/readyQ/yield.rs (modified) (2 diffs)
-
libcfa/src/concurrency/kernel.cfa (modified) (3 diffs)
-
libcfa/src/device/cpu.cfa (modified) (1 diff)
-
libcfa/src/device/cpu.hfa (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/Cargo.toml.in
ra3769cc r347925c 12 12 name = "rdq-locality-tokio" 13 13 path = "@abs_srcdir@/readyQ/locality.rs" 14 15 [[bin]]16 name = "rdq-transfer-tokio"17 path = "@abs_srcdir@/readyQ/transfer.rs"18 14 19 15 [[bin]] -
benchmark/Makefile.am
ra3769cc r347925c 600 600 rdq-locality-go \ 601 601 rdq-locality-fibre \ 602 rdq-transfer-cfa \ 603 rdq-transfer-tokio 602 rdq-transfer-cfa 604 603 605 604 rdq-benches: … … 607 606 608 607 clean-rdq-benches: 609 rm -rf $(RDQBENCHES) $(builddir)/target go.mod 610 611 rdq-%-tokio$(EXEEXT): $(builddir)/target/release/rdq-%-tokio$(EXEEXT) 612 $(BENCH_V_RUSTC)cp $(builddir)/target/release/$(basename $@) $@ 613 614 $(builddir)/target/release/rdq-%-tokio$(EXEEXT): $(srcdir)/readyQ/%.rs $(srcdir)/bench.rs 615 $(BENCH_V_RUSTC)cd $(builddir) && cargo build --release 608 rm -rf $(RDQBENCHES) 609 610 rdq-%-tokio$(EXEEXT): $(srcdir)/readyQ/%.rs $(srcdir)/bench.rs 611 cd $(builddir) && cargo build --release 612 cp $(builddir)/target/release/$(basename $@) $@ 616 613 617 614 rdq-%-cfa$(EXEEXT): $(srcdir)/readyQ/%.cfa $(srcdir)/readyQ/rq_bench.hfa … … 620 617 go.mod: 621 618 touch $@ 622 go mod edit -module=rdq .bench619 go mod edit -module=rdqbench 623 620 go get golang.org/x/sync/semaphore 624 621 go get golang.org/x/text/language -
benchmark/bench.rs
ra3769cc r347925c 1 1 use std::io::{self, Write}; 2 use std::option;3 2 use std::sync::atomic::{AtomicU64, AtomicBool, Ordering}; 4 3 use std::time::{Instant,Duration}; 5 use std::u128;6 4 7 5 use clap::{Arg, ArgMatches}; … … 29 27 30 28 impl BenchData { 31 pub fn new(options: ArgMatches, nthreads: usize , default_it: option::Option<u64>) -> BenchData {29 pub fn new(options: ArgMatches, nthreads: usize) -> BenchData { 32 30 let (clock_mode, stop_count, duration) = if options.is_present("iterations") { 33 31 (false, 34 32 options.value_of("iterations").unwrap().parse::<u64>().unwrap(), 35 -1.0)36 } else if !default_it.is_none() {37 (false,38 default_it.unwrap(),39 33 -1.0) 40 34 } else { … … 54 48 } 55 49 56 #[allow(dead_code)]57 50 pub async fn wait(&self, start: &Instant) -> Duration{ 58 51 loop { … … 76 69 } 77 70 78 // ==================================================79 pub fn _lehmer64( state: &mut u128 ) -> u64 {80 *state = state.wrapping_mul(0xda942042e4dd58b5);81 return (*state >> 64) as u64;82 } -
benchmark/readyQ/cycle.cpp
ra3769cc r347925c 41 41 Fibre * threads[tthreads]; 42 42 Partner thddata[tthreads]; 43 for( unsignedi = 0; i < tthreads; i++) {43 for(int i = 0; i < tthreads; i++) { 44 44 unsigned pi = (i + nthreads) % tthreads; 45 45 thddata[i].next = &thddata[pi].self; 46 46 } 47 for( unsignedi = 0; i < tthreads; i++) {47 for(int i = 0; i < tthreads; i++) { 48 48 threads[i] = new Fibre( reinterpret_cast<void (*)(void *)>(partner_main), &thddata[i] ); 49 49 } … … 53 53 start = timeHiRes(); 54 54 55 for( unsignedi = 0; i < nthreads; i++) {55 for(int i = 0; i < nthreads; i++) { 56 56 thddata[i].self.post(); 57 57 } … … 62 62 printf("\nDone\n"); 63 63 64 for( unsignedi = 0; i < tthreads; i++) {64 for(int i = 0; i < tthreads; i++) { 65 65 thddata[i].self.post(); 66 66 fibre_join( threads[i], nullptr ); -
benchmark/readyQ/cycle.rs
ra3769cc r347925c 46 46 47 47 let tthreads = nthreads * ring_size; 48 let exp = Arc::new(bench::BenchData::new(options, tthreads , None));48 let exp = Arc::new(bench::BenchData::new(options, tthreads)); 49 49 50 50 let s = (1000000 as u64).to_formatted_string(&Locale::en); -
benchmark/readyQ/locality.rs
ra3769cc r347925c 124 124 return (r as *mut MyData, true); 125 125 } 126 let got = self.ptr.compare_ exchange_weak(expected, ctx as *mut MyCtx as u64, Ordering::SeqCst, Ordering::SeqCst);127 if got == Ok(expected){126 let got = self.ptr.compare_and_swap(expected, ctx as *mut MyCtx as u64, Ordering::SeqCst); 127 if got == expected { 128 128 break expected;// We got the seat 129 129 } … … 285 285 assert_eq!(&s, "1,000,000"); 286 286 287 let exp = Arc::new(bench::BenchData::new(options, nprocs , None));287 let exp = Arc::new(bench::BenchData::new(options, nprocs)); 288 288 let mut results = Result::new(); 289 289 -
benchmark/readyQ/transfer.cfa
ra3769cc r347925c 39 39 Pause(); 40 40 if( (timeHiRes() - start) > 5`s ) { 41 print_stats_now( bench_cluster, CFA_STATS_READY_Q | CFA_STATS_IO );42 41 serr | "Programs has been blocked for more than 5 secs"; 43 42 exit(1); … … 111 110 cfa_option opt[] = { 112 111 BENCH_OPT, 113 { 'e', "exhaust", "Whether or not threads that have seen the new epoch should park instead of yielding.", exhaust, parse_yesno}112 { 'e', "exhaust", "Whether or not threads that have seen the new epoch should yield or park.", exhaust, parse_yesno} 114 113 }; 115 114 BENCH_OPT_PARSE("cforall transition benchmark"); -
benchmark/readyQ/yield.rs
ra3769cc r347925c 44 44 let nprocs = options.value_of("nprocs").unwrap().parse::<usize>().unwrap(); 45 45 46 let exp = Arc::new(bench::BenchData::new(options, nthreads , None));46 let exp = Arc::new(bench::BenchData::new(options, nthreads)); 47 47 48 48 let s = (1000000 as u64).to_formatted_string(&Locale::en); … … 50 50 51 51 let thddata : Arc<Vec<Arc<Yielder>>> = Arc::new( 52 (0..nthreads).map(|_i| { 52 (0..nthreads).map(|i| { 53 let pi = (i + nthreads) % nthreads; 53 54 Arc::new(Yielder{ 54 55 sem: sync::Semaphore::new(0), -
libcfa/src/concurrency/kernel.cfa
ra3769cc r347925c 22 22 #include <errno.h> 23 23 #include <stdio.h> 24 #include <string.h>25 24 #include <signal.h> 26 25 #include <unistd.h> … … 32 31 #include "kernel_private.hfa" 33 32 #include "preemption.hfa" 34 #include "strstream.hfa"35 #include "device/cpu.hfa"36 33 37 34 //Private includes … … 234 231 __cfadbg_print_safe(runtime_core, "Kernel : core %p waiting on eventfd %d\n", this, this->idle); 235 232 236 { 237 eventfd_t val; 238 ssize_t ret = read( this->idle, &val, sizeof(val) ); 239 if(ret < 0) { 240 switch((int)errno) { 241 case EAGAIN: 242 #if EAGAIN != EWOULDBLOCK 243 case EWOULDBLOCK: 244 #endif 245 case EINTR: 246 // No need to do anything special here, just assume it's a legitimate wake-up 247 break; 248 default: 249 abort( "KERNEL : internal error, read failure on idle eventfd, error(%d) %s.", (int)errno, strerror( (int)errno ) ); 250 } 251 } 252 } 233 __disable_interrupts_hard(); 234 eventfd_t val; 235 eventfd_read( this->idle, &val ); 236 __enable_interrupts_hard(); 253 237 254 238 #if !defined(__CFA_NO_STATISTICS__) -
libcfa/src/device/cpu.cfa
ra3769cc r347925c 422 422 } 423 423 } 424 425 cpu_info_t cpu_info; -
libcfa/src/device/cpu.hfa
ra3769cc r347925c 30 30 }; 31 31 32 externcpu_info_t cpu_info;32 cpu_info_t cpu_info;
Note:
See TracChangeset
for help on using the changeset viewer.