Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
421 commits
Select commit Hold shift + click to select a range
30aefdd
docs(amr): correct the stretched-grid + Lagrangian/IB gate rationale …
sbryngelson Jul 6, 2026
6c301d9
feat(amr): fine-level distribution map, phase 1 (computed, not applie…
sbryngelson Jul 6, 2026
ba8f964
docs(amr): fine-distribution note tracks up/mega (not a separate branch)
sbryngelson Jul 6, 2026
ea1a879
fix(sim): isolate fine-IB AMR state into m_ibm_fine to fix Cray plain…
sbryngelson Jul 7, 2026
33e9745
fix(sim): make AMR fine-IB swap device-stable (copy, not move_alloc/p…
sbryngelson Jul 7, 2026
443d550
fix(sim): sync moving-IB body position to host before the AMR subcycl…
sbryngelson Jul 7, 2026
165d9a9
amr: make moving-IB fine-block ghost ordering deterministic across ba…
sbryngelson Jul 8, 2026
16ea304
amr: fine-level SFC distribution - point-to-point coarse<->fine coupl…
sbryngelson Jul 8, 2026
59ecdc6
amr: block-splitting (max_grid_size tiling) + fine-fine halo + reflux…
sbryngelson Jul 8, 2026
2b97a35
amr: point-to-point cross-rank regrid fine-state migration (stretched…
sbryngelson Jul 8, 2026
bc3789d
test: regenerate B7704247 golden (2D stretched-y AMR regrid) for bloc…
sbryngelson Jul 7, 2026
b2aaa2c
docs: B7704247 resolved (tiling refines full tag vs old np=1 clamp - …
sbryngelson Jul 7, 2026
ddafc31
amr: gate non-polytropic QBMM at np>=2 (fail-closed) - The pb/mv quad…
sbryngelson Jul 7, 2026
764c01a
docs: QBMM+AMR np>=2 now gated fail-closed (was ungated/untested)
sbryngelson Jul 7, 2026
0a61574
amr: device-native fine->coarse restriction at np=1 (fixes GPU AMR re…
sbryngelson Jul 7, 2026
bd94035
amr: device-native restriction at np>=2 (fixes GPU whole-coarse clobb…
sbryngelson Jul 7, 2026
a4704f9
test: regenerate 660FFBFE golden (2D IGR igr_order=3 dynamic-regrid) …
sbryngelson Jul 7, 2026
f84b41f
amr: point-to-point cross-rank regrid migration (replaces all-ranks b…
sbryngelson Jul 8, 2026
c644d8b
amr: repartition-on-restart across rank counts (parallel_io) - s_read…
sbryngelson Jul 8, 2026
7d317e1
amr: factor per-slot field alloc/free into s_amr_alloc_slot/s_amr_fre…
sbryngelson Jul 8, 2026
66eb896
amr: lazy owned-only slot allocation - right-size fine memory to ~1/n…
sbryngelson Jul 8, 2026
ace2285
amr: warn when amr_max_blocks < num_procs (fine-level load balance ca…
sbryngelson Jul 8, 2026
45796fd
test/hybrid: place sensor eps in a phi gap (0.5 -> 0.3) to kill cross…
sbryngelson Jul 8, 2026
cf4deb1
amr: move_alloc amr_cg to avoid CCE-OMP uninitialized-descriptor crash
sbryngelson Jul 9, 2026
d8c2548
ibm: order ghost points deterministically for reproducible moving AMR-IB
sbryngelson Jul 9, 2026
7c27641
Merge remote-tracking branch 'upstream/master' into up/mega
sbryngelson Jul 9, 2026
9303ddb
amr/ib: update only ghost_points(1:num_gps) to fix amdflang IBM+AMR o…
sbryngelson Jul 9, 2026
4fafd7f
ibm: park AMR ghost points on-device to drop the swap host round-trip
sbryngelson Jul 9, 2026
4c877aa
test: soften moving-IB circle case to avoid the un-GCL'd CFL blow-up …
sbryngelson Jul 10, 2026
0f22386
amr: tear down ACC_SETUP scalar-field mappings on slot free (Cray pre…
sbryngelson Jul 10, 2026
5e51d3f
test: keep two-body moving-IB (43AF9F25) at its original wall speed
sbryngelson Jul 10, 2026
e19677b
Merge remote-tracking branch 'upstream/master' into up/mega
sbryngelson Jul 10, 2026
7ac0a88
weno: slice omega target to 0:weno_num_stencils in central-weight ass…
sbryngelson Jul 10, 2026
0456e6b
Merge upstream/master; extend hybrid_riemann smooth-flux to hll/lf/hlld
sbryngelson Jul 11, 2026
416e414
bubbles: fix Euler-Euler GPU data race on shared bubble-wall scratch
sbryngelson Jul 11, 2026
0aa5ae2
test: robust liveness eps for hll/hlld hybrid; drop fragile LF golden
sbryngelson Jul 11, 2026
28d93dc
test: remove orphaned Lax-Friedrichs hybrid golden (test dropped)
sbryngelson Jul 11, 2026
d266ab7
riemann: restore hypoelastic G floor under continuum damage
sbryngelson Jul 11, 2026
452cb39
riemann: make LF a first-class hybrid solver via consistent local-LF
sbryngelson Jul 11, 2026
6e3c3ed
Merge remote-tracking branch 'upstream/master' into up/mega
sbryngelson Jul 11, 2026
6279b2b
riemann: fix CCE case-optimization build of hybrid smooth-flux helper
sbryngelson Jul 11, 2026
f2ae15a
riemann: bake hybrid toggles into case-opt to dodge NVHPC fort2 crash
sbryngelson Jul 12, 2026
359687e
test: skip Lagrange two-way AMR goldens on nvfortran-in-docker
sbryngelson Jul 12, 2026
bd649f1
Merge remote-tracking branch 'upstream/master' into up/mega
sbryngelson Jul 12, 2026
9f939fa
amr: amr_max_level param + multi-level design roadmap (increment 1, g…
sbryngelson Jul 8, 2026
9dfe80d
amr: per-block level data model (multi-level increment 2a) - Add amr_…
sbryngelson Jul 8, 2026
5364d5f
amr: parent-block finder + coarse-frame design (multi-level 2b start)…
sbryngelson Jul 8, 2026
05d10c0
amr: level-aware L1->L2 coupling conserves exactly (multi-level 2b mi…
sbryngelson Jul 8, 2026
f79d8fb
docs(amr): increment 3 plan - lock-step advance first, then subcycle …
sbryngelson Jul 8, 2026
d857d21
amr: restrict-to-parent - fold level-2 fine back into the parent (inc…
sbryngelson Jul 8, 2026
0930008
amr: reflux-to-parent - Berger-Colella C/F flux correction into the p…
sbryngelson Jul 9, 2026
1d6fdb2
amr: persistent level-2 block (increment 3 step 3)
sbryngelson Jul 9, 2026
b3f3d39
amr: level-loop driver conserves on GPU - fix persistent-L2 device Na…
sbryngelson Jul 9, 2026
4fdebe0
amr: dynamic per-level regrid + L2->L1 reflux conserve to machine zer…
sbryngelson Jul 9, 2026
df99912
amr: enable viscous/chemistry multi-level - total-flux L2->L1 reflux …
sbryngelson Jul 9, 2026
4a0c947
amr: generalize multi-level nesting to >2 levels (np=1)
sbryngelson Jul 9, 2026
f72253a
test(amr): add np=1 amr_max_level=2 multi-level golden (static 2-leve…
sbryngelson Jul 9, 2026
cf8255d
amr: sensor-on-fine child tagging for multi-level regrid (np=1)
sbryngelson Jul 9, 2026
7c3f930
test(amr): add np=1 dynamic multi-level golden (sensor-on-fine child …
sbryngelson Jul 10, 2026
d6ccc93
amr(#26 inc.1): extract recursive s_amr_advance_subtree - behavior-pr…
sbryngelson Jul 10, 2026
12c61be
amr(#26 inc.2): recursive multi-level subcycling - each level at its …
sbryngelson Jul 10, 2026
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
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
25 changes: 25 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 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.

230 changes: 230 additions & 0 deletions docs/documentation/amr_block_batching.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
@page amr_block_batching AMR per-rank block batching

# AMR per-rank block batching (design note)

> **Design record / implementation note.** This documents the measured cost of the swap-based
> per-block advance and the design it implies. For user-facing behavior and parameters, see
> @ref amr. For the fine-level distribution across ranks, see @ref amr_fine_distribution.

Status: **not implemented.** This note records the measurement, the state inventory, and the
increment plan, so the work can be picked up without re-deriving any of it.

## Problem

Within a rank, owned blocks advance **sequentially**: `s_amr_swap_to_fine` overwrites the
solver's global grid state with one block's, the block advances, `s_amr_restore_coarse` puts
the coarse state back, and the next block repeats. Per-rank wall time therefore scales with
the *sum* of its blocks' work, so strong scaling saturates exactly when the fine-level
distribution succeeds at giving ranks many small blocks.

## Measurement

`l0_ntile` tiles the base grid into `l0_ntile**d` blocks advanced through the *same*
swap-based per-block solver, with a correctness bar of byte-identical to `l0_ntile = 0`.
Grid, flops, and answer are fixed; only the number of swap/advance cycles varies. So
`cost(ntile) - cost(monolithic)` isolates the per-block overhead exactly.

Measured on MI250X (amdflang AFAR 23.2.0, OpenMP offload), 2D uniform grid, np=1, 30 steps.
Byte-identity verified at every point (restart md5 identical across tile counts).

| `l0_ntile` | blocks | TimeAvg (s) | vs monolithic |
|---|---|---|---|
| 0 | monolithic | 0.04502 | 1.00x |
| 1 | 1 | 0.04527 | 1.01x |
| 2 | 4 | 0.19811 | 4.40x |
| 4 | 16 | 0.75420 | 16.75x |

cost/blocks = 1.01, 1.10, 1.05: **linear in block count, each block advance costing about as
much as advancing the whole grid** while holding 1/16 the cells.

It does not amortize with problem size:

| N | monolithic (s) | 16 blocks (s) | ratio |
|---|---|---|---|
| 128^2 | 0.0427 | 0.7675 | 17.96x |
| 256^2 | 0.0450 | 0.7542 | 16.75x |
| 512^2 | 0.0511 | 0.7843 | 15.36x |

The 16-block time is flat (~0.77 s) across a 16x increase in cells, and so is the monolithic
time. Both are fixed-overhead bound at these sizes; the GPU is far from saturated. The
penalty is still 15x at 512^2.

**Conclusion: per-block cost is independent of block size.** It is fixed overhead per block
per RK stage, not work — dominated by per-block kernel launch count plus the per-swap device
syncs, none of which shrink as blocks shrink.

## Direct confirmation: the cost is kernel launch count

Counted with `rocprofv3 --kernel-trace` (2D 128^2, 6 steps, np=1, under `srun`):

| | monolithic | 16 blocks (`l0_ntile=4`) | ratio |
|---|---|---|---|
| GPU kernel launches | 381 | 7619 | **20.0x** |
| wall time (256^2 sweep) | — | — | 16.75x |

Launch count scales 20x with block count while wall time scales 16.75x, so the per-block
cost tracks launches directly. This is measured, not inferred: combined with the refuted
hoist below (removing swap traffic changed nothing), it closes the argument that the fixed
per-block cost IS the launch count. Note each tile advance issues ~450 launches against the
monolithic step's 381 — the per-block path adds its own ghost fills and halo work on top of
the same RHS kernel sequence.

## What this rules out

@ref amr says "per-slot state instead of the global swap" is the lever. That is necessary but
**not sufficient**: it removes the per-swap state traffic, not the per-block launch count.
Two specific traps:

- Caching the swap-recomputed coefficient tables per slot removes the *host* recompute but
**not** the device transfers, because the WENO kernels read module-global arrays. Removing
the transfers requires the device-side arrays to be per-slot and the kernels to index by
slot.
- Running K blocks concurrently in separate lanes multiplies the O(N^d) working set by K
without reducing launch count.

The lever is **batching many blocks into single kernel launches over a block list**, not
per-lane duplication.

## State inventory

Per-block *data* is already per-slot (`t_level`: `region`, `m/n/p`, `buff_size`, `idwbuff`,
the nine coordinate arrays, `q_cons`, `q_cons_stor`, `q_prim`, `rhs`, `q_ghost_a/b`, and the
QBMM side-state). What is still global, and must be indexed by block for a batched kernel:

| Category | Items |
|---|---|
| Solver geometry (the SWAP CONTRACT) | `m/n/p`, `idwint`, `idwbuff`, nine coordinate arrays, `acoustic_source`, `ab_active` |
| Derived per-grid tables | WENO coefficients (`poly_coef_*`, `d_cb*`, `beta_coef_*`), hypoelastic FD coefficients, IGR `jac`/`jac_old` (bounced via `sw_jac`) |
| Scratch justified by sequential advance | `amr_cg` + `amr_cpat_off/hi`, `amr_rvw`, `amr_rhs_pb_f`/`amr_rhs_mv_f` (the last is explicitly commented "shared across slots (slots advance sequentially)") |
| RHS working set | 24 module allocatables across `m_weno` (16), `m_rhs` (5), `m_riemann_solvers` (2), `m_viscous` (1), sized to the base subdomain |

The RHS working set being base-subdomain-sized is also why `amr_maxc` caps a block at about
half the subdomain per dimension: the fine advance borrows the rank-local solver scratch.

## Why this gates the other arcs

The same cap is what blocks multi-level coexist: relaxing the `amr_max_level > 1` clause of
the `m_checker.fpp` `l0_ntile > 0 .and. amr` gate produces
`the nested level-2 block exceeds the per-rank scratch cap (2*L0-extent > amr_maxc_fit);
static multi-level does not tile the level-2 block`. So the coexist gate and this note's
redesign are blocked on the same single-working-slot architecture, not on independent work.
Sequencing the batching arc *after* the unification arc therefore risks reworking it.

## Strong-scaling baseline (the "before" curve)

Track 3's evidence artifact is a strong-scaling curve. The baseline, measured on the same
machine, 2D 256^2, static single-level AMR, 20 steps:

| np | compact block (32x32 coarse) | wide block (128x32 coarse) |
|---|---|---|
| 1 | 0.1009 s (1.00x) | 0.1009 s (1.00x) |
| 2 | 0.0980 s (1.03x) | 0.1190 s (0.85x) |
| 4 | 0.0983 s (1.03x) | 0.1267 s (**0.80x**) |

**AMR does not strong-scale, and wide blocks anti-scale.** Both cases hold exactly one fine
block (a static block cannot exceed `amr_maxc`, so tiling never triggers), and single-owner
distribution puts all of its work on one rank whatever `np` is. The compact case is
therefore flat: extra ranks only split the coarse grid, which is not the bottleneck. The
wide case is worse than flat because the block spans more ranks' coarse subdomains, so each
added rank buys more coarse<->fine P2P gather/scatter with no fine parallelism to offset it.

Caveat: this measures the single-block regime. It does not test multi-block distribution —
reaching several blocks needs dynamic regrid, since a static block is capped at `amr_maxc`.
The multi-block curve is the one that should move when batching lands, and it still needs to
be measured; the numbers above are the floor it has to beat.

## Swap topology (and what blocks the obvious optimization)

The hot path has exactly **one `s_amr_swap_to_fine` / `s_amr_restore_coarse` pair per block
per RK stage**, wrapping `s_compute_rhs` in `s_amr_fine_stage_rhs` (and its subcycle twin).
The RK pass (`s_amr_fine_stage_rk`) does not swap — it works on slot arrays at slot extents.
The fill phase does not swap either; it reads the gathered patch `amr_cg` and slot arrays.
So a timestep costs `3 * nblocks` swap round-trips, each carrying
`s_amr_sync_grid_state_to_device` plus, on nonuniform grids, `s_amr_recompute_weno_coefs`.

The obvious cheap win — hoist the restore, letting consecutive blocks swap fine->fine and
restoring once per phase — has **two** blockers, not one.

1. *Reflux in the coarse frame.* `m_time_steppers` called `s_amr_p2p_reflux_faces` and
`s_amr_apply_reflux` between blocks inside the advance loop, both operating on the coarse
`rhs_vf` at coarse indices. **Resolved:** the advance and reflux loops are now split
(phase 3 advances all blocks, phase 4 refluxes), so the reflux runs in the coarse frame
after the advances rather than interleaved with them.
2. *Nested swap sites inside the RK pass.* Still open, and the larger of the two.
`s_amr_fine_stage_rk` reads no grid globals itself (slot arrays plus `dt` and feature
flags), but it calls `s_amr_pressure_relax_fine`, `s_amr_ib_correct_fine`, and
`s_amr_update_mib_fine`, and **each opens its own `s_amr_swap_to_fine` /
`s_amr_restore_coarse` pair**. They assume the coarse frame on entry. With the restore
deferred they would swap while already swapped and trip
`@:ASSERT(.not. amr_swapped, "nested s_amr_swap_to_fine (swap/restore must pair)")`.

**Resolved:** the swap is now depth-counted and re-entrant — only the outermost swap
saves into the `sw_*` bounce buffers, only the outermost restore puts them back, and an
inner swap re-installs the same slot idempotently. No nesting occurs yet, so depth never
exceeds 1 and behavior is unchanged.
3. *The IGR sigma bounce is save-and-seed in one routine.* Still open. `s_amr_swap_to_fine`
ends with `if (igr) call s_amr_igr_swap_sigma()`, which BOTH saves the coarse
`jac`/`jac_old` into `sw_jac`/`sw_jac_old` AND seeds the block's sigma from the parent —
and it reads `sw_idwbuff` for the coarse extent. Once nesting is actually used, an inner
swap would re-run it and overwrite `sw_jac` with fine state.
**Resolved:** the save loop is depth-guarded, the seed loop is not. The seed reads
`sw_jac`, which still holds the coarse state, so every nested block seeds from the correct
parent — guarding only the save is both necessary and sufficient.

Note this routine already caused an OpenACC-only crash (its own comment: the `sw_*`
host-only module state "makes OpenACC's present lookup fail (OpenMP's implicit map(to)
tolerates it, which is why only acc lanes crashed)"). It is a worked example of why an
OpenMP-offload pass does not validate this area, and it is the reason the Frontier acc
lane is the real gate for anything that changes how this routine nests.

With all three resolved, hoisting the restore became a small change, and it was **built,
measured, and abandoned**. Record of that, so it is not retried:

A `s_amr_swap_hold` entry point (save the coarse state without installing a slot) was added
and the per-tile RHS loop in `s_l0_advance_stage_rhs` was bracketed with it, so consecutive
tiles went fine->fine with one coarse restore after the loop instead of one per tile. Output
stayed byte-identical. The `l0_ntile` sweep, 2D 256^2, np=1:

| `l0_ntile` | tiles | with hoist | without |
|---|---|---|---|
| 0 | monolithic | 1.00x | 1.00x |
| 1 | 1 | 1.01x | 1.01x |
| 2 | 4 | 4.32x | 4.40x |
| 4 | 16 | **16.87x** | **16.75x** |

**No effect.** The coarse round trip between blocks — its `sw_*` copies, its device sync, its
WENO/FD coefficient rebuild — is not a measurable share of the per-block cost, even at 16
blocks where the total penalty is ~17x. The change was reverted rather than carried as
unused machinery.

This sharpens the conclusion above: the per-block cost really is **kernel launch count**
inside `s_compute_rhs`, not swap traffic. Reducing swap traffic in any form (per-slot
coefficient tables, per-slot device grid state, hoisted restores) should be expected to do
nothing on its own. Only increment 3 — one launch over a block list instead of one launch
set per block — addresses the measured cost.

The three prerequisites remain resolved in the code, so a future batching attempt does not
have to redo them; note they currently have no caller and are unused generality.

Note the SWAP CONTRACT warning in `.claude/rules/common-pitfalls.md`: a stale device copy of
coarse bounds reads out of range on the fine grid under **CCE OpenACC only**. A CPU-only or
NVHPC-acc pass proves nothing for this class, so any swap-contract change needs a Cray GPU
run before it can be trusted.

## Increments

1. **Per-slot derived tables.** Give each slot its own WENO/FD coefficient storage so a swap
selects rather than rebuilds. Bit-identical; measurable only on stretched/axisymmetric
grids (`amr_weno_coef_recompute`), where it also drops ~18 device transfers per swap.
2. **Per-slot device grid state.** Make the device copies of `m/n/p`, `idwint/idwbuff`, and
the coordinate arrays per-slot so `s_amr_sync_grid_state_to_device` becomes an index
change rather than a transfer.
3. **Batched block kernels.** Replace the per-block launch of each RHS/RK kernel with one
launch over a block list, with the per-block geometry read from the slot arrays produced
by increments 1 and 2. This is the increment that actually removes the measured cost, and
the one that retires the `amr_swapped` paired-swap guard.

Re-measure with the `l0_ntile` sweep above after each increment: it is cheap, byte-identity
checked, and needs no new instrumentation. Two harness traps: the LAST `Time Avg` line in a
run log is a "Saving" line reporting 0.0 (parse the `Time step` lines), and `D/` is only
populated by post_process (checksum `restart_data/` instead).
Loading
Loading