From e1c5a2fa23c306bb7ff052830d075d87ae240db2 Mon Sep 17 00:00:00 2001 From: augustin64 Date: Thu, 20 Jun 2024 14:16:54 +0200 Subject: [PATCH] calibrate_2T: Add "count" stat & increase BUCKET_COUNT --- cache_utils/src/calibrate_2t.rs | 8 ++++++-- cache_utils/src/calibration.rs | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cache_utils/src/calibrate_2t.rs b/cache_utils/src/calibrate_2t.rs index 4597695..cfe917c 100644 --- a/cache_utils/src/calibrate_2t.rs +++ b/cache_utils/src/calibrate_2t.rs @@ -231,6 +231,7 @@ fn calibrate_fixed_freq_2_thread_impl, T>( median: vec![0; operations.len()], min: vec![0; operations.len()], max: vec![0; operations.len()], + count: vec![0; operations.len()], }; calibrate_result.histogram.reserve(operations.len()); @@ -293,11 +294,13 @@ fn calibrate_fixed_freq_2_thread_impl, T>( let min = &mut calibrate_result.min[op]; let max = &mut calibrate_result.max[op]; let med = &mut calibrate_result.median[op]; + let count = &mut calibrate_result.count[op]; let sum = &mut sums[op]; if options.verbosity >= RawResult { print!(",{}", hist); } + *count += 1; if *min == 0 { // looking for min if *hist > SPURIOUS_THRESHOLD { @@ -321,11 +324,12 @@ fn calibrate_fixed_freq_2_thread_impl, T>( if options.verbosity >= Thresholds { for (j, op) in operations.iter().enumerate() { println!( - "{}: min {}, median {}, max {}", + "{}: min {}, median {}, max {}, count {}", op.display_name, calibrate_result.min[j], calibrate_result.median[j], - calibrate_result.max[j] + calibrate_result.max[j], + calibrate_result.count[j], ); } print!("CSV: {},{},{:p}, ", main_core, helper_core, pointer); diff --git a/cache_utils/src/calibration.rs b/cache_utils/src/calibration.rs index 3ac3a93..b72646b 100644 --- a/cache_utils/src/calibration.rs +++ b/cache_utils/src/calibration.rs @@ -197,7 +197,7 @@ pub fn calibrate_access(array: &[u8; 4096]) -> u64 { } pub const CFLUSH_BUCKET_SIZE: usize = 1; -pub const CFLUSH_BUCKET_NUMBER: usize = 500; +pub const CFLUSH_BUCKET_NUMBER: usize = 1000; pub const CFLUSH_NUM_ITER: u32 = 1 << 10; pub const CLFLUSH_NUM_ITERATION_AV: u32 = 1 << 8; @@ -246,6 +246,7 @@ pub struct CalibrateResult { pub median: Vec, pub min: Vec, pub max: Vec, + pub count: Vec } pub struct CalibrateOperation<'a> { @@ -384,6 +385,7 @@ fn calibrate_impl_fixed_freq( median: vec![0; operations.len()], min: vec![0; operations.len()], max: vec![0; operations.len()], + count: vec![0; operations.len()], }; calibrate_result.histogram.reserve(operations.len()); @@ -419,11 +421,13 @@ fn calibrate_impl_fixed_freq( let min = &mut calibrate_result.min[op]; let max = &mut calibrate_result.max[op]; let med = &mut calibrate_result.median[op]; + let count = &mut calibrate_result.count[op]; let sum = &mut sums[op]; if verbosity_level >= RawResult { print!(",{}", hist); } - + + *count += 1; if *min == 0 { // looking for min if *hist > SPURIOUS_THRESHOLD {