flow 1.4.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
summarize Namespace Reference

Functions

 engine (probe)

Variables

 OUT
 ROW
str MD = "--md" in sys.argv
 D = os.path.join(OUT, ROW)
float LOADMAX = 24.0
dict rows = {}
 m = re.match(r"(.*)_L(\d+(?:off)?(?:sym)?)_r(\d+)\.json$", os.path.basename(js))
 sub
 L
 r
 res = json.load(open(js))
str log = js[:-5] + ".log"
str txt = open(log, errors="replace").read() if os.path.exists(log) else ""
 g = re.findall(r"gpu_apps_before (\d+) gpu_apps_after (\d+)", txt)
list fails = []
dict out = {}
list lines = []
 r1 = rr[min(rr)]
 eng
 _
list ms = [v["step_ms_mean"] for v in rr.values()]
 med = float(np.median(ms))
dict its = {(v["iters_mean"], v["iters_min"], v["iters_max"]) for v in rr.values()}
list loads = [x for v in rr.values() for x in (v["load_before"][0], v["load_after"][0])]
 lmax = max(loads)
 capped = sum(v["solve_failed"] for v in rr.values())
 caps = max(v["iters_max"] for v in rr.values())
 fr = sum(v["_fp32_restarts"] for v in rr.values())
 gpu = max(v["_gpu"] for v in rr.values())
str judged = LOADMAX else " NOT-JUDGED(load)"
str extra = ""
 iters
 bottom
str b = "x".join(map(str, r1["bottom"]))
tuple line
dict t = {L: out[(ROW, L)]["ms"] for L in ("4", "5", "6", "7")}
dict it = {L: out[(ROW, L)]["iters"] for L in ("4", "5", "6", "7")}
float nj = max(out[(ROW, L)]["lmax"] for L in ("4", "5", "6", "7")) > LOADMAX
dict a = 1.08 * min(t["6"], t["7"])
dict c = it["6"]
 v = lambda ok: ("NOT JUDGED" if nj else ("PASS" if ok else "MISS"))

Detailed Description

summarize.py <out_dir> <row> [--md]: one line per (row, depth) from run_matrix.sh's files.

Per depth: the bottom's global dims and engine (from the probe's debug lines: '[mg] direct bottom'
-> direct, '[agmg-build]' -> GraphAMG, neither -> smoothed), the median over rounds of the mean
ms/step, the pressure iterations mean/min/max (round 1; 'VAR' if the rounds differ), the max
per-step max_open_divergence_projected(), FP32 restarts (the solver's stderr warning lines, summed
over rounds), capped/failed solves, and the max load average seen (> 24 => NOT JUDGED). For M1
it adds the G-PERF-WS (a)-(c) checkpoint with L5 as the candidate (doc/mg_depth_policy.md ยง4.4).
--md prints a markdown table instead.

Function Documentation

◆ engine()

summarize.engine ( probe)

Definition at line 26 of file summarize.py.

Variable Documentation

◆ OUT

summarize.OUT

Definition at line 20 of file summarize.py.

◆ ROW

summarize.ROW

Definition at line 20 of file summarize.py.

◆ MD

str summarize.MD = "--md" in sys.argv

Definition at line 21 of file summarize.py.

◆ D

summarize.D = os.path.join(OUT, ROW)

Definition at line 22 of file summarize.py.

◆ LOADMAX

float summarize.LOADMAX = 24.0

Definition at line 23 of file summarize.py.

◆ rows

dict summarize.rows = {}

Definition at line 38 of file summarize.py.

◆ m

summarize.m = re.match(r"(.*)_L(\d+(?:off)?(?:sym)?)_r(\d+)\.json$", os.path.basename(js))

Definition at line 40 of file summarize.py.

◆ sub

summarize.sub

Definition at line 41 of file summarize.py.

◆ L

summarize.L

Definition at line 41 of file summarize.py.

◆ r

summarize.r

Definition at line 41 of file summarize.py.

◆ res

summarize.res = json.load(open(js))

Definition at line 42 of file summarize.py.

◆ log

str summarize.log = js[:-5] + ".log"

Definition at line 43 of file summarize.py.

◆ txt

