Repository navigation
Batched fixes: serial old_ic restart, IB overlap-cell rank independence, IGR 1D, Taylor-Green pressure, moment of inertia, and 9 more - #2514
Conversation
Hand tests (commit 873301f, this PR's head, on origin/master 34aadf1)
Earlier on the same commits (before the rebase onto 34aadf1):
AI-assisted (Claude Code). |
|
Claude Code Review Head SHA: 873301f Files changed:
Summary: The PR batches 14 small fixes. They cover the serial Findings:
Coverage:
|
|
Claude Code Review Head SHA: f9fb735 Files changed:
Summary: The PR batches small fixes: serial Findings:
Coverage:
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2514 +/- ##
==========================================
+ Coverage 66.44% 66.57% +0.12%
==========================================
Files 112 112
Lines 31462 31478 +16
Branches 4837 4839 +2
==========================================
+ Hits 20905 20956 +51
+ Misses 6596 6555 -41
- Partials 3961 3967 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
CI: 09FDDC81 (
|
| Comparison | rho | E (cons.4) |
|---|---|---|
| master: single vs double | 3.5e-3 rel | 4.9e-3 rel (1.3e-2 abs) |
| this PR: single vs double | 9.2e-3 rel | 1.28e-2 rel (3.0e-2 abs) |
| double: this PR vs master (the golden change) | 8.8e-3 rel | 1.22e-2 rel |
- This is precision spread, not a defect in the change.
- Master's single run is already 5e-3 from its double golden, half the tolerance.
- The body's angular velocity after the save is 1e-13 (double) and 1e-11 (single), driven by a round-off torque (1e-5, of either sign), so rotation is not what moves the field.
- At cell 1030, this PR's single value (2.3539) equals master's double value (2.3527) to 5e-4. The 1.2e-2 double golden change at that cell therefore comes from a tiny effect that single precision does not resolve.
- The test is degenerate by design: "the edges sit on cell faces", so image points land on faces and their stencil choice is sensitive to round-off.
- Plan: keep the double tolerance (1e-10). Give this test a single-precision tolerance with the per-test mechanism being added in Tests: generic configurations and tight tolerances; ib_wall_order = 2, TSC image points and ib_visc_compact by default #2486, set to about 4x the measured 1.3e-2.
- The alternative is to move the edges 0.1 dx off the faces. The body moves 0.2 dx, so no cell would cross the surface; that keeps the test's purpose and removes the degeneracy.
The other lanes are still running.
AI-assisted (Claude Code).
09FDDC81 off the cell faces: single vs double before and afterThe test case now puts the rectangle 0.137 dx (x) and 0.213 dx (y) past the cell faces, instead of exactly on them. The body still moves 0.2 dx, so no cell centre crosses the surface. The golden was regenerated from a clean clone of the branch on 34aadf1 (Phoenix GNU 12.3 + OpenMPI 4.1.5, double), and the double test passes against it. The single build was run against that same golden.
AI-assisted (Claude Code). |
873301f to
ea7846e
Compare
Pushed ea7846e: 09FDDC81 fix, single-precision tolerance, validate fixBase is still 34aadf1. Changes since 873301f:
Verification on ea7846e (clean clones):
No other golden changes. The earlier H200 run (IBM 140, Restart 5, model_eqns=3 15, Chemistry 69 and 5 more labels, 278 passed in total) was on 873301f. Since then the Fortran has not changed, and among the goldens only 09FDDC81's has. AI-assisted (Claude Code). |
ea7846e to
f9fb735
Compare
Rebased onto master 73816da (after #2491 and #2492): head f9fb735Conflicts. Both came from #2491 and were resolved in favour of master's new code:
Goldens. No overlap with the 140 goldens #2491 regenerated or the two from #2492 (82A64F89, A078904B). On the #2491 base, regenerated from a clean clone with Phoenix GNU 12.3 + OpenMPI 4.1.5 (double):
#2492 changes no Fortran (only Verification.
The 10e1299 head has the same Fortran as f9fb735. AI-assisted (Claude Code). |
Moment of inertia at step 0 after the #2491 rebase (f9fb735)(a) One computation, after the markers. On this branch
(b) A finite, correct moment at step 0. I printed
AI-assisted (Claude Code). |
Reply to the Claude review of f9fb735Fixes are in 4b04872, a fast-forward on f9fb735 with no rebase. That commit changes no Fortran: only
Checked on Phoenix (GNU 12.3 + OpenMPI 4.1.5, CPU):
No golden changes. AI-assisted (Claude Code). |
…eck fails on a misnamed deck or a refused example (MFlowCode#2493)
…write into the recreated step directory (MFlowCode#2494)
…nt of the rank's slot order (MFlowCode#2433); tests for MFlowCode#2494 and MFlowCode#2433
…sion guards (MFlowCode#1907, MFlowCode#1909) s_finalize_rhs_module now deallocates flux_src_n(1)%vf(species%beg:species%end) (MFlowCode#1907). The chem-diffusion energy term is added only when the mom:E loop did not already add it, i.e. under .not. (viscous .or. surface_tension .or. heat_conduction), the same condition the allocation and deallocation use (MFlowCode#1909; unreachable by accepted cases today). Update the stale validator comment.
Summed moment: mass*sum(r^2)/count (drop the extra 1/cell_volume), decode periodic markers and measure from the image's centroid, dummy moment on a rank with no body cell instead of 0/0. Rectangle /12 (was /6), sphere 0.4_wp. Compute the start-up moment after s_apply_ib_patches: before, the sum saw no marked cells and gave NaN for every non-analytic moving body.
…1911) Independent [0, 1] clamping can push the sum above 1 with 3+ fluids, inflating the non-Newtonian viscosity mixture and the conductivity. Divide by max(sum, 1) at the two viscous sites and the two conduction sites: a no-op when the clamped sum is <= 1.
…#1876) An unset -j built serially, notably for builds triggered by run/test. Builds now use min(cpu_count, 16) unless -j is given and print the job count; test cases still run one at a time unless -j is given.
…FlowCode#2063, MFlowCode#2026) Generated-file header and NAMELIST_VARS note: generated at build time (cmake/ParamsCodegen.cmake). architecture.md: parameters in definitions.py, validation in case_validator.py. getting-started: params --families, over 4,000 parameters; drop the counts from docstrings and CLI help. gpuParallelization typo. s_interpolate_image_point docstring: inverse-distance or TSC weights, not bilinear.
sacct node-recovery fallback ends in || true under set -euo pipefail (a failing sacct exited the script silently); preflight comment on the kept text match; LINK_DEPENDS_USE_LINKER OFF only for the amdflang offload build; inflow ramp f(t0) ~ f0 wording; example SUMMARY reads TOPOLOGY; drop unused LEVELS; explicit is None in the validator; one required list for grcbc_in; compiler probe keyed on FC; time_final/io_time_final comments; explicit real(t_step, wp) in the fixed-dt clock (bitwise unchanged).
… 493989F3 and B3EF129B (Phoenix GNU 12.3 + OpenMPI 4.1.5)
…gle/double spread
…ons follow -j as given, stale MFlowCode#2465 limitation
4b04872 to
4836d1c
Compare
Lines of Code
|
Rebased onto master ea89e86: head 4836d1cAfter #2506, #2437 and #2447 merged, GitHub reported this PR CONFLICTING, so it needed a rebase.
Checked on a clean clone of 4836d1c (Phoenix GNU 12.3 + OpenMPI 4.1.5, CPU):
AI-assisted (Claude Code). |
#2510: the two moment-of-inertia traps (5334FF40, D7E7DE04) with and without #2514Setup: Phoenix GNU 12.3 + OpenMPI 4.1.5, CPU, built with
This leaves 16 of the 18 traps in #2510 open; this PR does not touch the other sites. AI-assisted (Claude Code). |
…ell seam test from MFlowCode#2514)
…ell seam test from MFlowCode#2514)
…, TSC image points and ib_visc_compact by default (#2486) * Tests: generic configurations for degenerate tests; tolerances from measured spreads * IBM: ib_wall_order = 2 by default (1 with ib_second_order_vel) * IBM: ib_ip_interp = 2 (TSC) by default (1 with ib_second_order_vel) * Docs: TSC image points and the quadratic no-slip ghost are the defaults * Viscous IB: ib_visc_compact by default with weno_Re_flux, so the viscous flux no longer reads unfilled solid cells (#2041) * Tests: tolerances measured with the new defaults on more lanes * Tests: cold-wall twin and flux-wall tolerances from the measured GNU/GPU spread * Tests: override_tol_single for the single-precision lane; tolerances from the measured CI spread * Review: explicit IB options in the validation examples, ib_visc_compact = F tests, wording of the old defaults * Tests: regenerate the changed goldens (Phoenix, GNU 12.3, OpenMPI 4.1.5) * Format the wall_fill comment * Tests: goldens that move on the new base (09FDDC81, and the overlap-cell seam test from #2514) * Tests: C1F0BCB1 tolerance 1e-7 (GitHub ubuntu GNU differs from the Phoenix GNU golden by 4e-9 relative) * Tests: goldens that move on the new base (master 946d1e5; Tuolumne, GNU 13.3.1 CPU) * Tests: regenerate 872A4241 and F1BD319C on top of #2517 (HLLC central tangential velocity); their #2515 goldens predate it
Contribution Policy
All contributions are expected to demonstrate:
If these expectations are not met, we would prefer to implement the changes ourselves rather than spend time reviewing low-effort submissions.
Summary
This PR batches two streams of small fixes. The PR also carries #2486's
override_tol_singleharness change, with only the harness, unit-test and doc parts. Each fix is the smallest change that resolves its issue, has its own commit, and was checked directly (before/after numbers on each issue). One golden regeneration covers everything, done on the exact tree pushed here.Closes #2493, closes #2494, closes #2463, closes #2465, closes #2358, closes #2433, closes #1907, closes #1909, closes #1911, closes #1876, closes #2063, closes #2068.
Part of #1994 (the cross-rank sum of the moment is still open) and #2083 (one whitespace-only item no longer applies).
Not in this PR:
cyl-viscous-1910is kept for a follow-up.Changes
Part 1: small fixes
examples/2D_jet_in_crossflow/case_2D_jicf.pyis nowcase.py, and its outflowbc_x%endis -3 instead of -12. The free stream is Mach 2.5, and with MUSCL the characteristic BC was silently ignored (s_cbcis WENO-only). Precheck now fails when a tracked example directory has nocase.py(examples/scaling/is exempt). It also fails when an example violates apre_processorsimulationconstraint: the batched./mfc.sh validateused to list such violations and still exit 0. All 230 decks pass. The jet example uses an analytic inflow profile (a case-specific build), so it joins the analytic examples skipped by the Example suite.old_ic.q_cons_vf(i)%sf, but simulation writes only the interior record ("I/O past end of record"). It now reads(0:m, 0:n, 0:p).STATUS = 'old'underold_grid, in a step directory that was just recreated empty ("Cannot open file"). Both writers now useSTATUS = 'replace'; the same fix is ins_write_serial_boundary_condition_files, whose now-unusedold_grid_inargument is removed.Restart Roundtrip -> 1D -> pre_process old_ic. pre_processold_icrewrites the mid-run save as step 0, simulation finishes the run, and the result must match the straight run.check_igrrefusesigrwithn = 0(m_igrhas no 1D path; the case segfaulted). The docs say IGR is 2D/3D only, and that a sharp initial jump needselliptic_smoothing.p = pres + (cos(2x/L0) + cos(2y/L0)) rho U0^2/4, the exact balance (it was 1/4 of the amplitude, with/L0misplaced). The initial-pressure error at 32 cells drops from 4.5e-3 to 2.9e-11. The viscous decay check is unchanged at the printed digits.IC/<hash of the cache key>/and are written atomically (temporary name +os.replace), through two helpers intoolchain/mfc/flamelet.pyused by all three mixing-layer examples.many_ib_patch_parallelismpath already did. Between periodic images of one body it keeps the later image, as before: the image loops run in the same order on every rank. A first version that took the max there too changed2D -> IBM -> Plane Poiseuille -> ib_wall_order=2(slabs longer than the period) by 3.7e-4, so that case was left as it was. The change is per cell, with no communication. Generic head-on pairs whose overlap reaches a rank's first cell differed by 1.27 to 2.12 (relative, all fields) between 1 and 2/4 ranks, with or withoutib_mass_relax; they now agree to 5e-12 to 5e-11. One-rank results are bitwise unchanged. New 2-rank test:IBM -> Collision -> Overlap cell on a rank seam.Part 2: small fixes
s_finalize_rhs_modulefrees the speciesflux_src_nfields. The chemistry-diffusion energy term is added under the same condition as its allocation,.not. (viscous .or. surface_tension .or. heat_conduction)(no accepted case reaches the other branch today).mass*sum(r^2)/count; the extra1/cell_volumeis dropped./12(was/6) and the sphere0.4_wp.s_apply_ib_patches. Before, that sum saw no marked cells and gave NaN for every non-analytic moving body.max(sum, 1)at the two non-Newtonian viscous sites and the two conduction sites.-jbuilds withmin(cores, 16)and prints the count; test cases still run one at a time unless-jis given.sacct || trueunderset -euo pipefail,LINK_DEPENDS_USE_LINKERonly for the amdflang offload build, the compiler probe keyed onFC, and an explicitreal(t_step, wp)(bitwise unchanged). One whitespace-only item of Address leftover review comments from merged PRs #2083 no longer applies, so this PR is only part of Address leftover review comments from merged PRs #2083.Golden changes
All goldens were generated on this branch's exact source (rebased onto master 73816da; #2492 changed no Fortran), with Phoenix GNU 12.3 + OpenMPI 4.1.5 (
p-cpu, double precision).2D -> 1 Fluid(s) -> IBM -> Adaptive dt/12(#1994, #2068). The body also moved 0.137 dx and 0.213 dx off the cell faces (generic placement).override_tol_single = 1e-1from the measured 1e-2 single/double spread; the double tolerance is unchanged at 1e-102D -> 1 Fluid(s) -> IBM -> Collision -> Overlap cell on a rank seam(2 ranks)Restart Roundtrip -> 1D -> pre_process old_icNo other golden changes.
2D -> Example -> TaylorGreenVortex(#2465) stays within its tolerance: the pressure correction is 4.5e-3 on a 1e5 base.Testing
--gpu acc --mpi: IBM 140, Restart 5, model_eqns=3 15, Chemistry 69, TaylorGreenVortex 2, Non-Newtonian 8, Conduction 6, Axisymmetric 25 and Cylindrical 8 tests, 278 passed, 0 failed, against this branch's goldens (details in the hand-test comment)../mfc.sh precheckpasses 7/7../mfc.sh lint, including the test-suite linters: 1000 passed, 1 skipped. Two fixtures were updated: the IGR fixture is now 2D, and a 1D-IGR rejection test was added.Limitations
This PR was made with Claude Code (AI).