|
flow 1.4.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
|
Functions | |
| arg (name, default, cast=str) | |
| one (timed) | |
| gather (a) | |
Variables | |
| A = list(sys.argv) | |
| CASE_DIR | |
| CKPT = arg("--ckpt", os.path.expanduser("~/Codes/bubble_column_perf/ckpt_t43.npz")) | |
| N = int(A[1]) | |
| WARM = arg("--warm", 5, int) | |
| RTOL = arg("--rtol", 1e-10, float) | |
| DUMP = arg("--dump", None) | |
| comm = MPI.COMM_WORLD | |
| rank | |
| size | |
| S = case.CELLS_PER_D | |
| list | _tile = [int(x) for x in arg("--tile", "1,1").split(",")] |
| TX | |
| TZ | |
| NX | |
| NY | |
| NZ | |
| step | |
| t | |
| blocks = tiled | |
| vel = [np.asfortranarray(np.tile(a, (TX, 1, TZ))) for a in vel] | |
| pres = np.asfortranarray(np.tile(pres, (TX, 1, TZ))) | |
| series | |
| list | tiled = [] |
| sx = -(box[0] // case.NX) * case.NX | |
| sz = -(box[2] // case.NZ) * case.NZ | |
| ox | |
| oz | |
| org | |
| siz | |
| sl = tuple(slice(o, o + n) for o, n in zip(org, siz)) | |
| s = pf.Solver(*siz) | |
| vol = comm.allreduce(sum(b["volume"] for b in s.diagnostics.vof_block_stats()), op=MPI.SUM) | |
| alpha = vol / (NX * NY * NZ) | |
| rho_av = case.RHO_L + (case.RHO_G - case.RHO_L) * alpha | |
| iters | |
| divs | |
| dts | |
| projs | |
| steps | |
| file | |
| stderr | |
| flush | |
| w0 = time.perf_counter() | |
| wall = time.perf_counter() - w0 | |
| dict | fields |
| prec = s.diagnostics.pressure_vcycle_precision() | |
| int | pm = 1000 * np.asarray(projs) |
| div | |
| proj_ms | |
The bubble-column step from ckpt_t43 on the DISTRIBUTED solver (init_mpi, any np): prof.py's case
and protocol on this rank's ORB block, for the np-gates of doc/vof_projection_distributed_design.md
ยง8 (G-DD3: 'auto' / forced 'fp32' against 'fp64' at the same np, G-NUM-P 1-3; G-DD4: projection
ms/step).
The case is run_peclet.build()'s, block by block (as ~/Codes/bubble_column_perf/run_mpi.py): the
global arrays of the checkpoint are sliced to the rank's block, the VoF markers are passed as the
global list, the column is closed by the device set_superficial_velocity (rank-aware). W warm-up
steps (not timed, default 5), then N timed steps with prof.py's dt rule. Unlike prof.py the flux
closure is always the device one (prof.py's default host shift is single-rank).
Usage:
PYTHONPATH=<PECLET_FLOW_MPI build> OMP_NUM_THREADS=2 OMP_PROC_BIND=false \\
mpirun -np P --bind-to none python tests/study/vof_perf/prof_mpi.py N [--pcg|--fcg]
[--rtol R] [--vcycle-precision auto|fp64|fp32] [--initial-guess MODE]
[--warm W] [--dump out.npz] [--ckpt PATH] [--case-dir DIR] [--tile TX[,TZ]]
--tile periodic replication of the checkpoint TX times along x and TZ times along z (both
periodic; the -y/+y walls are kept): global grid (TX NX, NY, TZ NZ), u/v/w/p tiled, each
VoF block marker copied once per tile with its box shifted by whole periods (a weak-
scaling column at constant cells per rank; default 1,1 = the checkpoint itself)
--dump rank 0 saves the GATHERED u, v, w, p, C, the timed steps' dt, pressure iterations
(iters), max_open_divergence_projected() (div) and projection ms (proj_ms, the max
over ranks of diagnostics.last_step_timers()['projection'])
Prints one line on rank 0: np, block, ms/step, projection ms/step (mean and min), iterations, the
precision the last solve used; then one machine-readable `RESULT key=value ...` line with the same
numbers, the global grid and the requested --vcycle-precision. Rank 0 writes `[prof_mpi] timed steps
begin` to stderr before the first timed step, so restarts in the timed window are the warning lines
after it. An 'auto' FP64 restart prints its own warning line on rank 0's
stderr (no Python counter exists, design Q-4).
| prof_mpi.arg | ( | name, | |
| default, | |||
| cast = str ) |
Definition at line 44 of file prof_mpi.py.
| prof_mpi.one | ( | timed | ) |
| prof_mpi.gather | ( | a | ) |
Definition at line 150 of file prof_mpi.py.
| prof_mpi.A = list(sys.argv) |
Definition at line 41 of file prof_mpi.py.
| prof_mpi.CASE_DIR |
Definition at line 48 of file prof_mpi.py.
| prof_mpi.CKPT = arg("--ckpt", os.path.expanduser("~/Codes/bubble_column_perf/ckpt_t43.npz")) |
Definition at line 50 of file prof_mpi.py.
| prof_mpi.N = int(A[1]) |
Definition at line 56 of file prof_mpi.py.
| prof_mpi.WARM = arg("--warm", 5, int) |
Definition at line 57 of file prof_mpi.py.
| prof_mpi.RTOL = arg("--rtol", 1e-10, float) |
Definition at line 58 of file prof_mpi.py.
| prof_mpi.DUMP = arg("--dump", None) |
Definition at line 59 of file prof_mpi.py.
| prof_mpi.comm = MPI.COMM_WORLD |
Definition at line 60 of file prof_mpi.py.
| prof_mpi.rank |
Definition at line 61 of file prof_mpi.py.
| prof_mpi.size |
Definition at line 61 of file prof_mpi.py.
| prof_mpi.S = case.CELLS_PER_D |
Definition at line 62 of file prof_mpi.py.
|
protected |
Definition at line 63 of file prof_mpi.py.
| prof_mpi.TX |
Definition at line 64 of file prof_mpi.py.
| prof_mpi.TZ |
Definition at line 64 of file prof_mpi.py.
| prof_mpi.NX |
Definition at line 65 of file prof_mpi.py.
| prof_mpi.NY |
Definition at line 65 of file prof_mpi.py.
| prof_mpi.NZ |
Definition at line 65 of file prof_mpi.py.
| prof_mpi.step |
Definition at line 67 of file prof_mpi.py.
| prof_mpi.t |
Definition at line 67 of file prof_mpi.py.
| list prof_mpi.blocks = tiled |
Definition at line 67 of file prof_mpi.py.
Definition at line 67 of file prof_mpi.py.
Definition at line 67 of file prof_mpi.py.
| prof_mpi.series |
Definition at line 67 of file prof_mpi.py.
| list prof_mpi.tiled = [] |
Definition at line 71 of file prof_mpi.py.
| prof_mpi.sx = -(box[0] // case.NX) * case.NX |
Definition at line 73 of file prof_mpi.py.
| prof_mpi.sz = -(box[2] // case.NZ) * case.NZ |
Definition at line 74 of file prof_mpi.py.
| prof_mpi.ox |
Definition at line 77 of file prof_mpi.py.
| prof_mpi.oz |
Definition at line 77 of file prof_mpi.py.
| prof_mpi.org |
Definition at line 81 of file prof_mpi.py.
| prof_mpi.siz |
Definition at line 81 of file prof_mpi.py.
Definition at line 82 of file prof_mpi.py.
Definition at line 83 of file prof_mpi.py.
| prof_mpi.vol = comm.allreduce(sum(b["volume"] for b in s.diagnostics.vof_block_stats()), op=MPI.SUM) |
Definition at line 99 of file prof_mpi.py.
| prof_mpi.rho_av = case.RHO_L + (case.RHO_G - case.RHO_L) * alpha |
Definition at line 101 of file prof_mpi.py.
| prof_mpi.iters |
Definition at line 119 of file prof_mpi.py.
| prof_mpi.divs |
Definition at line 119 of file prof_mpi.py.
| prof_mpi.dts |
Definition at line 119 of file prof_mpi.py.
| prof_mpi.projs |
Definition at line 119 of file prof_mpi.py.
| prof_mpi.steps |
Definition at line 119 of file prof_mpi.py.
| prof_mpi.file |
Definition at line 142 of file prof_mpi.py.
| prof_mpi.stderr |
Definition at line 142 of file prof_mpi.py.
| prof_mpi.flush |
Definition at line 142 of file prof_mpi.py.
| prof_mpi.w0 = time.perf_counter() |
Definition at line 143 of file prof_mpi.py.
| prof_mpi.wall = time.perf_counter() - w0 |
Definition at line 147 of file prof_mpi.py.
| prof_mpi.fields |
Definition at line 160 of file prof_mpi.py.
| prof_mpi.prec = s.diagnostics.pressure_vcycle_precision() |
Definition at line 163 of file prof_mpi.py.
| int prof_mpi.pm = 1000 * np.asarray(projs) |
Definition at line 165 of file prof_mpi.py.
| prof_mpi.div |
Definition at line 177 of file prof_mpi.py.
| prof_mpi.proj_ms |
Definition at line 177 of file prof_mpi.py.