Support microarchitecture for g5k experiments

This commit is contained in:
GuillaumeDIDIER 2020-06-02 17:29:55 +02:00
parent 6ae16cc6df
commit b0784fadf8
2 changed files with 6 additions and 1 deletions

View File

@ -30,7 +30,10 @@ pub fn cache_slicing(uarch: MicroArchitecture, physical_cores: u8) -> CacheSlici
| MicroArchitecture::CoffeeLake => { | MicroArchitecture::CoffeeLake => {
ComplexAddressing(&SANDYBRIDGE_TO_SKYLAKE_FUNCTIONS[0..((trailing_zeros + 1) as usize)]) ComplexAddressing(&SANDYBRIDGE_TO_SKYLAKE_FUNCTIONS[0..((trailing_zeros + 1) as usize)])
} }
MicroArchitecture::SandyBridge => { MicroArchitecture::SandyBridge
| MicroArchitecture::Haswell | MicroArchitecture::HaswellE
| MicroArchitecture::Broadwell
| MicroArchitecture::IvyBridge | MicroArchitecture::IvyBridgeE => {
ComplexAddressing(&SANDYBRIDGE_TO_SKYLAKE_FUNCTIONS[0..((trailing_zeros) as usize)]) ComplexAddressing(&SANDYBRIDGE_TO_SKYLAKE_FUNCTIONS[0..((trailing_zeros) as usize)])
} }
_ => Unsupported, _ => Unsupported,

View File

@ -15,6 +15,7 @@ use nix::unistd::Pid;
use nix::Error::Sys; use nix::Error::Sys;
use cache_utils::mmap::MMappedMemory; use cache_utils::mmap::MMappedMemory;
use cpuid::MicroArchitecture;
/* from linux kernel headers. /* from linux kernel headers.
#define HUGETLB_FLAG_ENCODE_SHIFT 26 #define HUGETLB_FLAG_ENCODE_SHIFT 26
@ -41,6 +42,7 @@ pub fn main() {
// Let's grab all the list of CPUS // Let's grab all the list of CPUS
// Then iterate the calibration on each CPU core. // Then iterate the calibration on each CPU core.
eprintln!("CPU MicroArch: {:?}", MicroArchitecture::get_micro_architecture());
eprint!("Warming up..."); eprint!("Warming up...");
for i in 0..(CpuSet::count() - 1) { for i in 0..(CpuSet::count() - 1) {
if old.is_set(i).unwrap() { if old.is_set(i).unwrap() {