Commit 421e9f77 authored by Maxim Onciul's avatar Maxim Onciul
Browse files

blah

parent 8718dc85
......@@ -18,11 +18,12 @@ os.makedirs(tempdir, exist_ok=True)
param_grid = ParameterGrid(
{
# "repeat": [0] * 3,
"num_runs": [5],
"num_runs": [1],
"k": ["8"],
"m": ["32"],
"l": ["5"],
"d": ["31"],
"m": ["128"],
# "m": ["32"],
"l": ["6"],
"d": ["110"],
# "d": ["31", "25", "20"],
"rx": [0, 1],
"b": ["0"],
......@@ -111,15 +112,18 @@ def cmp_two_files(file1, file2):
s_all = sf.read().splitlines()
r_all = rf.read().splitlines()
try:
return sum(
min(cmp_two_lines(fix_line, dyn_line) for dyn_line in s_all)
for fix_line in r_all
)
except ValueError:
print(f"source:\n{s_all}\n\nother:\n{r_all}")
if len(s_all) == 0 or len(r_all) == 0:
return 0
return sum(
min(cmp_two_lines(fix_line, dyn_line) for dyn_line in s_all)
for fix_line in r_all
)
def cmp_families(fam1, fam2, num):
return sum(cmp_two_files(f"{fam1}_{n}", f"{fam2}_{n}") for n in range(num))
def count_errs(conf):
rx, tx = ips[conf["rx"]], ips[conf["rx"] ^ 1]
......@@ -134,9 +138,12 @@ def count_errs(conf):
files = [f"{tempdir}/{file}" for file in ["data", "reconst", "cipher", "corrupt"]]
for file, remote in zip(files, remotes):
subprocess.run(["scp", remote, file])
for n in range(conf["num_runs"]):
subprocess.run(["scp", f"{remote}_{n}", f"{file}_{n}"])
return cmp_two_files(*files[:2]), cmp_two_files(*files[2:])
return cmp_families(*files[:2], conf["num_runs"]), cmp_families(
*files[2:], conf["num_runs"]
)
def run_experiment(clients: List[pxssh.pxssh], conf: Dict[str, str]):
......@@ -162,11 +169,19 @@ def run_experiment(clients: List[pxssh.pxssh], conf: Dict[str, str]):
f'{pi_dir}/pi_receive.py {conf["exp"]} {conf["k"]} {conf["l"]} {conf["d"]} {conf["m"]} {conf["b"]} {conf["B"]} {conf["num_runs"]}'
)
print(
f'{pi_dir}/pi_receive.py {conf["exp"]} {conf["k"]} {conf["l"]} {conf["d"]} {conf["m"]} {conf["b"]} {conf["B"]} {conf["num_runs"]}'
)
# start sender
tx.sendline(
f'{pi_dir}/pi_send.py {conf["exp"]} {conf["k"]} {conf["l"]} {conf["d"]} {conf["m"]} {conf["b"]} {conf["B"]} {conf["num_runs"]}'
)
print(
f'{pi_dir}/pi_send.py {conf["exp"]} {conf["k"]} {conf["l"]} {conf["d"]} {conf["m"]} {conf["b"]} {conf["B"]} {conf["num_runs"]}'
)
# collect sender
tx.prompt()
# collect receiver
......
# Measure setup
Resistor: 0.1 Ohm
LTC2991CMS sollte Spannungsabfall beachten
Sampling: alle 16ms
Supports Markdown
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