diff --git a/messung/motor/pruef6/sharingan/nacht.py b/messung/motor/pruef6/sharingan/nacht.py index 617a47ca..c4e9cabb 100644 --- a/messung/motor/pruef6/sharingan/nacht.py +++ b/messung/motor/pruef6/sharingan/nacht.py @@ -45,9 +45,29 @@ def schlange(): def pfad(j): + if j["name"].startswith("exakt:"): # exakte Nachrechnung (exakt6.py) der Variante gegen die Grundseite derselben Exe + return os.path.join(HIER, "daten", "exakt", "%s--%s--%s.jsonl" % (j["zelle"], j["exe"].replace(".exe", ""), j["name"][6:])) return os.path.join(DATEN, "%s--%s--%s.jsonl" % (j["zelle"], j["exe"].replace(".exe", ""), j["name"])) +def tisch(j, name): + """Die Tisch-Zeile (Variante oder Grundseite) zu einer exakt-Zeile.""" + return next((x for x in schlange() if x["name"] == name and x["zelle"] == j["zelle"] and x["exe"] == j["exe"]), None) + + +def fertig(j): + if j["name"].startswith("exakt:"): + return os.path.exists(pfad(j)[:-6] + ".json") + return zeilen(pfad(j)) >= soll(j) + + +def bereit(j): + if not j["name"].startswith("exakt:"): + return True + v, b = tisch(j, j["name"][6:]), tisch(j, "basis") + return bool(v and b and fertig(v) and fertig(b)) + + def soll(j): n, k = TF.ZELLEN[j["zelle"]][:2] return j["blaetter"] * n * k @@ -89,7 +109,17 @@ def laufende_aus(): o = subprocess.run(["powershell", "-NoProfile", "-c", "Get-CimInstance Win32_Process -Filter \"Name='bash.exe'\" | ForEach-Object { $_.CommandLine }"], capture_output=True, text=True, encoding="utf-8", errors="replace").stdout - return {z.split("lauf.sh", 1)[1].split()[0].strip('"') for z in o.splitlines() if "lauf.sh" in z and len(z.split("lauf.sh", 1)[1].split())} + da = {z.split("lauf.sh", 1)[1].split()[0].strip('"') for z in o.splitlines() if "lauf.sh" in z and len(z.split("lauf.sh", 1)[1].split())} + o = subprocess.run(["powershell", "-NoProfile", "-c", + "Get-CimInstance Win32_Process -Filter \"Name='python.exe'\" | ForEach-Object { $_.CommandLine }"], + capture_output=True, text=True, encoding="utf-8", errors="replace").stdout + for z in o.splitlines(): + t = z.split("exakt6.py", 1)[1].split() if "exakt6.py" in z else [] + if len(t) >= 2: + v = os.path.basename(t[1].strip('"')).split("--") + if len(v) == 3: + da.add("exakt/%s--%s--%s" % (t[0].strip('"'), v[1], v[2][:-6])) + return da def lauf(): @@ -109,7 +139,7 @@ def lauf(): if pfad(j) not in laufend and aus_von(pfad(j)) in da: laufend[pfad(j)] = (None, kosten(j)) print(time.strftime("%H:%M"), "uebernommen", os.path.basename(pfad(j)), file=log, flush=True) - offen = [j for j in schlange() if pfad(j) not in laufend and zeilen(pfad(j)) < soll(j)] + offen = [j for j in schlange() if pfad(j) not in laufend and not fertig(j) and bereit(j)] if os.path.exists(os.path.join(ORDNER, "STOP")): offen = [] if not offen and not laufend: @@ -118,6 +148,15 @@ def lauf(): if offen and belegt + kosten(offen[0]) <= FAEDEN and frei_gb() >= 20 and __import__("shutil").disk_usage("D:/").free >= 3e9: j = offen[0] p = pfad(j) + if j["name"].startswith("exakt:"): # setzt selbst fort (je gekippte Hand eine Zeile) + v, b = tisch(j, j["name"][6:]), tisch(j, "basis") + envs = [" ".join("%s=%s" % kv for kv in x["env"].items()) for x in (v, b)] + q = subprocess.Popen([sys.executable, os.path.join(HIER, "exakt6.py"), j["zelle"], pfad(v), pfad(b), j["exe"], envs[0], j["exe"], + envs[1]], cwd=HIER, stdout=open(p[:-6] + ".log", "a"), stderr=subprocess.STDOUT, creationflags=0x4000) + laufend[p] = (q, kosten(j)) + print(time.strftime("%H:%M"), "start", os.path.basename(p), "Faeden %d/%d" % (belegt + kosten(j), FAEDEN), file=log, flush=True) + time.sleep(60) + continue if os.path.exists(p): os.remove(p) # halbe Zelle: neu (tisch6 faengt bei Blatt 0 an) n, k, y, saat, _, _ = TF.ZELLEN[j["zelle"]] @@ -138,7 +177,11 @@ def auswerten(): """Je Disziplin und Exe: Variante minus Grundseite derselben Exe, gepaart je Blatt (gemeinsame vollstaendige Blaetter).""" sys.stdout.reconfigure(encoding="utf-8") gruppen = {} + exakte = [] for j in schlange(): + if j["name"].startswith("exakt:"): + exakte.append(j) + continue gruppen.setdefault((j["zelle"], j["exe"]), []).append(j) zeilen_ = [] for (zelle, exe), js in sorted(gruppen.items()): diff --git a/messung/motor/pruef6/sharingan/nacht/warteschlange.txt b/messung/motor/pruef6/sharingan/nacht/warteschlange.txt index 715e4244..5d9d4b84 100644 --- a/messung/motor/pruef6/sharingan/nacht/warteschlange.txt +++ b/messung/motor/pruef6/sharingan/nacht/warteschlange.txt @@ -40,6 +40,14 @@ basis | sh-3v3 | 100 | pokerbench-pruef6-sammelkorb.exe | MOTOR_FLOPBLUFF=0 MOTO buendel_a | sh-3v3 | 100 | pokerbench-pruef6-sammelkorb.exe | MOTOR_FLOPBLUFF=0 MOTOR_LUFT=0 MOTOR_KAPPE=0.4 MOTOR_OHNE_TYPFOLD=1 MOTOR_RIVERFOLD=1 basis | shs-3v3 | 60 | pokerbench-pruef6-husuche.exe | MOTOR_FLOPBLUFF=0 MOTOR_LUFT=0 riverbreit | shs-3v3 | 60 | pokerbench-pruef6-husuche.exe | MOTOR_FLOPBLUFF=0 MOTOR_LUFT=0 MOTOR_SUCHE_RIVER=breit +# === Stufe 1 exakt (exakt6.py, Orchestrator 28.11.): auf den fertigen Blaettern, keine neuen Tische === +exakt:buendel_a | sh-3v3 | 0 | pokerbench-pruef6-sammelkorb.exe | +exakt:floploeser | sh-3v3 | 0 | pokerbench-flopsuche-floploeser.exe | +exakt:breit | sh-3v3 | 0 | pokerbench-pruef6-nachtlive.exe | +exakt:boden03 | sh-3v3 | 0 | pokerbench-pruef6-nachtlive.exe | +exakt:strassen0 | sh-3v3 | 0 | pokerbench-pruef6-nachtlive.exe | +exakt:turn03 | shs-3v3 | 0 | pokerbench-pruef6-nachtlive.exe | +exakt:riverbreit | shs-3v3 | 0 | pokerbench-pruef6-husuche.exe | # === Stufe 2 (28.11.): frische Blaetter, Saat 41 (3v3) / 44 (3v3 mit Suche); Kandidaten aus Stufe 1 und Kombinationen === #basis | sh-3v3-t2 | 200 | pokerbench-pruef6-nachtlive.exe | MOTOR_FLOPBLUFF=0 MOTOR_LUFT=0 #basis | sh-3v3-t2 | 200 | pokerbench-pruef6-sammelkorb.exe | MOTOR_FLOPBLUFF=0 MOTOR_LUFT=0