From f7c171b7bc7b70f50d32f89d092ed73ef0fc144c Mon Sep 17 00:00:00 2001 From: GuillaumeDIDIER Date: Thu, 9 Jul 2020 13:36:27 +0200 Subject: [PATCH] Calibration on the full set of core pairs, reduce array size to compensate size increase --- cache_utils/src/bin/two_thread_cal.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/cache_utils/src/bin/two_thread_cal.rs b/cache_utils/src/bin/two_thread_cal.rs index b7eda2e..cb36b3c 100644 --- a/cache_utils/src/bin/two_thread_cal.rs +++ b/cache_utils/src/bin/two_thread_cal.rs @@ -96,17 +96,19 @@ fn main() { let mut core_pairs: Vec<(usize, usize)> = Vec::new(); let mut i = 1; let old = sched_getaffinity(Pid::from_raw(0)).unwrap(); - while i < CpuSet::count() { + /*while i < CpuSet::count() { if old.is_set(i).unwrap() { core_pairs.push((0, i)); 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); + }*/ + for i in 0..CpuSet::count() { + for j in 0..CpuSet::count() { + if old.is_set(i).unwrap() && old.is_set(j).unwrap() { + core_pairs.push((i, j)); + println!("{},{}", i, j); + } } } @@ -124,7 +126,7 @@ fn main() { calibrate_fixed_freq_2_thread( pointer, 64, - array.len() as isize, + array.len() as isize >> 3, &mut core_pairs.into_iter(), &[ CalibrateOperation2T {