From cbe23670192ebbbaefcf3616c842d1b6c73039ea Mon Sep 17 00:00:00 2001 From: GuillaumeDIDIER Date: Fri, 3 Jul 2020 10:27:49 +0200 Subject: [PATCH] Add warm-up, calibrate more core pairs, to supersed original calibration --- cache_utils/src/bin/two_thread_cal.rs | 7 ++++++- cache_utils/src/calibration.rs | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/cache_utils/src/bin/two_thread_cal.rs b/cache_utils/src/bin/two_thread_cal.rs index 707f534..b97875d 100644 --- a/cache_utils/src/bin/two_thread_cal.rs +++ b/cache_utils/src/bin/two_thread_cal.rs @@ -98,7 +98,12 @@ fn main() { println!("{},{}", 0, i); } i = i << 1; - + } + for i in 1..CpuSet::count() { + if old.is_set(i).unwrap() { + core_pairs.push((i, 0)); + println!("{},{}", i, 0); + } } // operations diff --git a/cache_utils/src/calibration.rs b/cache_utils/src/calibration.rs index e66729f..1c73bf6 100644 --- a/cache_utils/src/calibration.rs +++ b/cache_utils/src/calibration.rs @@ -560,11 +560,12 @@ fn calibrate_fixed_freq_2_thread_impl>( for (main_core, helper_core) in cores { // set main thread affinity - if verbosity_level >= Thresholds { println!("Calibration for main_core {}, helper {}.", main_core, helper_core); } + eprintln!("Calibration for main_core {}, helper {}.", main_core, helper_core); + let mut core = CpuSet::new(); match core.set(main_core) { Ok(_) => {}, @@ -627,6 +628,11 @@ fn calibrate_fixed_freq_2_thread_impl>( for op in operations { helper_thread_params.op.store(op.prepare, Ordering::Relaxed); let mut hist = vec![0; hist_params.bucket_number]; + for _ in 0..hist_params.iterations { + next(&helper_thread_params.turn); + wait(&helper_thread_params.turn, false); + let _time = unsafe { (op.op)(pointer) }; + } for _ in 0..hist_params.iterations { next(&helper_thread_params.turn); wait(&helper_thread_params.turn, false);