|
flow 1.4.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
|
Functions | |
| arg (name, default, cast=str) | |
| tiles (p) | |
| bubble_seeds () | |
| one (timed) | |
| fmt (v) | |
Variables | |
| A = list(sys.argv) | |
| AR | |
| BO | |
| RHO_RATIO | |
| MU_RATIO | |
| RHO_L | |
| G | |
| D | |
| RHO_G = RHO_RATIO * RHO_L | |
| MU_L = np.sqrt(RHO_L * abs(RHO_G - RHO_L) * G * D ** 3) / AR | |
| MU_G = MU_RATIO * MU_L | |
| int | SIGMA = abs(RHO_G - RHO_L) * G * D ** 2 / BO |
| SEED | |
| PERTURB | |
| N = int(A[1]) | |
| WARM = arg("--warm", 5, int) | |
| CELLS = arg("--cells", 256, int) | |
| S = arg("--d-over-h", 20.0, float) | |
| B = arg("--bubbles-per-axis", 2, int) | |
| RTOL = arg("--rtol", 1e-8, float) | |
| LEVELS = arg("--levels", None, int) | |
| CA = arg("--comm-avoiding", None) | |
| OUT = arg("--out", None) | |
| TAG = arg("--tag", "") | |
| comm = MPI.COMM_WORLD | |
| rank | |
| size | |
| str | SINGLE = "--single" in A |
| TX | |
| TY | |
| TZ | |
| NX | |
| NY | |
| NZ | |
| t_setup0 = time.perf_counter() | |
| org | |
| siz | |
| s = pf.Solver(*siz) | |
| seeds = bubble_seeds() | |
| vol = comm.allreduce(sum(b["volume"] for b in s.diagnostics.vof_block_stats()), op=MPI.SUM) | |
| alpha = vol / (NX * NY * NZ) | |
| rho_av = RHO_L + (RHO_G - RHO_L) * alpha | |
| t_setup = comm.allreduce(time.perf_counter() - t_setup0, op=MPI.MAX) | |
| dts | |
| iters | |
| rows | |
| tuple | KEYS = ("step", "projection", "momentum", "predictor", "pressure_allreduce") |
| file | |
| stderr | |
| flush | |
| w0 = time.perf_counter() | |
| wall = time.perf_counter() - w0 | |
| R = np.asarray(rows) | |
| Rmax = np.empty_like(R) | |
| op | |
| float | mean_ms = 1000.0 * Rmax.mean(axis=0) |
| h = hashlib.sha256() | |
| digests = comm.gather(h.hexdigest(), root=0) | |
| blocks = comm.gather("x".join(map(str, siz)), root=0) | |
| g = hashlib.sha256() | |
| ub = sorted(set(blocks)) | |
| dict | res |
| fo | |
| indent | |
Multi-GPU WEAK scaling of a periodic swarm of deformable bubbles (block VoF, momentum advection
on, the case-A groups): a fixed box of cells per rank, tiled along x, then y, then z.
PYTHONPATH=<PECLET_FLOW_MPI build> \\
srun --mpi=pmix --ntasks=P --gpus-per-task=1 --gpu-bind=per_task:1 \\
python tests/study/vof_perf/weak_swarm.py N [--warm W] [--cells n] [--d-over-h D]
[--bubbles-per-axis B] [--rtol R] [--levels L] [--comm-avoiding MODE] [--single]
[--out FILE.json] [--tag T]
The case is case A of the bubble-swarm validation (tests/study/case_a on branch case-a: Ar 29.9,
Bo 2, rho_b/rho_l = mu_b/mu_l = 0.1, buoyancy with the mixture weight removed, the volume mean u_x
held at 0 by set_superficial_velocity) with many bubbles instead of one, in CELL units as
prof_mpi.py / run_peclet.build() (D = rho_l = g = 1, lengths scaled by S = d/h: mu' = S^2 mu,
sigma' = S^3 sigma, g' = S g; test_vof_blocks_physical_units.py proves the physical domain equal
to 1e-12). Gravity along -x, triply periodic, starting at rest.
Per rank: an n^3 box (default 256^3) carrying B^3 bubbles (default 2^3 = 8) of diameter d/h cells
(default 20) on a lattice of spacing n/B, each centre perturbed by up to +-PERTURB/2 of the free
gap with the fixed seed SEED. The rank box is tiled (TX, TY, TZ) times, doubling x, then y, then z
(P = 1, 2, 4, 8, 16, 32 -> (1,1,1), (2,1,1), (2,2,1), (2,2,2), (4,2,2), (4,4,2)); every tile carries
the SAME perturbed bubble set, so every rank has the same work when the ORB blocks are the tiles.
--levels L sets the pressure multigrid depth (set_pressure_multigrid(True, L), before the geometry);
without it the solver default (4) is used. At 4 levels a 256^3 box keeps a 32^3-per-rank coarsest
level, which goes to the host GraphAMG bottom (rebuilt every step under variable density).
--comm-avoiding MODE sets diagnostics.set_comm_avoiding(MODE) ('both' | 'off' | 'momentum' |
'pressure') before init_mpi; without it the solver default ('both') is used. The modes are
bit-identical by construction: a measurement of the halo-exchange cost, not of the physics.
At P = 1 the default is the DISTRIBUTED path (init_mpi at size 1, as prof_mpi.py); --single runs the
single-rank solver instead (no mpi_block/init_mpi, as run_mpi.py), the honest one-GPU reference.
W warm-up steps (default 5), then N timed steps, dt = 0.25 min(CFL, capillary) every step (case A).
Rank 0 prints one `RESULT key=value ...` line and, with --out, writes the same numbers as JSON:
ms/step (wall), max-rank step / projection / momentum / predictor / pressure-allreduce ms, pressure
iterations, cells per rank, the ORB block sizes, setup seconds, and `hash`: SHA-256 over every
rank's u, v, w, p, C (rank order) plus the timed dt and iteration sequences -- equal hashes at the
same P are the bit-identity gate across MPI transports (PECLET_CORE_GPU_AWARE_MPI=0/1).
| weak_swarm.arg | ( | name, | |
| default, | |||
| cast = str ) |
Definition at line 54 of file weak_swarm.py.
| weak_swarm.tiles | ( | p | ) |
Doubling x, then y, then z: p must be a power of two.
Definition at line 84 of file weak_swarm.py.
| weak_swarm.bubble_seeds | ( | ) |
One rank box's perturbed B^3 lattice (fixed seed), replicated over every tile; cell units.
Definition at line 100 of file weak_swarm.py.
| weak_swarm.one | ( | timed | ) |
| weak_swarm.fmt | ( | v | ) |
Definition at line 225 of file weak_swarm.py.
| weak_swarm.A = list(sys.argv) |
Definition at line 51 of file weak_swarm.py.
| weak_swarm.AR |
Definition at line 59 of file weak_swarm.py.
| weak_swarm.BO |
Definition at line 59 of file weak_swarm.py.
| weak_swarm.RHO_RATIO |
Definition at line 59 of file weak_swarm.py.
| weak_swarm.MU_RATIO |
Definition at line 59 of file weak_swarm.py.
| weak_swarm.RHO_L |
Definition at line 60 of file weak_swarm.py.
| weak_swarm.G |
Definition at line 60 of file weak_swarm.py.
| weak_swarm.D |
Definition at line 60 of file weak_swarm.py.
Definition at line 61 of file weak_swarm.py.
Definition at line 62 of file weak_swarm.py.
Definition at line 63 of file weak_swarm.py.
Definition at line 64 of file weak_swarm.py.
| weak_swarm.SEED |
Definition at line 65 of file weak_swarm.py.
| weak_swarm.PERTURB |
Definition at line 65 of file weak_swarm.py.
| weak_swarm.N = int(A[1]) |
Definition at line 67 of file weak_swarm.py.
| weak_swarm.WARM = arg("--warm", 5, int) |
Definition at line 68 of file weak_swarm.py.
| weak_swarm.CELLS = arg("--cells", 256, int) |
Definition at line 69 of file weak_swarm.py.
| weak_swarm.S = arg("--d-over-h", 20.0, float) |
Definition at line 70 of file weak_swarm.py.
| weak_swarm.B = arg("--bubbles-per-axis", 2, int) |
Definition at line 71 of file weak_swarm.py.
| weak_swarm.RTOL = arg("--rtol", 1e-8, float) |
Definition at line 72 of file weak_swarm.py.
| weak_swarm.LEVELS = arg("--levels", None, int) |
Definition at line 73 of file weak_swarm.py.
| weak_swarm.CA = arg("--comm-avoiding", None) |
Definition at line 74 of file weak_swarm.py.
| weak_swarm.OUT = arg("--out", None) |
Definition at line 75 of file weak_swarm.py.
| weak_swarm.TAG = arg("--tag", "") |
Definition at line 76 of file weak_swarm.py.
| weak_swarm.comm = MPI.COMM_WORLD |
Definition at line 77 of file weak_swarm.py.
| weak_swarm.rank |
Definition at line 78 of file weak_swarm.py.
| weak_swarm.size |
Definition at line 78 of file weak_swarm.py.
| str weak_swarm.SINGLE = "--single" in A |
Definition at line 79 of file weak_swarm.py.
| weak_swarm.TX |
Definition at line 96 of file weak_swarm.py.
| weak_swarm.TY |
Definition at line 96 of file weak_swarm.py.
| weak_swarm.TZ |
Definition at line 96 of file weak_swarm.py.
| weak_swarm.NX |
Definition at line 97 of file weak_swarm.py.
| weak_swarm.NY |
Definition at line 97 of file weak_swarm.py.
| weak_swarm.NZ |
Definition at line 97 of file weak_swarm.py.
| weak_swarm.t_setup0 = time.perf_counter() |
Definition at line 123 of file weak_swarm.py.
| weak_swarm.org |
Definition at line 127 of file weak_swarm.py.
| weak_swarm.siz |
Definition at line 127 of file weak_swarm.py.
Definition at line 130 of file weak_swarm.py.
| weak_swarm.seeds = bubble_seeds() |
Definition at line 146 of file weak_swarm.py.
| weak_swarm.vol = comm.allreduce(sum(b["volume"] for b in s.diagnostics.vof_block_stats()), op=MPI.SUM) |
Definition at line 149 of file weak_swarm.py.
Definition at line 159 of file weak_swarm.py.
| weak_swarm.dts |
Definition at line 161 of file weak_swarm.py.
| weak_swarm.iters |
Definition at line 161 of file weak_swarm.py.
| weak_swarm.rows |
Definition at line 161 of file weak_swarm.py.
| tuple weak_swarm.KEYS = ("step", "projection", "momentum", "predictor", "pressure_allreduce") |
Definition at line 162 of file weak_swarm.py.
| weak_swarm.file |
Definition at line 183 of file weak_swarm.py.
| weak_swarm.stderr |
Definition at line 183 of file weak_swarm.py.
| weak_swarm.flush |
Definition at line 183 of file weak_swarm.py.
| weak_swarm.w0 = time.perf_counter() |
Definition at line 184 of file weak_swarm.py.
| weak_swarm.wall = time.perf_counter() - w0 |
Definition at line 188 of file weak_swarm.py.
| weak_swarm.R = np.asarray(rows) |
Definition at line 191 of file weak_swarm.py.
| weak_swarm.Rmax = np.empty_like(R) |
Definition at line 192 of file weak_swarm.py.
| weak_swarm.op |
Definition at line 193 of file weak_swarm.py.
| float weak_swarm.mean_ms = 1000.0 * Rmax.mean(axis=0) |
Definition at line 194 of file weak_swarm.py.
| weak_swarm.h = hashlib.sha256() |
Definition at line 196 of file weak_swarm.py.
| weak_swarm.digests = comm.gather(h.hexdigest(), root=0) |
Definition at line 199 of file weak_swarm.py.
| weak_swarm.blocks = comm.gather("x".join(map(str, siz)), root=0) |
Definition at line 200 of file weak_swarm.py.
| weak_swarm.g = hashlib.sha256() |
Definition at line 202 of file weak_swarm.py.
| weak_swarm.ub = sorted(set(blocks)) |
Definition at line 207 of file weak_swarm.py.
| weak_swarm.res |
Definition at line 208 of file weak_swarm.py.
| weak_swarm.fo |
Definition at line 233 of file weak_swarm.py.
| weak_swarm.indent |
Definition at line 233 of file weak_swarm.py.