str summarize.txt = open(log, errors="replace").read() if os.path.exists(log) else ""

Definition at line 44 of file summarize.py.

◆ g

summarize.g = re.findall(r"gpu_apps_before (\d+) gpu_apps_after (\d+)", txt)

Definition at line 46 of file summarize.py.

◆ fails

list summarize.fails = []

Definition at line 50 of file summarize.py.

◆ out

dict summarize.out = {}

Definition at line 55 of file summarize.py.

◆ lines

list summarize.lines = []

Definition at line 56 of file summarize.py.

◆ r1

summarize.r1 = rr[min(rr)]

Definition at line 58 of file summarize.py.

◆ eng

summarize.eng

Definition at line 59 of file summarize.py.

◆ _

summarize._
protected

Definition at line 59 of file summarize.py.

◆ ms

summarize.ms = [v["step_ms_mean"] for v in rr.values()]

Definition at line 60 of file summarize.py.

◆ med

summarize.med = float(np.median(ms))

Definition at line 61 of file summarize.py.

◆ its

dict summarize.its = {(v["iters_mean"], v["iters_min"], v["iters_max"]) for v in rr.values()}

Definition at line 62 of file summarize.py.

◆ loads

list summarize.loads = [x for v in rr.values() for x in (v["load_before"][0], v["load_after"][0])]

Definition at line 63 of file summarize.py.

◆ lmax

summarize.lmax = max(loads)

Definition at line 64 of file summarize.py.

◆ capped

summarize.capped = sum(v["solve_failed"] for v in rr.values())

Definition at line 65 of file summarize.py.

◆ caps

summarize.caps = max(v["iters_max"] for v in rr.values())

Definition at line 66 of file summarize.py.

◆ fr

summarize.fr = sum(v["_fp32_restarts"] for v in rr.values())

Definition at line 67 of file summarize.py.

◆ gpu

summarize.gpu = max(v["_gpu"] for v in rr.values())

Definition at line 68 of file summarize.py.

◆ judged

str summarize.judged = LOADMAX else " NOT-JUDGED(load)"

Definition at line 69 of file summarize.py.

◆ extra

str summarize.extra = ""

Definition at line 70 of file summarize.py.

◆ iters

summarize.iters

Definition at line 76 of file summarize.py.

◆ bottom

summarize.bottom

Definition at line 76 of file summarize.py.

◆ b

dict summarize.b = "x".join(map(str, r1["bottom"]))

Definition at line 77 of file summarize.py.

◆ line

tuple summarize.line
Initial value:
1= (f"{sub} L{L}{'(default)' if L == '0' else ''}: levels {r1['levels']} bottom {b} ({r1['bottom_cells']}) "
2 f"{eng} | {med:.2f} ms/step (rounds {', '.join(f'{x:.1f}' for x in ms)}) | iters "
3 f"{r1['iters_mean']:.2f} [{r1['iters_min']},{r1['iters_max']}]{' VAR' if len(its) > 1 else ''}"
4 f" | div max {r1['div_max']:.3e} | fp32 {r1['prec_last']} restarts {fr} | failed {capped}"
5 f" | cheb_restarts {r1['cheb_restarts']} | load max {lmax:.1f}{judged} | gpu apps max {gpu}{extra}")

Definition at line 78 of file summarize.py.

◆ t

dict summarize.t = {L: out[(ROW, L)]["ms"] for L in ("4", "5", "6", "7")}

Definition at line 99 of file summarize.py.

◆ it

dict summarize.it = {L: out[(ROW, L)]["iters"] for L in ("4", "5", "6", "7")}

Definition at line 100 of file summarize.py.

◆ nj

float summarize.nj = max(out[(ROW, L)]["lmax"] for L in ("4", "5", "6", "7")) > LOADMAX

Definition at line 101 of file summarize.py.

◆ a

dict summarize.a = 1.08 * min(t["6"], t["7"])

Definition at line 102 of file summarize.py.

◆ c

dict summarize.c = it["6"]

Definition at line 104 of file summarize.py.

◆ v

summarize.v = lambda ok: ("NOT JUDGED" if nj else ("PASS" if ok else "MISS"))

Definition at line 105 of file summarize.py.