calibrate_2T: Add "count" stat & increase BUCKET_COUNT

This commit is contained in:
augustin64 2024-06-20 14:16:54 +02:00
parent 340fc5b7ee
commit e1c5a2fa23
2 changed files with 12 additions and 4 deletions

View File

@ -231,6 +231,7 @@ fn calibrate_fixed_freq_2_thread_impl<I: Iterator<Item = (usize, usize)>, T>(
median: vec![0; operations.len()], median: vec![0; operations.len()],
min: vec![0; operations.len()], min: vec![0; operations.len()],
max: vec![0; operations.len()], max: vec![0; operations.len()],
count: vec![0; operations.len()],
}; };
calibrate_result.histogram.reserve(operations.len()); calibrate_result.histogram.reserve(operations.len());
@ -293,11 +294,13 @@ fn calibrate_fixed_freq_2_thread_impl<I: Iterator<Item = (usize, usize)>, T>(
let min = &mut calibrate_result.min[op]; let min = &mut calibrate_result.min[op];
let max = &mut calibrate_result.max[op]; let max = &mut calibrate_result.max[op];
let med = &mut calibrate_result.median[op]; let med = &mut calibrate_result.median[op];
let count = &mut calibrate_result.count[op];
let sum = &mut sums[op]; let sum = &mut sums[op];
if options.verbosity >= RawResult { if options.verbosity >= RawResult {
print!(",{}", hist); print!(",{}", hist);
} }
*count += 1;
if *min == 0 { if *min == 0 {
// looking for min // looking for min
if *hist > SPURIOUS_THRESHOLD { if *hist > SPURIOUS_THRESHOLD {
@ -321,11 +324,12 @@ fn calibrate_fixed_freq_2_thread_impl<I: Iterator<Item = (usize, usize)>, T>(
if options.verbosity >= Thresholds { if options.verbosity >= Thresholds {
for (j, op) in operations.iter().enumerate() { for (j, op) in operations.iter().enumerate() {
println!( println!(
"{}: min {}, median {}, max {}", "{}: min {}, median {}, max {}, count {}",
op.display_name, op.display_name,
calibrate_result.min[j], calibrate_result.min[j],
calibrate_result.median[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); print!("CSV: {},{},{:p}, ", main_core, helper_core, pointer);

View File

@ -197,7 +197,7 @@ pub fn calibrate_access(array: &[u8; 4096]) -> u64 {
} }
pub const CFLUSH_BUCKET_SIZE: usize = 1; 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 CFLUSH_NUM_ITER: u32 = 1 << 10;
pub const CLFLUSH_NUM_ITERATION_AV: u32 = 1 << 8; pub const CLFLUSH_NUM_ITERATION_AV: u32 = 1 << 8;
@ -246,6 +246,7 @@ pub struct CalibrateResult {
pub median: Vec<u64>, pub median: Vec<u64>,
pub min: Vec<u64>, pub min: Vec<u64>,
pub max: Vec<u64>, pub max: Vec<u64>,
pub count: Vec<isize>
} }
pub struct CalibrateOperation<'a> { pub struct CalibrateOperation<'a> {
@ -384,6 +385,7 @@ fn calibrate_impl_fixed_freq(
median: vec![0; operations.len()], median: vec![0; operations.len()],
min: vec![0; operations.len()], min: vec![0; operations.len()],
max: vec![0; operations.len()], max: vec![0; operations.len()],
count: vec![0; operations.len()],
}; };
calibrate_result.histogram.reserve(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 min = &mut calibrate_result.min[op];
let max = &mut calibrate_result.max[op]; let max = &mut calibrate_result.max[op];
let med = &mut calibrate_result.median[op]; let med = &mut calibrate_result.median[op];
let count = &mut calibrate_result.count[op];
let sum = &mut sums[op]; let sum = &mut sums[op];
if verbosity_level >= RawResult { if verbosity_level >= RawResult {
print!(",{}", hist); print!(",{}", hist);
} }
*count += 1;
if *min == 0 { if *min == 0 {
// looking for min // looking for min
if *hist > SPURIOUS_THRESHOLD { if *hist > SPURIOUS_THRESHOLD {