|
| | A = list(sys.argv) |
| |
| | CASE_DIR |
| |
| | CKPT |
| |
| | N = int(A[1]) |
| |
| str | TIMING = "--timing" in A |
| |
| | FLUX = arg("--flux", "python") |
| |
| | DUMP = arg("--dump", None) |
| |
| | WARM = arg("--warm", 5, int) |
| |
| | FIXDT = arg("--fixdt", None, float) |
| |
| | RTOL = arg("--rtol", 1e-10, float) |
| |
| | step |
| |
| | t |
| |
| | blocks |
| |
| | vel |
| |
| | pres |
| |
| | series |
| |
| | t_b = time.time() |
| |
| | _dummy = _pf.Solver(arg("--dummy", 17, int), 13, 11) |
| |
| | _L = arg("--levels", 4, int) |
| |
| | _orig = rp.pf.Solver |
| |
| | Solver |
| |
| | set_superficial_velocity |
| |
| | s = rp.build(blocks) |
| |
| str | DIV = "--div" in A |
| |
| list | divs = [] |
| |
| str | STATS = "--stats" in A |
| |
| dict | stats = {k: [] for k in ("volume", "area", "centroid", "velocity", "moments")} |
| |
| | flush |
| |
| | S = rp.S |
| |
| float | dtsafe = 0.25 |
| |
| list | iters = [] |
| |
| dict | T = {"limits": 0.0, "step": 0.0, "flux": 0.0} |
| |
| | w0 = time.perf_counter() |
| |
| list | dts = [one(True) for _ in range(N)] |
| |
| | wall = time.perf_counter() - w0 |
| |
| | v = s.diagnostics.vof_timing() |
| |
| | n = v["steps"] |
| |
| dict | cols |
| |
| | u |
| |
| | w |
| |
| | p |
| |
| | C |
| |
Profile the bubble-column step from a checkpoint (the VoF step-performance harness, WO-0).
The case is the bubble column of peclet-examples (128 x 96 x 64, 16 VoF block markers, rho/mu
ratio 0.02, set_superficial_velocity), built by that repo's run_peclet.build() and restarted from
ckpt_t43.npz. It runs W warm-up steps (not timed), then N timed steps with the driver's per-step
protocol (dt = 0.25 min(cfl_dt, capillary_dt) from vof_step_limits()). See
doc/vof_step_performance_design.md (sec. 7 WO-0, sec. 8 G-BIT / G-NUM / G-PERF).
Usage:
PYTHONPATH=<flow build> OMP_NUM_THREADS=8 OMP_PROC_BIND=false \\
python tests/study/vof_perf/prof.py N [--pcg [--rtol R]] [--timing] [--dump out.npz]
[--warm W] [--flux device|python|none] [--levels L] [--bottom MODE] [--fixdt DT]
[--ckpt PATH] [--case-dir DIR] [--dummy N]
--ckpt checkpoint (default ~/Codes/bubble_column_perf/ckpt_t43.npz)
--case-dir directory holding run_peclet.py + case.py (default:
~/Codes/peclet-examples/benchmarks/bubble-column/scripts)
--pcg MG-PCG pressure with cap 800 and relative tolerance --rtol (default 1e-10)
--cheb Chebyshev pressure (cap --cheb-maxit, default 120) at --rtol; prints the
solver's num_pressure_chebyshev_restarts when the build has it (D3, §5.13)
--dump save u, v, w, p, C, the timed steps' dt and pressure iterations (iters) and every
VoF block's colour array (col<id>) -- compare two dumps with cmp.py (G-BIT item 2)
--timing per-stage breakdown from diagnostics.vof_timing()
--levels L pressure multigrid depth; --bottom MODE = set_pressure_bottom(MODE) (E1)
--bottom-solver ENGINE diagnostics.set_pressure_bottom_solver(ENGINE): auto | direct |
algebraic (§13: the A/B of the two bottom engines on one build)
--div with --dump: also store each timed step's max_open_divergence_projected() (div),
read after the step (G-NUM item 3)
--stats with --dump: also store every timed step's measured block statistics (st_volume,
st_area, st_centroid, st_velocity, st_moments; WO-9's gate, C2 §5.10)