- Timestamp:
- Sep 27, 2021, 2:09:55 PM (4 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
- Children:
- cc287800
- Parents:
- 4e28d2e9 (diff), 056cbdb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- benchmark
- Files:
-
- 21 added
- 14 edited
-
Cargo.toml.in (modified) (1 diff)
-
Makefile.am (modified) (4 diffs)
-
bench.h (modified) (1 diff)
-
bench.rs (modified) (4 diffs)
-
mutexStmt/JavaThread.java (added)
-
mutexStmt/cpp1.cc (added)
-
mutexStmt/cpp2.cc (added)
-
mutexStmt/cpp4.cc (added)
-
mutexStmt/cpp8.cc (added)
-
mutexStmt/cppLock.hpp (added)
-
mutexStmt/lock1.cfa (added)
-
mutexStmt/lock2.cfa (added)
-
mutexStmt/lock4.cfa (added)
-
mutexStmt/lock8.cfa (added)
-
mutexStmt/monitor1.cfa (added)
-
mutexStmt/monitor2.cfa (added)
-
mutexStmt/monitor4.cfa (added)
-
mutexStmt/no_stmt_lock1.cfa (added)
-
mutexStmt/no_stmt_lock2.cfa (added)
-
mutexStmt/no_stmt_lock4.cfa (added)
-
mutexStmt/no_stmt_lock8.cfa (added)
-
readyQ/cycle.cpp (modified) (3 diffs)
-
readyQ/cycle.go (modified) (2 diffs)
-
readyQ/cycle.rs (modified) (1 diff)
-
readyQ/locality.go (modified) (1 diff)
-
readyQ/locality.rs (modified) (2 diffs)
-
readyQ/transfer.cfa (modified) (3 diffs)
-
readyQ/transfer.cpp (modified) (1 diff)
-
readyQ/transfer.go (added)
-
readyQ/transfer.rs (added)
-
readyQ/yield.cfa (modified) (1 diff)
-
readyQ/yield.cpp (modified) (1 diff)
-
readyQ/yield.go (added)
-
readyQ/yield.rs (added)
-
rmit.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/Cargo.toml.in
r4e28d2e9 r949339b 6 6 7 7 [[bin]] 8 name = " cycle-tokio"8 name = "rdq-cycle-tokio" 9 9 path = "@abs_srcdir@/readyQ/cycle.rs" 10 10 11 11 [[bin]] 12 name = " locality-tokio"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 19 [[bin]] 20 name = "rdq-yield-tokio" 21 path = "@abs_srcdir@/readyQ/yield.rs" 14 22 15 23 [features] -
benchmark/Makefile.am
r4e28d2e9 r949339b 21 21 include $(top_srcdir)/tools/build/cfa.make 22 22 23 AM_CFLAGS = -O 2-Wall -Wextra -I$(srcdir) -lrt -pthread # -Werror23 AM_CFLAGS = -O3 -Wall -Wextra -I$(srcdir) -lrt -pthread # -Werror 24 24 AM_CFAFLAGS = -quiet -nodebug 25 25 AM_UPPFLAGS = -quiet -nodebug -multi -std=c++14 … … 197 197 $(srcdir)/fixcsv.sh $@ 198 198 199 # use --no-print-directory to generate csv appropriately 200 mutexStmt.csv: 201 echo "building $@" 202 echo "1-lock,2-lock,4-lock,8-lock,1-no-stmt-lock,2-no-stmt-lock,4-no-stmt-lock,8-no-stmt-lock,1-monitor,2-monitor,4-monitor" > $@ 203 +make mutexStmt-lock1.runquiet >> $@ && echo -n ',' >> $@ 204 +make mutexStmt-lock2.runquiet >> $@ && echo -n ',' >> $@ 205 +make mutexStmt-lock4.runquiet >> $@ && echo -n ',' >> $@ 206 +make mutexStmt-lock8.runquiet >> $@ && echo -n ',' >> $@ 207 +make mutexStmt-no-stmt-lock1.runquiet >> $@ && echo -n ',' >> $@ 208 +make mutexStmt-no-stmt-lock2.runquiet >> $@ && echo -n ',' >> $@ 209 +make mutexStmt-no-stmt-lock4.runquiet >> $@ && echo -n ',' >> $@ 210 +make mutexStmt-no-stmt-lock8.runquiet >> $@ && echo -n ',' >> $@ 211 +make mutexStmt-monitor1.runquiet >> $@ && echo -n ',' >> $@ 212 +make mutexStmt-monitor2.runquiet >> $@ && echo -n ',' >> $@ 213 +make mutexStmt-monitor4.runquiet >> $@ 214 $(srcdir)/fixcsv.sh $@ 215 199 216 schedint.csv: 200 217 echo "building $@" … … 357 374 ## ========================================================================================================= 358 375 376 mutexStmt$(EXEEXT) : \ 377 mutexStmt-cpp1.run \ 378 mutexStmt-cpp2.run \ 379 mutexStmt-cpp4.run \ 380 mutexStmt-cpp8.run \ 381 mutexStmt-java.run \ 382 mutexStmt-lock1.run \ 383 mutexStmt-lock2.run \ 384 mutexStmt-lock4.run \ 385 mutexStmt-lock8.run \ 386 mutexStmt-no-stmt-lock1.run \ 387 mutexStmt-no-stmt-lock2.run \ 388 mutexStmt-no-stmt-lock4.run \ 389 mutexStmt-no-stmt-lock8.run \ 390 mutexStmt-monitor1.run \ 391 mutexStmt-monitor2.run \ 392 mutexStmt-monitor4.run 393 394 mutexStmt-lock1$(EXEEXT): 395 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutexStmt/lock1.cfa 396 397 mutexStmt-lock2$(EXEEXT): 398 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutexStmt/lock2.cfa 399 400 mutexStmt-lock4$(EXEEXT): 401 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutexStmt/lock4.cfa 402 403 mutexStmt-lock8$(EXEEXT): 404 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutexStmt/lock8.cfa 405 406 mutexStmt-cpp1$(EXEEXT): 407 $(BENCH_V_CXX)$(CXXCOMPILE) -std=c++17 $(srcdir)/mutexStmt/cpp1.cc 408 409 mutexStmt-cpp2$(EXEEXT): 410 $(BENCH_V_CXX)$(CXXCOMPILE) -std=c++17 $(srcdir)/mutexStmt/cpp2.cc 411 412 mutexStmt-cpp4$(EXEEXT): 413 $(BENCH_V_CXX)$(CXXCOMPILE) -std=c++17 $(srcdir)/mutexStmt/cpp4.cc 414 415 mutexStmt-cpp8$(EXEEXT): 416 $(BENCH_V_CXX)$(CXXCOMPILE) -std=c++17 $(srcdir)/mutexStmt/cpp8.cc 417 418 mutexStmt-monitor1$(EXEEXT): 419 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutexStmt/monitor1.cfa 420 421 mutexStmt-monitor2$(EXEEXT): 422 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutexStmt/monitor2.cfa 423 424 mutexStmt-monitor4$(EXEEXT): 425 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutexStmt/monitor4.cfa 426 427 mutexStmt-no-stmt-lock1$(EXEEXT): 428 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutexStmt/no_stmt_lock1.cfa 429 430 mutexStmt-no-stmt-lock2$(EXEEXT): 431 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutexStmt/no_stmt_lock2.cfa 432 433 mutexStmt-no-stmt-lock4$(EXEEXT): 434 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutexStmt/no_stmt_lock4.cfa 435 436 mutexStmt-no-stmt-lock8$(EXEEXT): 437 $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutexStmt/no_stmt_lock8.cfa 438 439 mutexStmt-java$(EXEEXT): 440 $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutexStmt/JavaThread.java 441 echo "#!/bin/sh" > a.out 442 echo "java JavaThread \"$$""@\"" >> a.out 443 chmod a+x a.out 444 445 ## ========================================================================================================= 446 359 447 schedint$(EXEEXT) : \ 360 448 schedint-cfa1.run \ … … 524 612 ## ========================================================================================================= 525 613 526 %-tokio$(EXEEXT): $(srcdir)/readyQ/%.rs $(srcdir)/bench.rs 527 cd $(builddir) && cargo build --release 528 cp $(builddir)/target/release/$(basename $@) $@ 614 RDQBENCHES = \ 615 rdq-cycle-cfa \ 616 rdq-cycle-tokio \ 617 rdq-cycle-go \ 618 rdq-cycle-fibre \ 619 rdq-yield-cfa \ 620 rdq-yield-tokio \ 621 rdq-yield-go \ 622 rdq-yield-fibre \ 623 rdq-locality-cfa \ 624 rdq-locality-tokio \ 625 rdq-locality-go \ 626 rdq-locality-fibre \ 627 rdq-transfer-cfa \ 628 rdq-transfer-tokio \ 629 rdq-transfer-go \ 630 rdq-transfer-fibre 631 632 rdq-benches: 633 +make $(RDQBENCHES) 634 635 clean-rdq-benches: 636 rm -rf $(RDQBENCHES) $(builddir)/target go.mod 637 638 rdq-%-tokio$(EXEEXT): $(builddir)/target/release/rdq-%-tokio$(EXEEXT) 639 $(BENCH_V_RUSTC)cp $(builddir)/target/release/$(basename $@) $@ 640 641 $(builddir)/target/release/rdq-%-tokio$(EXEEXT): $(srcdir)/readyQ/%.rs $(srcdir)/bench.rs 642 $(BENCH_V_RUSTC)cd $(builddir) && cargo build --release 643 644 rdq-%-cfa$(EXEEXT): $(srcdir)/readyQ/%.cfa $(srcdir)/readyQ/rq_bench.hfa 645 $(BENCH_V_CFA)$(CFACOMPILE) $< -o $@ 646 647 go.mod: 648 touch $@ 649 go mod edit -module=rdq.bench 650 go get golang.org/x/sync/semaphore 651 go get golang.org/x/text/language 652 go get golang.org/x/text/message 653 654 rdq-%-go$(EXEEXT): $(srcdir)/readyQ/%.go $(srcdir)/readyQ/bench.go go.mod 655 $(BENCH_V_GOC)go build -o $@ $< $(srcdir)/readyQ/bench.go 656 657 rdq-%-fibre$(EXEEXT): $(srcdir)/readyQ/%.cpp 658 $(BENCH_V_CXX)$(CXXCOMPILE) $< -o $@ -lfibre -std=c++17 $(AM_CFLAGS) 659 660 # ## ========================================================================================================= 661 662 CLEANFILES = $(RDQBENCHES) go.mod go.sum 663 664 clean-local: 665 -rm -rf target -
benchmark/bench.h
r4e28d2e9 r949339b 21 21 return 1000000000LL * ts.tv_sec + ts.tv_nsec; 22 22 } // bench_time 23 24 25 #if defined(__cforall) 26 struct test_spinlock { 27 volatile bool lock; 28 }; 29 30 static inline void lock( test_spinlock & this ) { 31 for ( ;; ) { 32 if ( (this.lock == 0) && (__atomic_test_and_set( &this.lock, __ATOMIC_ACQUIRE ) == 0) ) break; 33 } 34 } 35 36 static inline void unlock( test_spinlock & this ) { 37 __atomic_clear( &this.lock, __ATOMIC_RELEASE ); 38 } 39 #endif 23 40 24 41 #ifndef BENCH_N -
benchmark/bench.rs
r4e28d2e9 r949339b 1 1 use std::io::{self, Write}; 2 use std::option; 2 3 use std::sync::atomic::{AtomicU64, AtomicBool, Ordering}; 3 4 use std::time::{Instant,Duration}; 5 use std::u128; 4 6 5 7 use clap::{Arg, ArgMatches}; … … 27 29 28 30 impl BenchData { 29 pub fn new(options: ArgMatches, nthreads: usize ) -> BenchData {31 pub fn new(options: ArgMatches, nthreads: usize, default_it: option::Option<u64>) -> BenchData { 30 32 let (clock_mode, stop_count, duration) = if options.is_present("iterations") { 31 33 (false, 32 34 options.value_of("iterations").unwrap().parse::<u64>().unwrap(), 35 -1.0) 36 } else if !default_it.is_none() { 37 (false, 38 default_it.unwrap(), 33 39 -1.0) 34 40 } else { … … 48 54 } 49 55 56 #[allow(dead_code)] 50 57 pub async fn wait(&self, start: &Instant) -> Duration{ 51 58 loop { … … 69 76 } 70 77 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
r4e28d2e9 r949339b 41 41 Fibre * threads[tthreads]; 42 42 Partner thddata[tthreads]; 43 for( inti = 0; i < tthreads; i++) {43 for(unsigned i = 0; i < tthreads; i++) { 44 44 unsigned pi = (i + nthreads) % tthreads; 45 45 thddata[i].next = &thddata[pi].self; 46 46 } 47 for( inti = 0; i < tthreads; i++) {47 for(unsigned 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( inti = 0; i < nthreads; i++) {55 for(unsigned i = 0; i < nthreads; i++) { 56 56 thddata[i].self.post(); 57 57 } … … 62 62 printf("\nDone\n"); 63 63 64 for( inti = 0; i < tthreads; i++) {64 for(unsigned i = 0; i < tthreads; i++) { 65 65 thddata[i].self.post(); 66 66 fibre_join( threads[i], nullptr ); -
benchmark/readyQ/cycle.go
r4e28d2e9 r949339b 60 60 atomic.StoreInt32(&stop, 1) 61 61 end := time.Now() 62 d elta:= end.Sub(start)62 duration := end.Sub(start) 63 63 64 64 fmt.Printf("\nDone\n") … … 74 74 75 75 p := message.NewPrinter(language.English) 76 p.Printf("Duration (ms) : % f\n", delta.Seconds());76 p.Printf("Duration (ms) : %d\n", duration.Milliseconds()) 77 77 p.Printf("Number of processors : %d\n", nprocs); 78 78 p.Printf("Number of threads : %d\n", tthreads); 79 79 p.Printf("Cycle size (# thrds) : %d\n", ring_size); 80 80 p.Printf("Total Operations(ops): %15d\n", global_counter) 81 p.Printf("Ops per second : %18.2f\n", float64(global_counter) / d elta.Seconds())82 p.Printf("ns per ops : %18.2f\n", float64(d elta.Nanoseconds()) / float64(global_counter))81 p.Printf("Ops per second : %18.2f\n", float64(global_counter) / duration.Seconds()) 82 p.Printf("ns per ops : %18.2f\n", float64(duration.Nanoseconds()) / float64(global_counter)) 83 83 p.Printf("Ops per threads : %15d\n", global_counter / uint64(tthreads)) 84 84 p.Printf("Ops per procs : %15d\n", global_counter / uint64(nprocs)) 85 p.Printf("Ops/sec/procs : %18.2f\n", (float64(global_counter) / float64(nprocs)) / d elta.Seconds())86 p.Printf("ns per ops/procs : %18.2f\n", float64(d elta.Nanoseconds()) / (float64(global_counter) / float64(nprocs)))85 p.Printf("Ops/sec/procs : %18.2f\n", (float64(global_counter) / float64(nprocs)) / duration.Seconds()) 86 p.Printf("ns per ops/procs : %18.2f\n", float64(duration.Nanoseconds()) / (float64(global_counter) / float64(nprocs))) 87 87 88 88 } -
benchmark/readyQ/cycle.rs
r4e28d2e9 r949339b 46 46 47 47 let tthreads = nthreads * ring_size; 48 let exp = Arc::new(bench::BenchData::new(options, tthreads ));48 let exp = Arc::new(bench::BenchData::new(options, tthreads, None)); 49 49 50 50 let s = (1000000 as u64).to_formatted_string(&Locale::en); -
benchmark/readyQ/locality.go
r4e28d2e9 r949339b 286 286 // Print with nice 's, i.e. 1'000'000 instead of 1000000 287 287 p := message.NewPrinter(language.English) 288 p.Printf("Duration ( s) : %f\n", delta.Seconds());288 p.Printf("Duration (ms) : %f\n", delta.Milliseconds()); 289 289 p.Printf("Number of processors : %d\n", nprocs); 290 290 p.Printf("Number of threads : %d\n", nthreads); -
benchmark/readyQ/locality.rs
r4e28d2e9 r949339b 124 124 return (r as *mut MyData, true); 125 125 } 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) { 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 ));287 let exp = Arc::new(bench::BenchData::new(options, nprocs, None)); 288 288 let mut results = Result::new(); 289 289 -
benchmark/readyQ/transfer.cfa
r4e28d2e9 r949339b 39 39 Pause(); 40 40 if( (timeHiRes() - start) > 5`s ) { 41 print_stats_now( bench_cluster, CFA_STATS_READY_Q | CFA_STATS_IO ); 41 42 serr | "Programs has been blocked for more than 5 secs"; 42 43 exit(1); … … 110 111 cfa_option opt[] = { 111 112 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} 113 114 }; 114 115 BENCH_OPT_PARSE("cforall transition benchmark"); … … 166 167 } 167 168 168 sout | "Duration : " | ws(3, 3, unit(eng((end - start)`ds))) | 's';169 sout | "Duration (ms) : " | ws(3, 3, unit(eng((end - start)`dms))); 169 170 sout | "Number of processors : " | nprocs; 170 171 sout | "Number of threads : " | nthreads; -
benchmark/readyQ/transfer.cpp
r4e28d2e9 r949339b 173 173 } 174 174 175 std::cout << "Duration : " << to_miliseconds(end - start) << "ms"<< std::endl;175 std::cout << "Duration (ms) : " << to_miliseconds(end - start) << std::endl; 176 176 std::cout << "Number of processors : " << nprocs << std::endl; 177 177 std::cout << "Number of threads : " << nthreads << std::endl; -
benchmark/readyQ/yield.cfa
r4e28d2e9 r949339b 80 80 } 81 81 82 printf("Took %'ld ms\n", (end - start)`ms); 82 printf("Duration (ms) : %'ld\n", (end - start)`dms); 83 printf("Number of processors: %'d\n", nprocs); 84 printf("Number of threads : %'d\n", nthreads); 85 printf("Total yields : %'15llu\n", global_counter); 83 86 printf("Yields per second : %'18.2lf\n", ((double)global_counter) / (end - start)`s); 84 87 printf("ns per yields : %'18.2lf\n", ((double)(end - start)`ns) / global_counter); 85 printf("Total yields : %'15llu\n", global_counter);86 88 printf("Yields per procs : %'15llu\n", global_counter / nprocs); 87 89 printf("Yields/sec/procs : %'18.2lf\n", (((double)global_counter) / nprocs) / (end - start)`s); -
benchmark/readyQ/yield.cpp
r4e28d2e9 r949339b 154 154 155 155 auto dur_nano = duration_cast<std::nano>(duration); 156 auto dur_dms = duration_cast<std::milli>(duration); 156 157 157 std::cout << "Took " << duration << " s\n";158 printf("Duration (ms) : %'.2lf\n", dur_dms ); 158 159 printf("Total yields : %'15llu\n", global_counter ); 159 160 printf("Yields per procs : %'15llu\n", global_counter / nprocs ); -
benchmark/rmit.py
r4e28d2e9 r949339b 16 16 import random 17 17 import re 18 import socket 18 19 import subprocess 19 20 import sys … … 95 96 return nopts 96 97 98 # returns the first option with key 'opt' 99 def search_option(action, opt): 100 i = 0 101 while i < len(action): 102 if action[i] == opt: 103 i += 1 104 if i != len(action): 105 return action[i] 106 i += 1 107 108 return None 109 97 110 def actions_eta(actions): 98 111 time = 0 99 112 for a in actions: 100 i = 0 101 while i < len(a): 102 if a[i] == '-d': 103 i += 1 104 if i != len(a): 105 time += int(a[i]) 106 i += 1 113 o = search_option(a, '-d') 114 if o : 115 time += int(o) 107 116 return time 117 118 taskset_maps = None 119 120 def init_taskset_maps(): 121 global taskset_maps 122 known_hosts = { 123 "jax": { 124 range( 1, 24) : "48-71", 125 range( 25, 48) : "48-71,144-167", 126 range( 49, 96) : "48-95,144-191", 127 range( 97, 144) : "24-95,120-191", 128 range(145, 192) : "0-95,96-191", 129 }, 130 } 131 132 if (host := socket.gethostname()) in known_hosts: 133 taskset_maps = known_hosts[host] 134 return True 135 136 print("Warning unknown host '{}', disable taskset usage".format(host), file=sys.stderr) 137 return False 138 139 140 def settaskset_one(action): 141 o = search_option(action, '-p') 142 if not o: 143 return action 144 try: 145 oi = int(o) 146 except ValueError: 147 return action 148 149 m = "Not found" 150 for key in taskset_maps: 151 if oi in key: 152 return ['taskset', '-c', taskset_maps[key], *action] 153 154 print("Warning no mapping for {} cores".format(oi), file=sys.stderr) 155 return action 156 157 def settaskset(actions): 158 return [settaskset_one(a) for a in actions] 108 159 109 160 if __name__ == "__main__": … … 115 166 parser.add_argument('--file', nargs='?', type=argparse.FileType('w'), default=sys.stdout) 116 167 parser.add_argument('--trials', help='Number of trials to run per combinaison', type=int, default=3) 168 parser.add_argument('--notaskset', help='If specified, the trial will not use taskset to match the -p option', action='store_true') 117 169 parser.add_argument('command', metavar='command', type=str, nargs=1, help='the command prefix to run') 118 170 parser.add_argument('candidates', metavar='candidates', type=str, nargs='*', help='the candidate suffix to run') … … 170 222 171 223 # ================================================================================ 172 # Figure out all the combinations to run 224 # Fixup the different commands 225 226 # Add tasksets 227 withtaskset = False 228 if not options.notaskset and init_taskset_maps(): 229 withtaskset = True 230 actions = settaskset(actions) 231 232 # ================================================================================ 233 # Now that we know what to run, print it. 234 # find expected time 235 time = actions_eta(actions) 236 print("Running {} trials{}".format(len(actions), "" if time == 0 else " (expecting to take {})".format(str(datetime.timedelta(seconds=int(time)))) )) 237 238 # dry run if options ask for it 173 239 if options.list: 174 240 for a in actions: … … 180 246 # Prepare to run 181 247 182 # find expected time183 time = actions_eta(actions)184 print("Running {} trials{}".format(len(actions), "" if time == 0 else " (expecting to take {})".format(str(datetime.timedelta(seconds=int(time)))) ))185 186 248 random.shuffle(actions) 187 249 … … 191 253 first = True 192 254 for i, a in enumerate(actions): 193 sa = " ".join(a )255 sa = " ".join(a[3:] if withtaskset else a) 194 256 if first: 195 257 first = False … … 208 270 match = re.search("^(.*):(.*)$", s) 209 271 if match: 210 fields[match.group(1).strip()] = float(match.group(2).strip().replace(',','')) 211 212 options.file.write(json.dumps([a[0][2:], sa, fields])) 272 try: 273 fields[match.group(1).strip()] = float(match.group(2).strip().replace(',','')) 274 except: 275 pass 276 277 options.file.write(json.dumps([a[3 if withtaskset else 0][2:], sa, fields])) 213 278 options.file.flush() 214 279
Note:
See TracChangeset
for help on using the changeset viewer.