Unverified Commit b16f8e95 authored by dwuggh's avatar dwuggh
Browse files

add cpu number check

parent b2c9dd9b
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "aho-corasick"
version = "0.7.15"
......@@ -432,6 +434,7 @@ dependencies = [
"fastrand",
"libc",
"log",
"num_cpus",
"petgraph",
"rand",
"rayon",
......
......@@ -17,3 +17,4 @@ fastrand = "1.4.1"
clap = "3.0.0-beta.2"
rayon = "1.5"
libc = "0.2"
num_cpus = "1.13"
......@@ -55,6 +55,11 @@ fn main() {
.arg(Arg::new("channel").about("channel"))
.get_matches();
let cpus = num_cpus::get();
let cpus_physical = num_cpus::get_physical();
println!("using cpu number: {}, physical cpu number: {}", cpus, cpus_physical);
let xn = matches.value_of("xn").unwrap().parse::<usize>().unwrap();
let zm = matches.value_of("zm").unwrap().parse::<usize>().unwrap();
let measure_rounds = matches
......@@ -83,6 +88,7 @@ fn main() {
m_correct[0] = 1. - pm;
let mut m_error = vec![0.; 256];
m_error[0] = pm;
log::info!("pure measurement error: {} {}", m_correct[0], m_error[0]);
(m_correct, m_error)
} else {
load_channel_coeffs_from_file(channel)
......@@ -95,6 +101,7 @@ fn main() {
// m_error[0] = pm;
let measure_model = error::MeasureNoiseModel::new(m_correct, m_error);
log::info!("success prob: {}", measure_model.success.prob_sum);
let result: Vec<usize> = (0..rounds)
.into_par_iter()
.map(|_| runner2(xn, zm, measure_rounds, measure_model.clone(), p1))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment