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

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

Detailed Description

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).

Function Documentation

◆ arg()

prof_mpi.arg ( name,
default,
cast = str )

Definition at line 44 of file prof_mpi.py.

◆ one()

prof_mpi.one ( timed)

Definition at line 122 of file prof_mpi.py.

References one().

Referenced by one().

◆ gather()

prof_mpi.gather ( a)

Definition at line 150 of file prof_mpi.py.

Variable Documentation

◆ A

prof_mpi.A = list(sys.argv)

Definition at line 41 of file prof_mpi.py.

◆ CASE_DIR

prof_mpi.CASE_DIR
Initial value:
1= arg("--case-dir", os.path.expanduser(
2 "~/Codes/peclet-examples/benchmarks/bubble-column/scripts"))

Definition at line 48 of file prof_mpi.py.

◆ CKPT

prof_mpi.CKPT = arg("--ckpt", os.path.expanduser("~/Codes/bubble_column_perf/ckpt_t43.npz"))

Definition at line 50 of file prof_mpi.py.

◆ N

prof_mpi.N = int(A[1])

Definition at line 56 of file prof_mpi.py.

◆ WARM

prof_mpi.WARM = arg("--warm", 5, int)

Definition at line 57 of file prof_mpi.py.

◆ RTOL

prof_mpi.RTOL = arg("--rtol", 1e-10, float)

Definition at line 58 of file prof_mpi.py.

◆ DUMP

prof_mpi.DUMP = arg("--dump", None)

Definition at line 59 of file prof_mpi.py.

◆ comm

prof_mpi.comm = MPI.COMM_WORLD

Definition at line 60 of file prof_mpi.py.

◆ rank

prof_mpi.rank

Definition at line 61 of file prof_mpi.py.

◆ size

prof_mpi.size

Definition at line 61 of file prof_mpi.py.

◆ S

prof_mpi.S = case.CELLS_PER_D

Definition at line 62 of file prof_mpi.py.

◆ _tile

list prof_mpi._tile = [int(x) for x in arg("--tile", "1,1").split(",")]
protected

Definition at line 63 of file prof_mpi.py.

◆ TX

prof_mpi.TX

Definition at line 64 of file prof_mpi.py.

◆ TZ

prof_mpi.TZ

Definition at line 64 of file prof_mpi.py.

◆ NX

prof_mpi.NX

Definition at line 65 of file prof_mpi.py.

◆ NY

prof_mpi.NY

Definition at line 65 of file prof_mpi.py.

◆ NZ

prof_mpi.NZ

Definition at line 65 of file prof_mpi.py.

◆ step

prof_mpi.step

Definition at line 67 of file prof_mpi.py.

◆ t

prof_mpi.t

Definition at line 67 of file prof_mpi.py.

◆ blocks

list prof_mpi.blocks = tiled

Definition at line 67 of file prof_mpi.py.

◆ vel

list prof_mpi.vel = [np.asfortranarray(np.tile(a, (TX, 1, TZ))) for a in vel]

Definition at line 67 of file prof_mpi.py.

◆ pres

prof_mpi.pres = np.asfortranarray(np.tile(pres, (TX, 1, TZ)))

Definition at line 67 of file prof_mpi.py.

◆ series

prof_mpi.series

Definition at line 67 of file prof_mpi.py.

◆ tiled

list prof_mpi.tiled = []

Definition at line 71 of file prof_mpi.py.

◆ sx

prof_mpi.sx = -(box[0] // case.NX) * case.NX

Definition at line 73 of file prof_mpi.py.

◆ sz

prof_mpi.sz = -(box[2] // case.NZ) * case.NZ

Definition at line 74 of file prof_mpi.py.

◆ ox

prof_mpi.ox

Definition at line 77 of file prof_mpi.py.

◆ oz

prof_mpi.oz

Definition at line 77 of file prof_mpi.py.

◆ org

prof_mpi.org

Definition at line 81 of file prof_mpi.py.

◆ siz

prof_mpi.siz

Definition at line 81 of file prof_mpi.py.

◆ sl

prof_mpi.sl = tuple(slice(o, o + n) for o, n in zip(org, siz))

Definition at line 82 of file prof_mpi.py.

◆ s

prof_mpi.s = pf.Solver(*siz)

Definition at line 83 of file prof_mpi.py.

◆ vol

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.

◆ alpha

prof_mpi.alpha = vol / (NX * NY * NZ)

Definition at line 100 of file prof_mpi.py.

◆ rho_av

prof_mpi.rho_av = case.RHO_L + (case.RHO_G - case.RHO_L) * alpha

Definition at line 101 of file prof_mpi.py.

◆ iters

prof_mpi.iters

Definition at line 119 of file prof_mpi.py.

◆ divs

prof_mpi.divs

Definition at line 119 of file prof_mpi.py.

◆ dts

prof_mpi.dts

Definition at line 119 of file prof_mpi.py.

◆ projs

prof_mpi.projs

Definition at line 119 of file prof_mpi.py.

◆ steps

prof_mpi.steps

Definition at line 119 of file prof_mpi.py.

◆ file

prof_mpi.file

Definition at line 142 of file prof_mpi.py.

◆ stderr

prof_mpi.stderr

Definition at line 142 of file prof_mpi.py.

◆ flush

prof_mpi.flush

Definition at line 142 of file prof_mpi.py.

◆ w0

prof_mpi.w0 = time.perf_counter()

Definition at line 143 of file prof_mpi.py.

◆ wall

prof_mpi.wall = time.perf_counter() - w0

Definition at line 147 of file prof_mpi.py.

◆ fields

prof_mpi.fields
Initial value:
1= {k: gather(f()) for k, f in (("u", s.get_u), ("v", s.get_v), ("w", s.get_w),
2 ("p", lambda: s.get_field("p")),
3 ("C", lambda: s.get_field("C")))}

Definition at line 160 of file prof_mpi.py.

◆ prec

prof_mpi.prec = s.diagnostics.pressure_vcycle_precision()

Definition at line 163 of file prof_mpi.py.

◆ pm

int prof_mpi.pm = 1000 * np.asarray(projs)

Definition at line 165 of file prof_mpi.py.

◆ div

prof_mpi.div

Definition at line 177 of file prof_mpi.py.

◆ proj_ms

prof_mpi.proj_ms

Definition at line 177 of file prof_mpi.py.