Commit ee9911a0 authored by Maxim Onciul's avatar Maxim Onciul
Browse files

measured time of experiment, fixed some inconsistency.

parent 79b12422
......@@ -16,21 +16,36 @@ import pandas as pd
tempdir = os.path.join(gettempdir(), "ty82xile")
os.makedirs(tempdir, exist_ok=True)
param_grid = ParameterGrid(
{
# "repeat": [0] * 3,
"num_runs": [1],
"k": ["8"],
"m": ["128"],
# "m": ["32"],
"l": ["6"],
"d": ["110"],
# "d": ["31", "25", "20"],
"rx": [0, 1],
"b": ["0"],
# "b": ["0", "1", "5", "10", "20"],
"B": ["10"],
# "B": ["10", "20", "50"],
}
[
{
# "repeat": [0] * 3,
"num_runs": [50],
"k": ["8"],
# "m": ["64"],
"m": ["64"],
"l": ["6"],
"d": ["60"],
# "d": ["31", "25", "20"],
"rx": [0, 1],
"b": ["5"],
# "b": ["0", "1", "5", "10", "20"],
"B": ["10"],
# "B": ["10", "20", "50"],
},
{
# "repeat": [0] * 3,
"num_runs": [50],
"k": ["8"],
"m": ["128"],
"l": ["7"],
"d": ["110"],
"rx": [0, 1],
"b": ["5"],
# "b": ["0", "1", "5", "10", "20"],
"B": ["10"],
# "B": ["10", "20", "50"],
},
]
)
ips = ["maximPi1", "maximPi2"]
......@@ -125,7 +140,12 @@ 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):
def clean_remotes(conf, clients):
for client in clients:
client.sendline(f"rm -rf /home/pi/pi_files/exps/{conf['exp']}")
def count_errs(conf, clients):
rx, tx = ips[conf["rx"]], ips[conf["rx"] ^ 1]
source = f"pi@{tx}:/home/pi/pi_files/exps/{conf['exp']}/data"
......@@ -141,6 +161,8 @@ def count_errs(conf):
for n in range(conf["num_runs"]):
subprocess.run(["scp", f"{remote}_{n}", f"{file}_{n}"])
clean_remotes(conf, clients)
return cmp_families(*files[:2], conf["num_runs"]), cmp_families(
*files[2:], conf["num_runs"]
)
......@@ -194,7 +216,7 @@ def run_experiment(clients: List[pxssh.pxssh], conf: Dict[str, str]):
conf["d"],
conf["b"],
conf["B"],
*count_errs(conf),
*count_errs(conf, clients),
float(write_exp_description(conf, fname)),
ips[conf["rx"] ^ 1],
ips[conf["rx"]],
......
#!/usr/bin/env python3
from contextlib import ContextDecorator
import time
import pexpect as pe
......@@ -21,8 +22,10 @@ class MeasurePi(ContextDecorator):
def __init__(self, logfile: str = "picocom.log"):
self.logfile = logfile
self.process = None
self.time = None
def __enter__(self) -> None:
self.time = time.time()
self.process = pe.spawn(_PROG, _ARGS, encoding="utf-8", codec_errors="replace")
idx = self.process.expect([_START, pe.TIMEOUT], timeout=1)
if idx != 0:
......@@ -60,3 +63,4 @@ class MeasurePi(ContextDecorator):
print("Timeout, killing process...")
self.process.close()
print("Killed process.")
print(f"Took: {time.time() - self.time}")
# Measure setup
Resistor: 0.1 Ohm
Resistor: 0.1 Ohm (True: 0.15 Ohm, wahrscheinlich wegen Kabel & Lötstellen)
LTC2991CMS sollte Spannungsabfall beachten
Sampling: alle 16ms
Bei den ersten beiden Messungen bekomme ich schlüssige Werte.
Danach bekomme ich: 30'882.0 uJ
Dieser Wert ist "immer" der erste Wert nach einem soft-Reset am uController mit "0".
Die vermessenen Programme laufen etwa je 1.8/1.9 Sekunden - Faktor 100 w.r.t. Samplerate.
Ausserdem werden einige Dateien bei der Auswertung vermisst.
[20-25] data-files werden vermisst. aargh.
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