Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
482 commits
Select commit Hold shift + click to select a range
90a4df7
amr(#26): fix pslot/amr_cur arg-aliasing breaking multi-level subcycl…
sbryngelson Jul 10, 2026
08c5b8f
amr(#27 inc.1): static multi-level runs at np>=2 (co-located refineme…
sbryngelson Jul 10, 2026
ee0864b
amr(#27 inc.2): dynamic multi-level at np>=2 (distributed nesting + c…
sbryngelson Jul 10, 2026
6642c77
amr(#27 inc.2): gate multi-level np>1 to validated 1D (2D/3D fine-blo…
sbryngelson Jul 10, 2026
4dea454
amr(#27 inc.3): 2D/3D multi-level at np>=2 (fix parent-gather arg + f…
sbryngelson Jul 10, 2026
963947e
amr(#28): document root cause of subcycle+dynamic+np>1 leak (missing …
sbryngelson Jul 11, 2026
887eb98
amr(#28): single-level subcycle conserves at np>1 (transpose subcycle…
sbryngelson Jul 11, 2026
b4a1f53
amr(#35): multi-level L2-L2 seam conserves in lock-step (level-aware …
sbryngelson Jul 11, 2026
1f035d7
amr: guard two review-found multi-level edge cases (tile-size div-by-…
sbryngelson Jul 11, 2026
86536cc
amr: two review perf cleanups in the fine-fine halo and reflux-to-parent
sbryngelson Jul 11, 2026
decbb1f
amr: strip development self-test scaffolding from static multi-level …
sbryngelson Jul 11, 2026
08409a5
amr: unify the L0/L1 and L2->L1 Berger-Colella reflux into one kernel
sbryngelson Jul 11, 2026
99ff235
amr: unify the coarse-self and child creg boundary-flux capture
sbryngelson Jul 12, 2026
3f73cfd
amr: address multi-level code review — static-builder guards, level-a…
sbryngelson Jul 13, 2026
e176e29
docs(amr): amr_max_level multi-level is implemented, not planned
sbryngelson Jul 13, 2026
89b6b3d
amr: skip the amr_cg device->host copy on the runtime C/F ghost-fill …
sbryngelson Jul 13, 2026
bc2a63c
amr: np=1 device-direct level-1 coarse gather (drop the per-stage hos…
sbryngelson Jul 13, 2026
6219787
ibm(amr): size fine IB marker field for the deepest level (multi-leve…
sbryngelson Jul 13, 2026
0a87a1b
amr(ib): cascade body-containment into multi-level nesting (refine bo…
sbryngelson Jul 13, 2026
b865753
ibm(amr): size the active ib_markers field for the deepest level (par…
sbryngelson Jul 13, 2026
e8e1f61
amr(ib): grow the regrid boxes array to amr_max_blocks before multi-l…
sbryngelson Jul 13, 2026
f94cc1d
amr(ib): admit np=1 static multi-level IB + golden (2D cylinder, amr_…
sbryngelson Jul 13, 2026
262f119
amr(ib): widen multi-level body containment so the fine C/F boundary …
sbryngelson Jul 13, 2026
e38d57d
docs(amr): design + plan for the three banked AMR increments (QBMM np…
sbryngelson Jul 13, 2026
517326c
Merge pull request #6 from sbryngelson/amr-multilevel
sbryngelson Jul 13, 2026
117b62b
Merge branch 'master' into up/mega
sbryngelson Jul 13, 2026
75b8e9c
docs(amr): implementation plan for distributed pb/mv QBMM np>=2 coupl…
sbryngelson Jul 13, 2026
993ccca
amr(qbmm): gather coarse pb/mv patch + distributed prolong (init/regr…
sbryngelson Jul 13, 2026
822ce21
amr(qbmm): distributed pb/mv ghost-fill on the runtime advance path (…
sbryngelson Jul 13, 2026
eccb9a3
amr(qbmm): distributed pb/mv restrict scatter (fine->coarse fold-back…
sbryngelson Jul 13, 2026
9f7b30c
amr(qbmm): admit single-level non-polytropic QBMM at np>=2 + np=2 str…
sbryngelson Jul 13, 2026
eb0ae2f
amr(qbmm): np=4 straddle golden for distributed pb/mv (np4==np1 machi…
sbryngelson Jul 13, 2026
da03270
docs(amr): implementation plan for runtime ref_ratio in {2,4}, single…
sbryngelson Jul 13, 2026
3951ca3
amr(ref_ratio): param + gate + mechanical de-hardcode of the 2:1 exte…
sbryngelson Jul 13, 2026
d44324e
amr(ref_ratio): thread ref_ratio into static-block fine-extent guards…
sbryngelson Jul 13, 2026
b101daf
amr(ref_ratio): generalize prolong child-offset stencil (rr=2 bit-ide…
sbryngelson Jul 13, 2026
239c5ba
amr(ref_ratio): generalize fine-grid coordinate subdivision to rr-way…
sbryngelson Jul 13, 2026
666a6f2
amr(ref_ratio): thread ref_ratio into coarse-RHS reflux child-averagi…
sbryngelson Jul 13, 2026
f80db66
amr(ref_ratio): complete de-hardcode - restrict x-child loop + restar…
sbryngelson Jul 13, 2026
d20cb2f
docs(amr): fix broken case.md link to amr_multilevel (add @page ancho…
sbryngelson Jul 14, 2026
b78968c
test(amr): make 05A8C23C a quiescent static structural test (cross-co…
sbryngelson Jul 14, 2026
54d6e50
test(amr): remove np=4 QBMM straddle golden 70F9736F (oversubscribes …
sbryngelson Jul 14, 2026
336e9d0
docs: AMR-on-AMD-flang root-cause note (root-level) - empty defaultma…
sbryngelson Jul 14, 2026
87ed1c6
fix(post): reconstruct multi-level (ref_ratio**level) AMR fine mesh i…
sbryngelson Jul 14, 2026
c8b1006
amr(flang): device-pack the fine-fine seam halo (fix 2D+ np>=2 on AMD…
sbryngelson Jul 14, 2026
22a4960
amr: warn on lock-step refinement dt/CFL (fine block runs at coarse d…
sbryngelson Jul 14, 2026
54810d6
amr(perf): hoist fine-fine seam pack buffers to persistent module scr…
sbryngelson Jul 14, 2026
52f4bb2
amr(perf): vectorize AMR restart-I/O metadata collectives (one EXSCAN…
sbryngelson Jul 14, 2026
15d68b0
amr(flang): defaultmap(present:allocatable) on AMR-fine IB swap/resto…
sbryngelson Jul 14, 2026
76f55c7
amr(perf): sparse tagged-index allgatherv for regrid clustering (gtag…
sbryngelson Jul 14, 2026
15baa8a
amr(perf): batch AMR flux-capture kernels over the slot dimension (O(…
sbryngelson Jul 14, 2026
9ea6193
amr(gpu): fix seam-halo device kernel PRESENT error on nvfortran/Cray…
sbryngelson Jul 14, 2026
a9831a4
amr(gpu): fix seam-halo device kernel PRESENT error on nvfortran/Cray…
sbryngelson Jul 14, 2026
6d62fe1
Merge remote-tracking branch 'origin/up/mega' into amr-scaling
sbryngelson Jul 14, 2026
6703e30
amr(perf): sparse Berger-Rigoutsos clustering — drop the O(global-gri…
sbryngelson Jul 14, 2026
baf8c4c
amr(perf): 64-bit sparse tag linear index — fix int32 overflow above …
sbryngelson Jul 14, 2026
07bddd8
amr(perf): partition the sparse tag list through Berger-Rigoutsos (cl…
sbryngelson Jul 15, 2026
8cf103d
build: bump ffmt pin to 0.4.4 (#1644)
sbryngelson Jul 14, 2026
000b987
style(amr): reformat m_amr.fpp + m_sfc_partition.fpp with ffmt 0.4.4
sbryngelson Jul 15, 2026
205d4e6
amr(perf): batch multi-level child-nesting union to one allgatherv pe…
sbryngelson Jul 15, 2026
475dae3
simulation/weno: reconstruct hybrid central path without whole-array …
sbryngelson Jul 15, 2026
9b328af
Merge remote-tracking branch 'origin/master' into up/mega
sbryngelson Jul 15, 2026
239cdbf
style: reformat with ffmt 0.4.4 (formatter pin bumped on master)
sbryngelson Jul 15, 2026
914a373
amr(restart): store per-block level so multi-level restart round-trip…
sbryngelson Jul 15, 2026
e2d3e41
Merge remote-tracking branch 'origin/up/mega' into amr-scaling
sbryngelson Jul 15, 2026
be120b4
amr(restart): parallel_io multi-level restart + delete dead fine-halo…
sbryngelson Jul 15, 2026
f1e860d
amr(perf): cache the fine-fine seam-pair list, rebuilt per regrid (PR…
sbryngelson Jul 15, 2026
23bd6e3
chore(amr): remove leaked dev-scratch planning files (PR #7 review)
sbryngelson Jul 16, 2026
87274d9
amr(ibm): gate deterministic ghost sort behind amr; drop per-block de…
sbryngelson Jul 16, 2026
17e6bde
chore(amr): remove dev self-test scaffolding + diagnostic prints; gat…
sbryngelson Jul 16, 2026
b95f6be
docs(amr): fix multi-level contradiction; document amr_max_level/ref_…
sbryngelson Jul 16, 2026
cbca10b
amr(validate): add amr_max_level/ref_ratio checks to case_validator, …
sbryngelson Jul 16, 2026
12c3de8
amr(sim): remove unused hybrid_weno/hybrid_riemann feature (PR #7 rev…
sbryngelson Jul 16, 2026
4a2d43a
docs(amr): fix stale 'two-level hierarchy' in Overview (multi-level; …
sbryngelson Jul 16, 2026
4585c6c
amr: rename f_->s_ subroutines; document fine-extent (ref_ratio**leve…
sbryngelson Jul 16, 2026
c4c93ea
docs(amr): render+index the design notes (@page, subpages); multi-lev…
sbryngelson Jul 16, 2026
9f27408
amr: single-source the 3D Morton key in m_box (dedup identical f_amr_…
sbryngelson Jul 16, 2026
59d4c1f
Merge upstream/master (post-#1290 EL-bubbles-MPI) into up/mega/amr-sc…
sbryngelson Jul 16, 2026
d198ff9
post_process: fix AMR fine-block restart header desync (macOS-only NaN)
sbryngelson Jul 17, 2026
1511550
Merge upstream/master into up/mega (resolve 4 conflicts)
sbryngelson Jul 17, 2026
f6ca7d3
Merge remote-tracking branch 'upstream/master' into amr-scaling
sbryngelson Jul 18, 2026
2c26d9d
Merge origin/master into up/mega (post-#1647/#1653/#1654): keep chem_…
sbryngelson Jul 19, 2026
8468a13
Merge fork/up/mega (parallel master-merge + macOS AMR restart-header …
sbryngelson Jul 19, 2026
4697853
fix(amr): radius-weighted restriction and reflux for 2D axisymmetric …
sbryngelson Jul 19, 2026
85a76c3
ci(frontier_amd): build base and chemistry simulation variants in con…
sbryngelson Jul 20, 2026
de264c8
ci: sanitize the build-variant suffix used in SLURM job slugs
sbryngelson Jul 20, 2026
14bbc7f
Merge branch 'master' into up/mega
sbryngelson Jul 20, 2026
b1e58ef
fix(m_box): enforce the l_min floor in f_weighted_splits and guard de…
sbryngelson Jul 20, 2026
e88f027
fix(gates): prohibit load_balance+file_per_process and active_box+bub…
sbryngelson Jul 20, 2026
3dd5671
docs/comments: sync stale prose to the implemented owner model; misc …
sbryngelson Jul 20, 2026
3914514
refactor(load-balance): drop dead q_cons_vf args; single load-weight …
sbryngelson Jul 20, 2026
515c7b7
fix(validator): mirror seven Fortran AMR gates missing from Python ch…
sbryngelson Jul 20, 2026
a45fab8
perf(ibm): size the AMR fine ghost-point capacity by a surface estima…
sbryngelson Jul 20, 2026
2153da6
fix(active_box): exempt domain-clamped faces from the debug envelope …
sbryngelson Jul 20, 2026
91a6f6b
fix(cont_damage): gate the elastic interface energy on the damage var…
sbryngelson Jul 20, 2026
ca9aa51
fix(amr): run the fine-fine seam halo at every rank count; abort on s…
sbryngelson Jul 20, 2026
7939b77
docs(amr): rewrite the Multi-rank sections for the implemented owner …
sbryngelson Jul 20, 2026
01d8da6
feat(amr): weight fine-block ownership by measured coarse-footprint cost
sbryngelson Jul 20, 2026
2c00b25
fix(load_balance): uniform static-split marginals for EE-bubble cases…
sbryngelson Jul 20, 2026
276fb37
perf(amr): device-path the np>1 gather/scatter coupling - pack only t…
sbryngelson Jul 20, 2026
4557a27
perf(amr): iterate ghost fills over face slabs instead of masking the…
sbryngelson Jul 21, 2026
adcd33e
Merge branch 'master' into up/mega
sbryngelson Jul 21, 2026
4e54900
refactor(amr): delete dead host restrict diagnostic; state the twin l…
sbryngelson Jul 21, 2026
6e5fd20
test(amr): golden coverage for ref_ratio=4, 3D dynamic regrid, np=1 s…
sbryngelson Jul 21, 2026
8db69e5
refactor(amr): extract m_amr_regrid and m_amr_restart from m_amr; spl…
sbryngelson Jul 21, 2026
ef02596
fix(amr): INTENT(OUT) dummy in BLOCK specification expressions (CI gf…
sbryngelson Jul 21, 2026
af2d830
perf(amr): cache per-block P2P overlap-rank lists at regrid; abort on…
sbryngelson Jul 21, 2026
61b71e4
Revert "perf(amr): iterate ghost fills over face slabs instead of mas…
sbryngelson Jul 21, 2026
0c01a4f
Revert "perf(amr): cache per-block P2P overlap-rank lists at regrid; …
sbryngelson Jul 21, 2026
ab43047
Revert "perf(amr): device-path the np>1 gather/scatter coupling - pac…
sbryngelson Jul 21, 2026
9926999
fix(amr): refresh the ab_int device copy every RHS call (CCE OpenACC …
sbryngelson Jul 21, 2026
7a82954
Reapply "perf(amr): device-path the np>1 gather/scatter coupling - pa…
sbryngelson Jul 21, 2026
d7b01f3
Reapply "perf(amr): cache per-block P2P overlap-rank lists at regrid;…
sbryngelson Jul 21, 2026
4b68baa
Reapply "perf(amr): iterate ghost fills over face slabs instead of ma…
sbryngelson Jul 21, 2026
e45d94c
docs(amr): correct stale comments and complete drift-protection markers
sbryngelson Jul 22, 2026
742140b
refactor(amr): call shared own-box device kernel from the np=1 gather
sbryngelson Jul 22, 2026
6243634
fix(amr): fail-closed IGR+AMR at num_procs > 1
sbryngelson Jul 22, 2026
7936b27
examples: add 2D AMR advected-droplet case
sbryngelson Jul 22, 2026
5740882
refactor(amr): rename ref_ratio -> amr_ref_ratio
sbryngelson Jul 22, 2026
8923a71
refactor(amr): shrink m_amr public surface
sbryngelson Jul 22, 2026
b61858b
docs(amr): clarify block-index and tagging params, freshness-lint amr.md
sbryngelson Jul 22, 2026
24d4bd6
test(amr): drop redundant multi-level static golden
sbryngelson Jul 22, 2026
05e2663
test(amr): add 3D AMR restart-roundtrip coverage
sbryngelson Jul 22, 2026
35d45e0
docs(amr): tighten AMR and load-balance source comments
sbryngelson Jul 22, 2026
fa43e19
docs(amr): tighten AMR comments in touched solver files
sbryngelson Jul 22, 2026
5436431
test(amr): skip 2D_amr_droplet from the Example smoke suite
sbryngelson Jul 22, 2026
20a742c
spike(l0-blocks): L0-as-blocks feasibility, bit-identical CPU+GPU (l0…
sbryngelson Jul 23, 2026
f48fc19
spike(l0-blocks): persistent multi-rank tiling, bit-identical np=1 an…
sbryngelson Jul 23, 2026
2030012
spike(l0-blocks): P2P tile migration primitive, bit-identical across …
sbryngelson Jul 23, 2026
0443fbb
spike(l0-blocks): closed-loop rebalancer (detect->migrate->re-level),…
sbryngelson Jul 23, 2026
29757a8
spike(l0-blocks): beta - tiles own storage, L0 demoted to I/O staging…
sbryngelson Jul 23, 2026
0aabc42
spike(l0-blocks): GPU migration - device pack/unpack for migrate+scat…
sbryngelson Jul 23, 2026
2585175
spike(l0-blocks): real measured-cost feedback (GPU-synced per-tile ti…
sbryngelson Jul 23, 2026
02a3eba
spike(l0-blocks): reflective (symmetry) domain-edge BC for tiles, bit…
sbryngelson Jul 23, 2026
d8576aa
spike(l0-blocks): periodic BC for tiles at np=1 (self-wrap + cross-ti…
sbryngelson Jul 23, 2026
adfdcfb
spike(l0-blocks): periodic BC at np>1 (allreduce rank-0-only periodic…
sbryngelson Jul 23, 2026
46565e5
spike(l0-blocks): smooth rebalancer per-tile cost with an EMA across …
sbryngelson Jul 23, 2026
0351170
spike(l0-blocks): make branch precheck-clean (format pass, param docs…
sbryngelson Jul 23, 2026
884af71
proto(l0-amr-unify): L0 tiles -> level-0 base (rr=1 per-slot override…
sbryngelson Jul 23, 2026
1ebff0e
proto(l0-amr-unify) step1: split amr_max_blocks into amr_max_fine (ca…
sbryngelson Jul 23, 2026
9abd282
test(l0): forced cross-rank tile-migration golden (np=2, fixed dt) - …
sbryngelson Jul 23, 2026
83f7bf0
fix(l0): gfortran/ifx portability - s_l0_copy_coarse_to_tiles q_cons_…
sbryngelson Jul 23, 2026
22bd925
fix(l0): nest mod() under l0_rebalance_interval>0 guard - amdflang in…
sbryngelson Jul 23, 2026
c91ea0c
proto(l0-amr-unify) step2a: add f_l0_slot(k)=l0_slot_off+k helper (id…
sbryngelson Jul 24, 2026
161f77a
proto(l0-amr-unify) step2b: single shared-pool allocator; s_l0_tiles_…
sbryngelson Jul 24, 2026
0203fe5
proto(l0-amr-unify) step2c: AMR initial fine block at slot l0_slot_of…
sbryngelson Jul 24, 2026
7cc3ee3
proto(l0-amr-unify) step2d: s_tvd_rk skips level-0 (tile) slots in AM…
sbryngelson Jul 24, 2026
d586a6d
feat(l0-amr): @:PROHIBIT l0_ntile>0 with amr=T (coexist needs Increme…
sbryngelson Jul 24, 2026
fa2877a
docs(l0-amr): fix stale amr_cur=1 comments; note amr_slot_live coexis…
sbryngelson Jul 24, 2026
5fdd071
inc3(l0-amr): coexist-safe amr_decomp/finalize alloc-free (.not. amr …
sbryngelson Jul 24, 2026
abacb26
inc3(l0-amr): harden coexist scaffolding - gate amr_ref_ratio clobber…
sbryngelson Jul 24, 2026
179ed60
inc(l0-amr): level-0 tile capture guard in s_amr_capture_boundary_flu…
sbryngelson Jul 24, 2026
4983cc9
inc(l0-amr): narrow coexist guard to static single-level any-np (dyna…
sbryngelson Jul 24, 2026
366d321
inc(l0-amr): per-stage tiles->L0 scatter in coexist (fresh coarse sta…
sbryngelson Jul 24, 2026
aca4191
inc(l0-amr): re-enable L0 coarse RHS under coexist with BC+halo (L0-f…
sbryngelson Jul 24, 2026
5fc583a
inc(l0-amr): split fine/tile stage advance into RHS + RK passes (byte…
sbryngelson Jul 24, 2026
295a277
inc(l0-amr): np>1 coexist coupling — cross-rank copy-back + fix coexi…
sbryngelson Jul 24, 2026
75af093
test(l0-amr): add coexist golden regression tests NP1-G + NP2-MIG
sbryngelson Jul 25, 2026
054b435
inc(l0-amr): skip the L0 tile prefix in s_amr_reconcile_slots (audit …
sbryngelson Jul 25, 2026
d815e1c
inc(l0-amr): fill L0 tile multi-dim ghost cells (diagonal corners / e…
sbryngelson Jul 25, 2026
e123ba7
inc(l0-amr): add computed s_amr_rank_decomp + validate vs amr_decomp …
sbryngelson Jul 25, 2026
0a5d9d5
inc(l0-amr): route decomposition consumers through s_amr_rank_decomp …
sbryngelson Jul 25, 2026
5c6f52c
inc(l0-amr): delete replicated amr_decomp table + its MPI_ALLGATHERs;…
sbryngelson Jul 25, 2026
d2f149e
merge upstream master (combustion reactive-burn #1670) into l0-amr; k…
sbryngelson Jul 26, 2026
6bd7009
fix(l0-amr): guard start_idx(2/3) reads in s_amr_validate_decomp behi…
sbryngelson Jul 26, 2026
618823f
inc(l0-amr): add O(overlap) rank-inversion helpers + transitional cro…
sbryngelson Jul 26, 2026
f12da8a
inc(l0-amr): build ovl lists + reflux participants by O(overlap) inve…
sbryngelson Jul 26, 2026
2ea15ad
Merge commit 'bfdc8f5e' into spike/l0-amr-unify
sbryngelson Jul 26, 2026
451a3f3
inc(l0-amr): delete O(P) ovl scan + reflux rank-loops + cross-checks;…
sbryngelson Jul 26, 2026
1b820e4
inc(l0-amr): add O(num_procs) SFC owner cut-points + f_amr_owner + va…
sbryngelson Jul 26, 2026
1708ffc
fix(l0-amr): scope s_amr_validate_owner to level>=1 blocks (level-0 t…
sbryngelson Jul 27, 2026
f1452f3
inc(l0-amr): convert L0 rebalancer greedy->SFC weighted re-cut + reba…
sbryngelson Jul 27, 2026
559ff53
refactor(l0-amr): extract s_amr_sfc_cut shared by fine + tile owner cuts
sbryngelson Jul 27, 2026
a463c54
inc(l0-amr): SFC compute-owner + cut for L0 tiles (storage owner stay…
sbryngelson Jul 27, 2026
6a20916
inc(l0-amr): add amr_fine_cut so f_amr_owner reproduces fine + tile o…
sbryngelson Jul 27, 2026
c053cdf
inc(l0-amr): routed initial fill + compute-owner slot allocation (uni…
sbryngelson Jul 27, 2026
c3f3add
docs(amr): correct stale slot-memory and output claims, document L0 t…
sbryngelson Jul 27, 2026
26adc58
docs(amr): record the swap topology and why hoisting the restore does…
sbryngelson Jul 27, 2026
ea9440c
inc(amr): split reflux out of the per-block advance loop (batching pr…
sbryngelson Jul 27, 2026
400d0b3
docs(amr): correct the batching prerequisites - the RK pass nests swa…
sbryngelson Jul 27, 2026
4cde6bc
docs(amr): record the AMR strong-scaling baseline (the Track 3 'befor…
sbryngelson Jul 27, 2026
0e552bb
inc(amr): make the grid swap re-entrant (batching prerequisite 2 of 2)
sbryngelson Jul 27, 2026
edec1ec
docs(amr): third batching prerequisite - the IGR sigma bounce is save…
sbryngelson Jul 27, 2026
2bffefd
inc(amr): split the IGR sigma save from the seed (batching prerequisi…
sbryngelson Jul 27, 2026
9188204
docs(amr): mark batching prerequisite 3 resolved and state what remains
sbryngelson Jul 27, 2026
d24c290
docs(amr): record that hoisting the restore was measured and has no e…
sbryngelson Jul 27, 2026
46bef79
docs(amr): measure kernel launch count directly - it is the per-block…
sbryngelson Jul 27, 2026
0c0d823
amr(coexist): split the l0_ntile+amr gate into one clause per unimple…
sbryngelson Jul 27, 2026
c115d54
amr(coexist): make dynamic regrid work with L0 tiles at np=1
sbryngelson Jul 27, 2026
ab87d49
amr(restrict): unpack the cross-rank fold-back on the device, not via…
sbryngelson Jul 28, 2026
108d90e
docs(pitfalls): record that a strided GPU_UPDATE section is silently …
sbryngelson Jul 28, 2026
6aadf6f
amr(coexist): support amr_subcycle with L0 tiles
sbryngelson Jul 28, 2026
e96ca62
amr(coexist): derive the static level-2 box from the parent BLOCK, no…
sbryngelson Jul 28, 2026
6c0c622
amr(coexist): restore to the first FINE block after the multi-level b…
sbryngelson Jul 28, 2026
2e7151f
amr(perf): exchange same-rank seam ghosts in one device kernel
sbryngelson Jul 28, 2026
fc3d1e9
amr(perf): fill a fine block's ghost slabs in one kernel
sbryngelson Jul 28, 2026
00db9cb
amr(perf): fuse the multi-fluid alpha-closure ghost slabs too
sbryngelson Jul 28, 2026
404d97b
amr(perf): fuse the remaining three ghost-slab loops
sbryngelson Jul 28, 2026
1895c0e
amr: make the fine-fine seam halo level-selective
sbryngelson Jul 28, 2026
2734961
amr(subcycle): advance level>=2 siblings transposed, with an L2 seam …
sbryngelson Jul 28, 2026
3db24df
amr(subcycle): tile wide level-2 boxes instead of capping to one child
sbryngelson Jul 29, 2026
741af6f
docs(amr): record the measured multi-block baseline and launch attrib…
sbryngelson Jul 29, 2026
e93f23d
docs(amr): retract the regrid cost claim and attribute it by direct m…
sbryngelson Jul 29, 2026
3a71839
amr: add amr_max_grid_size, a rank-independent fine-block size cap
sbryngelson Jul 29, 2026
7b1e493
amr: separate solver allocation bounds from runtime bounds (idwbuff_a…
sbryngelson Jul 29, 2026
8864d7d
docs(amr): design spec for per-level distribution
sbryngelson Jul 30, 2026
b2afa83
Merge upstream/master into up/mega: adopt stage-independent common re…
sbryngelson Jul 30, 2026
8678224
amr: size the m/n/p-keyed solver scratch to the block cap (idwbuff_al…
sbryngelson Jul 30, 2026
a108dd3
amr: let amr_max_grid_size exceed half a rank subdomain
sbryngelson Jul 30, 2026
6832d29
amr: point-to-point parent<->child gather and restrict for level>=2 b…
sbryngelson Jul 30, 2026
8e2768d
docs(amr): active_box multi-rank is now a declared prohibit, not a si…
sbryngelson Jul 30, 2026
d53fac4
amr: point-to-point multi-level reflux for level>=2 blocks
sbryngelson Jul 30, 2026
26e0d08
amr: advance level>=2 blocks per level, not per parent
sbryngelson Jul 30, 2026
cfdd284
amr: give each level its own rank mapping and drop tower co-location
sbryngelson Jul 31, 2026
1f20aee
docs(amr): formalize load balancing at scale and record the step-4 me…
sbryngelson Jul 31, 2026
e36c10a
docs(amr): the step-4 A/B was run too small above np=2 - reclassify a…
sbryngelson Jul 31, 2026
fc53e09
amr: report per-level load balance (max/mean) when load_weight_wrt is on
sbryngelson Jul 31, 2026
3780f30
amr: fix the balance report and correct three stale subcycle docstrings
sbryngelson Jul 31, 2026
be94db3
amr: halve the level>=2 child slot cap once per level, not a fixed /2
sbryngelson Jul 31, 2026
8dca4b6
amr: allow multi-level subcycle with dynamic regrid at num_procs > 1
sbryngelson Jul 31, 2026
3ab65ab
docs(amr): a no-block rank count is not an idleness measurement
sbryngelson Jul 31, 2026
3384911
amr: drop the orphaned seam-halo comment from the checker
sbryngelson Jul 31, 2026
1e07eb6
amr: record the level-3 slot-cap counterfactual at the cap site
sbryngelson Jul 31, 2026
a8b1b7b
amr(bench): add hardcoded IC 299, scattered blobs for load-balance be…
sbryngelson Jul 31, 2026
cfbaceb
amr: tile the brand-new-region child to the slot cap (fixes heap corr…
sbryngelson Jul 31, 2026
d99cbd0
test(amr): cover amr_max_grid_size at multi-level np=2 (golden 00EB793A)
sbryngelson Jul 31, 2026
526f2dc
amr: assert the box/slot-cap invariant, and report box-count imbalance
sbryngelson Jul 31, 2026
c3c674c
Docs: exclude stackoverflow.com from lychee link check (403 to bots)
sbryngelson Jul 31, 2026
2051aa1
amr: make the SFC cut boundary robust to floating-point ties
sbryngelson Jul 31, 2026
c3364a5
amr: keep uninitialized tile-prefix slots out of the fine-level SFC cut
sbryngelson Aug 1, 2026
0e3418e
amr: drop the unused K_box constant
sbryngelson Aug 1, 2026
b1fc067
docs(amr): record the measured cost-model result and requeue the open…
sbryngelson Aug 1, 2026
2a3e453
docs(amr): the scaling ceiling is MFC's, not AMR's - revise the queue…
sbryngelson Aug 1, 2026
d71b9fc
Merge branch 'master' into up/mega
sbryngelson Aug 1, 2026
cfbcead
docs(amr): write down the real exascale blocker - regrid cost scales …
sbryngelson Aug 1, 2026
7636c76
docs(amr): reorganise - blocker first, retract three superseded measu…
sbryngelson Aug 1, 2026
3f75489
amr: one collective per regrid instead of one per box
sbryngelson Aug 1, 2026
83bf457
amr: O(n log n) merge sort for the SFC cut instead of insertion sort
sbryngelson Aug 1, 2026
2f8e51c
docs: record limit 2 (SFC cut sort) as fixed in the AMR scaling plan
sbryngelson Aug 1, 2026
a500b68
amr: golden coverage for amr_max_level = 3, and print fine_work in th…
sbryngelson Aug 1, 2026
27133f1
docs: AMR costs ~31x uniform per cell, and the overhead is per-block
sbryngelson Aug 1, 2026
4ffb3a3
docs: repeat the block-size sweep; time and work move in opposite dir…
sbryngelson Aug 1, 2026
7107697
docs: the packed super-grid is disproved - tiled blocks are already s…
sbryngelson Aug 1, 2026
214a682
docs: AMR box set is rank-invariant; the 2D benchmark case is not
sbryngelson Aug 1, 2026
dec226e
docs: the AMR scaling limiter is cross-rank block adjacency, not per-…
sbryngelson Aug 1, 2026
ea849f7
docs: correct the limiter - AMR overhead does not distribute, it is n…
sbryngelson Aug 1, 2026
df5a612
docs: profiling says the cost is host time and device copies, not ker…
sbryngelson Aug 1, 2026
313dcbc
docs: root cause is s_compute_rhs fixed per-invocation cost, dominate…
sbryngelson Aug 2, 2026
108268c
docs: confirm the per-call copies are sys_size-scaled descriptor traffic
sbryngelson Aug 2, 2026
d212792
docs: pin the per-call copies to metadata by volume and distribution …
sbryngelson Aug 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .claude/rules/common-pitfalls.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,31 @@ covered in `docs/documentation/contributing.md`.
`contxb`/`momxb` shorthands are gone. Index positions depend on `model_eqns` and
enabled features — changing either moves ALL indices; never hard-code one.

## AMR levels (silent-index traps)

- **A level-`l` block's fine extent is `amr_ref_ratio**l * (coarse-region width) - 1`, NOT
`amr_ref_ratio*width`.** The `amr_ref_ratio*width` form is correct only for the level-1 initial
block; nested boxes compound by `amr_ref_ratio` per level (`amr_ref_ratio**level`). Every
fine-extent computation uses `amr_ref_ratio**amr_block_level` — geometry
(`s_set_amr_fine_geometry`), the restart-reader extent check, load-weight, `fmul`.
Assuming `amr_ref_ratio*width` rejects level≥2 blocks as corrupt (the exact bug that bit the
multi-level restart reader).
- **"coarse" in the AMR coupling routines means the block's PARENT level (`l-1`), not the
base grid (level 0).** For a level-1 block the parent IS L0; for level≥2 the block folds
to/from its parent block's fine array. `s_amr_gather_coarse_patch`,
`s_interpolate_coarse_to_fine`, and the restrict/reflux path all operate in the
parent-fine frame — assuming L0 silently corrupts level≥2 coupling.
- **The fine advance SWAPS the coarse grid globals (`m/n/p`, `idwint/idwbuff`, coords,
`acoustic_source`, `ab_active`) to a fine block and restores them after — see the SWAP
CONTRACT block at the `sw_*` declarations in `m_amr.fpp`.** Any module-level variable
DERIVED from the grid that a kernel reads during the fine advance must be swapped there or
refreshed per fine call at its use site; if it is `GPU_DECLARE`'d, its DEVICE copy must be
refreshed too. A stale device copy of coarse bounds reads out of range on the fine grid
under **CCE OpenACC only** (NVHPC/CCE-omp evaluate bounds host-side) — this was the `ab_int`
regression, fixed by an unconditional `GPU_UPDATE` in `s_compute_rhs`. `amr_rvw` (cyl_coord
radius weights) is the next candidate, currently safe only via a `m_checker.fpp` gate.
A CPU-only or NVHPC-acc pass proves NOTHING here; this class is CCE-acc-specific.

## GPU

- WARNING: do NOT wrap `GPU_LOOP` in `GPU_PARALLEL` for spatial loops — `GPU_LOOP` emits
Expand All @@ -36,6 +61,15 @@ covered in `docs/documentation/contributing.md`.
- `@:ACC_SETUP_VFs(...)`/`@:ACC_SETUP_SFs(...)` GPU pointer setup compiles only under
Cray. Around MPI: `GPU_UPDATE(host=...)` before send, `GPU_UPDATE(device=...)` after
receive.
- **Never `GPU_UPDATE` a NON-CONTIGUOUS array section.** `GPU_UPDATE(device='[q%sf(a:b,
c:d, e:f)]')` on a sub-box emits correct OpenMP, but AMD flang copies it as
`size(section)` CONTIGUOUS elements starting at the first: only the leading run lands
where it is named and the rest overwrites neighbouring cells with stale data — no error,
no warning. A leading section (`arr(1:n)`, or a fixed trailing index like
`freg(d)%lo(:,:,:,k)`) IS contiguous and safe; anything that strides is not. To move a
sub-box, pack/unpack it with a device kernel (`s_l0_pack_unpack_block`,
`s_amr_restrict_pack_device`) — that is why those exist. Measured: 10 of 60 covered
cells delivered in the AMR cross-rank restrict, mass off 1.4e-5 per regrid.

## Parameters

Expand Down
3 changes: 3 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ TKE = "TKE"
HSA = "HSA"
infp = "infp"
Sur = "Sur"
thi = "thi" # AMR clustering local: tagged-box hi index (tlo/thi)
alo = "alo" # AMR clustering local: accepted-box lo array (alo/ahi)
thr = "thr" # AMR clustering local: min-separation merge threshold
equil = "equil" # abbreviation for "equilibrium" (flamelet chemistry)
chioces = "chioces" # typo for "choices" - tests constraint key validation
reqires = "reqires" # typo for "requires" - tests dependency key validation
Expand Down
371 changes: 371 additions & 0 deletions docs/documentation/amr.md

Large diffs are not rendered by default.

478 changes: 478 additions & 0 deletions docs/documentation/amr_block_batching.md

Large diffs are not rendered by default.

172 changes: 172 additions & 0 deletions docs/documentation/amr_fine_distribution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
@page amr_fine_distribution AMR fine-level distribution

# AMR fine-level distribution (design note)

> **Design record / implementation note.** This documents the internal design and development of AMR
> fine-block distribution across MPI ranks. For user-facing behavior and parameters, see @ref amr.

## Problem

MFC's AMR uses a **mirror decomposition**: the fine level reuses the coarse rank
decomposition, so each rank owns exactly the fine cells over its coarse subdomain's
intersection with the blocks (`s_amr_compute_isect` → `amr_rank_owns_block`). This makes
coarse↔fine coupling entirely rank-local (zero communication) but leaves fine work
**unbalanced**: if refinement concentrates in a sub-region, only the ranks owning that
region do the fine advance while the rest idle. At scale this caps AMR speedup.

## Target

Give the fine level its **own distribution**, decoupled from the coarse decomposition, so
fine blocks spread across all ranks by measured work — the AMReX per-level
`DistributionMapping` idea. MFC already enforces an invariant that makes this far simpler
than the general case: **blocks are kept ≥ `buff_size` apart** (regrid merge), so with
**whole-block-per-rank** assignment there is *no fine–fine halo at all*
(`s_mpi_sendrecv_amr_fine_halo` disappears). The only coupling that becomes communication
is coarse↔fine, block-granular.

## Coupling changes (whole-block-per-rank)

| Step | Today (mirror, local) | Decoupled |
|---|---|---|
| Ownership | intersection, multi-owner (`amr_rank_owns_block`) | single owner (`amr_block_owner(k) == proc_rank`) |
| Ghost fill / prolong (coarse→fine) | read local coarse `q_cons` | **gather** coarse patch (block + `buff_size` halo) from coarse owner(s) to block owner |
| Reflux + restriction (fine→coarse) | write local coarse cells | **scatter** corrections from block owner back to coarse owner(s) |
| Fine–fine halo | coarse Cartesian neighbors | none (blocks separated) |
| Regrid | cluster (global) → mirror | cluster → **assign** (`amr_block_owner`) → **migrate** fine state |

The gather/scatter is the only new communication surface. SFC-ordered assignment keeps a
block's coarse patch on an SFC-nearby rank, bounding the cost. Conservation exactness is
preserved because the scatter applies the *same* reflux add / restrict overwrite the
mirror model applied locally — a pure data-movement change, not a numerics change.

## Reuse

`m_load_weight` (per-cell cost field) and `m_sfc_partition` (Morton order + chains-on-chains
balanced partition) already exist as an init-time diagnostic. They become the fine-level
distributor: feed the block list + per-block fine-work weight, return `amr_block_owner(:)`.

## Phasing (each independently mergeable)

1. **Distribution map, computed but not applied** (behavior-preserving). Add
`amr_block_owner(:)` + SFC assignment + an imbalance diagnostic; mirror ownership and all
coupling unchanged. Goldens bit-identical. *(this note's first increment)*
2. **Apply the map**: switch `amr_rank_owns_block` to single-owner, add the coarse↔fine
gather/scatter, drop the fine–fine halo. Validate conservation + assignment-independence.
3. **Dynamic rebalance each regrid**; optionally drop the fixed max-size slot pool for
right-sized boxes.

Phase 2 carries the correctness risk (gather/scatter exactness) and is the checkpoint gate.

## Phase 2 implementation status (branch `amr-fine-dist-wip`)

Done and np=1 bit-identical (the gather reduces to the local read when the owner is the sole rank):

- **Gather** (`s_amr_gather_coarse_patch`): per-block coarse patch `[region_lo-nmar : region_hi+nmar]`
assembled by a sentinel-MAX allreduce into `amr_cg` (a drop-in `scalar_field`). Contribution rule
`f_amr_own_coarse` claims interior cells + physical-boundary ghosts only (never inter-rank ghosts), so
there is one authoritative contributor per cell and no coarse-ghost halo dependence. `pull_host` flag
stages device-resident coarse to host for the runtime callers.
- **Read side rerouted**: init/regrid host prolongation (`s_interpolate_coarse_to_fine`) and the runtime
device ghost-fill (`s_amr_fill_fine_ghosts`, stage + subcycle) now prolong from `amr_cg`.
- **Restriction scatter** (`s_restrict_fine_to_coarse`): owner restricts on host into the `amr_cg_wp`
scratch (sole contributor), sentinel-MAX assembles, each rank overwrites the covered coarse cells it
owns. `s_restrict_all_vars` (old local device kernel) deleted.
- **Fine–fine halo dropped**: `s_mpi_sendrecv_amr_fine_halo` calls removed (whole-block owner has no
continuation faces; blocks ≥ buff_size apart). Routine in `m_mpi_proxy` now dead — remove with the
reflux rework.

Remaining (the conservation crux — reflux is NOT yet decoupling-correct):

- **Reflux redesign.** `s_amr_reflux_face_flags` derives transverse participation `tv` from `amr_isect`,
which is owner-only in the decoupled model, so `own_lo/own_hi` (gating BOTH `creg` capture and the
reflux apply) is true only on the block owner — which does not own the outside coarse cells. Fix:
(1) recompute `tv` from the replicated block range (`amr_region_lo/hi(t)` overlap with `sidx:sidx+ext`),
so any coarse-outside-owner participates; (2) the owner captures `freg` (already correct) and BROADCASTS
it (allreduce, replacing the cart-neighbor `s_mpi_sendrecv_amr_reflux_faces`); (3) coarse-outside-owners
capture `creg` locally and apply `(freg-creg)` to their owned outside cells — verify the apply's
block-relative transverse indexing maps onto each receiver's local coarse slice. Conservation-critical.
- **QBMM pb/mv** gather/scatter for np≥2 (currently local; non-polytropic QBMM+AMR now **gated fail-closed** at np≥2 in
`m_checker` — see "Known open" for the scatter follow-up).
- np=2 conservation + assignment-independence validation once reflux lands (acceptance goldens:
BD21A5C0, 5EFB3277, 79B334C7 — they pass on `up/mega` via the mirror).

## Phase 2 status: DONE and validated (reflux + scalability)

The reflux redesign above landed (block-relative frame, participation from the replicated block range), and the
whole coupling is now **point-to-point + right-sized** — the fine level distributes with no global collective per
stage and per-rank memory that scales with the decomposition.

- **Reflux**: `s_amr_reflux_face_flags` derives `tv`/`tlo`/`thi` from the replicated block range; `creg` capture +
both applies index block-relative; the owner's `freg` is delivered to the applying coarse-outside-owners.
- **Point-to-point coupling** (replaced the correctness-first global collectives): a replicated coarse-decomposition
table `amr_decomp` (allgathered once at init) lets any rank compute which ranks hold a coarse-cell range.
- gather: owner `Irecv`s patch slices from the coarse-owners (`f_amr_rank_coarse_range`).
- restriction: owner `Isend`s each coarse-owner its covered slice (`f_amr_rank_interior`).
- reflux: owner `Isend`s `freg` only to participants (`f_amr_reflux_participates` = `own_lo/hi` parameterized by
rank via `amr_decomp`); `s_amr_p2p_reflux_faces` in `m_amr`.
Non-participants exchange nothing.
- **Right-sized memory**: fine/coord/register arrays sized to `amr_maxc_fit` (min-over-ranks local half-extent = the
max block a rank can own, enforced by the scratch-constraint abort), not the global half-domain `amr_maxc` — about
`1/num_procs` (and `1/num_procs^(d-1)` for the face registers) the memory at scale.
- **Coordinate fix**: `s_amr_swap_to_fine` extends fine ghost coords from the global boundaries `amr_g?cb` (the owner
need not hold the block's local coarse coord slice).

Validated: np=1 1D/2D/3D goldens bit-identical; np=2 conservation exact in 1D (energy 1.9e-16) and 2D with
transverse-face appliers (mass 1.4e-14), bounds-clean. `s_mpi_allreduce_array_max` remains only for the
once-at-init coordinate assembly.

## Phase 3

1. **Block-splitting / tiling** (the coverage gap) — DONE.
- **Tiling**: `s_amr_tile_box` splits any box > `amr_maxc_fit` into contiguous ≤`amr_maxc_fit` sub-blocks, wired into
the initial-block setup and the regrid pipeline (non-IB); `s_populate_amr_fine` loops over all blocks refreshing
per-block mirrors via `s_amr_select_slot`.
- **Block-to-block fine-fine halo**: the fine advance is three driver phases — **fill all** (gather + coarse
ghost-fill), **`s_amr_fine_fine_halo`** (overwrite each seam ghost with the neighbour's *stage-entry* interior,
buff_size-deep, `MPI_Sendrecv` between owners or a local copy when one rank owns both; adjacency from the
replicated `amr_region_*_all` via `f_amr_seam`), **advance all** (RHS + RK). `s_advance_amr_fine_stage` split into
`s_amr_fine_stage_fill` / `s_amr_fine_stage_advance`.
- **Reflux seam-exclusion**: `f_amr_face_is_seam` drops a sub-block face shared with another fine sub-block from
`s_amr_reflux_face_flags` `own_lo/own_hi` (fine-fine, not c/f).
- **Owner-ordering fix**: `s_amr_assign_block_owners` runs BEFORE the owner-dependent `s_set_amr_fine_geometry` in
init, regrid, AND restart — the stale default (rank-0) owner map otherwise sized multi-block owners wrong (only
surfaces once tiling makes several blocks). Restart (`s_read_amr_restart`) is a two-pass read (regions → assign →
place data) for both the parallel_io and non-parallel_io paths.
2. **Regrid cross-rank fine-state migration** — DONE (the stretched-np≥2 correctness fix). The regrid overlap-copy
preserves a covering old block's fine detail by reading `amr_slots(kk)%%q_cons_stor`, but that was local-only
(`if (.not. old_owns(kk)) cycle`). Under fine-level distribution an old block can be owned by a rank *other* than the
one now owning a covering new block, so the copy was silently skipped and the new block kept only its
coarse-prolonged values — **exact on uniform grids** (prolongation reproduces the fine field) but **~O(1e-4) wrong on
stretched grids** (prolongation is not exact). Fix: broadcast every old block's stashed fine state from its owner
into the replicated slot's `q_cons_stor` on all ranks (`num_procs>1`; no-op at np=1), copy the overlap from *every*
covering old block regardless of ownership, and take `old_ilo`/`old_ext` from the global replicated region (not the
owner-only isect). Correctness-first collective; a per-block P2P version mirroring `s_amr_gather_coarse_patch` is
future work. Validated (`-b mpirun`): 79B334C7 (1D stretched dynamic-regrid, 2 ranks) passes; F0DDE1B4 (np=1 twin),
5EFB3277 + BD21A5C0 (uniform np=2 tiled + restart), and the np=1 AMR batch all pass.

## Golden regeneration note (tiling refines more at np=1)

At np=1, tiling adds a capability the mirror never had: refining a tagged region **larger than `amr_maxc`** (half the
domain per dim). The old regrid **clamped** any box to `amr_maxc_fit` (`hi = lo + amr_maxc_fit - 1`), so a big tag was
only partially refined; block-splitting **tiles** it and refines the whole tag. Any np=1 AMR golden whose tag exceeds
`amr_maxc(dim)` therefore changes (more cells refined) and must be regenerated with the tiled binary — an *intended*
solution change, not a regression (the tiled advance is bit-identical to the mirror where footprints match, conservation
is exact, and the seam is exact). Example: **B7704247** (2D stretched-y regrid) — the mirror refined `y4:23` (20 cells,
clamped); tiling refines the full `y4:35` (`y4:19` + `y20:35`). Golden regenerated. np≥2 goldens are unaffected: the
mirror splits a block across ranks there, so its footprint already matches tiling.

## Known open

- **QBMM pb/mv** gather/scatter for np≥2 — the pb/mv side-state coarse↔fine coupling (`s_amr_prolong_pbmv` /
`s_restrict_pbmv`) and the regrid QBMM overlap-copy are still LOCAL-only (same bug class as the q_cons migration
above). Now **gated fail-closed**: `m_checker` PROHIBITs `qbmm .and. .not. polytropic .and. num_procs > 1` for `amr`,
so np≥2 non-polytropic QBMM+AMR aborts at case load instead of silently coupling to the wrong coarse side-state.
Distributing pb/mv (gather/scatter/migration, mirroring q_cons) is future work for when np≥2 QBMM+AMR is needed and
testable. Polytropic QBMM+AMR at np≥2 is unaffected (its moments ride q_cons, which is already distributed).
- **`amr_g?cb` lacks physical-boundary ghost coords** (sized `-1:m_glb`; the base grid's `x/y/z_cb` carry BC-aware ghosts
via `s_populate_grid_variables_buffers`). A near-domain-edge **whole** (untiled) block can drive the fine ghost-coord
build out of `amr_gycb` bounds — surfaced only by artificially disabling tiling; tiled blocks stay in bounds. Fix if
untiled near-edge whole blocks ever become reachable.
- Minor: the P2P routines scan all `num_procs` to find participants (integer-only, O(P) per block per stage); the regrid
migration broadcasts (correctness-first, → P2P); patch-only device transfers instead of whole-field host round-trips
(GPU only); own-only slot allocation.
Loading
Loading