Farm: feste Reihenfolge der Bitgleich-Auftraege (Klassen 1-4 vor 5, Klasse 5 hoechstens 3 Teile), Bau mit 8 Faeden

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Marc Mintel
2026-12-05 21:34:58 +01:00
co-authored by Claude Opus 5.5
parent 5dc4889882
commit 794f413d9f
2 changed files with 38 additions and 1 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ if modus == "einreichen":
tar = os.path.join(tmp, f"allinprobe-{k}.tar")
subprocess.run(["git", "-C", R, "archive", "--format=tar", "-o", tar, voll, ".cargo", "entscheiden/motor"], check=True)
subprocess.run(["scp", "-q", tar, f"{SSH}:C:/pf-arbeit/allinprobe-{k}.tar"], check=True)
jobs.append({"id": f"bitgleich-{name}-bau-{k}", "sitzung": "bitgleich", "prio": prio, "faeden": 16, "ram_gb": 10, "kurz": True, "ordner": r"C:\pf-arbeit",
jobs.append({"id": f"bitgleich-{name}-bau-{k}", "sitzung": "bitgleich", "prio": prio, "faeden": 8, "ram_gb": 10, "kurz": True, "ordner": r"C:\pf-arbeit",
"befehl": rf"powershell -NoProfile -ExecutionPolicy Bypass -File C:\pf-arbeit\bau-allinprobe.ps1 -Commit {voll}"})
gebaut[k] = voll
subprocess.run(["scp", "-q", zeile, f"{SSH}:{W}/zeile-{n}.txt".replace("\\", "/")], check=True)
+37
View File
@@ -0,0 +1,37 @@
# main 05.12. 21:3x: feste Reihenfolge der Bitgleich-/Probe-Auftraege (Live-Stand haengt davon ab). Bau je Auftrag einen Rang vor seinen Armen.
# Klasse 1: heuristik-weg, dann -ohneprobe, dann -f12 | 2: S1/S1b (mehrweg) | 3: exakts Probe-Commits (allinprobe-*) | 4: bayes-regel (River)
# 5: alles uebrige (heuristik-schalter, motor-konstanten, Range-Konstanten ...): hoechstens $max5 Teile gleichzeitig laufend/wartend, Rest als .klasse5,
# und gar keine neuen, solange ein Auftrag der Klassen 1-4 wartet (Nachruecken vor Langlaeufern).
$Q = 'D:\Projects\pf-batterie\messung\farm\schlange'; $max5 = 3
function Rang([string]$id) {
$r = $null
if ($id -match '^bitgleich-heuristik-weg-f12-') { $r = -26 }
elseif ($id -match '^bitgleich-heuristik-weg-ohneprobe-') { $r = -28 }
elseif ($id -match '^bitgleich-heuristik-weg-') { $r = -30 }
elseif ($id -match '^bitgleich-s1') { $r = -24 }
elseif ($id -match '^(allinprobe-|bitgleich-exakt)') { $r = -22 }
elseif ($id -match '^bitgleich-bayes') { $r = -20 }
if ($null -eq $r) { return $null }
if ($id -match '-bau-') { $r } else { $r + 1 }
}
$klasse14wartet = $false
foreach ($f in Get-ChildItem "$Q\auftraege" -Filter '*.json') {
$id = $f.BaseName; $r = Rang $id
if ($null -eq $r) { continue }
$klasse14wartet = $true
$j = Get-Content $f.FullName -Raw | ConvertFrom-Json
if ($id -match '-bau-' -and $j.faeden -gt 8) { $j.faeden = 8; $t = "$($f.FullName).tmp"; $j | ConvertTo-Json -Compress -Depth 5 | Set-Content $t -Encoding UTF8; Move-Item $t $f.FullName -Force; "BAU 8 Faeden $id" } # passt schneller in eine Luecke
if ($j.prio -ne $r) { $j | Add-Member -NotePropertyName prio -NotePropertyValue $r -Force; $t = "$($f.FullName).tmp"; $j | ConvertTo-Json -Compress -Depth 5 | Set-Content $t -Encoding UTF8; Move-Item $t $f.FullName -Force; "RANG $id $r" }
}
# Klasse 5 (bitgleich-*, nicht 1-4): begrenzen
$k5 = { param($n) ($n -like 'bitgleich-*') -and ($null -eq (Rang $n)) }
$laufend5 = @(Get-ChildItem "$Q\laufend" -Filter 'bitgleich-*.json' | ? { & $k5 $_.BaseName }).Count
$wartend5 = @(Get-ChildItem "$Q\auftraege" -Filter 'bitgleich-*.json' | ? { & $k5 $_.BaseName } | Sort-Object LastWriteTime)
$platz = $max5 - $laufend5
foreach ($f in $wartend5) {
if ($klasse14wartet -or $platz -le 0) { Rename-Item $f.FullName "$($f.Name).klasse5"; "KLASSE5 zurueck $($f.BaseName)" } else { $platz-- }
}
if (-not $klasse14wartet -and $platz -gt 0) {
foreach ($f in @(Get-ChildItem "$Q\auftraege" -Filter 'bitgleich-*.json.klasse5' | Sort-Object LastWriteTime | Select-Object -First $platz)) {
Rename-Item $f.FullName ($f.Name -replace '\.klasse5$', ''); "KLASSE5 frei $($f.Name)" }
}