@@ -218,6 +218,10 @@ module m_amr
218218 !! device-resident so the batch kernels index the store without a per-launch map.
219219 integer :: amr_bat_loc(amr_bat_max) = 0
220220 $:GPU_DECLARE(create='[amr_bat_loc]')
221+ !> Batched-advance POPULATION audit: run-lifetime count of the batches formed, indexed by member count. Reported at finalize as
222+ !! [amr-bat] under rank_time_wrt. hist(1) is the single-member count - a deck whose batches are all single-member exercises the
223+ !! batching frame but not the stacking, so an on/off comparison there is not evidence about multi-member batches.
224+ integer :: amr_bat_hist(amr_bat_max) = 0
221225 !> P1 pooled advance scratch: the fused per-block fine advance (rhs then rk on ONE block, s_amr_fine_stage_advance) leaves no
222226 !! cross-block q_prim/rhs lifetime, so every fine block shares this one slot-shaped pair instead of carrying per-slot arrays
223227 !! (~2x105 MiB per live slot at the S0 point - the np>=8 live-footprint blocker AND the alloc/free churn that fed the
@@ -7905,6 +7909,7 @@ contains
79057909 & cycle
79067910 amr_bat_n = amr_bat_n + 1; amr_bat_blk(amr_bat_n) = h; done(j) = .true.
79077911 end do
7912+ amr_bat_hist(amr_bat_n) = amr_bat_hist(amr_bat_n) + 1
79087913 ! the batch frame: leader selected (swap, capture and RK read amr_cur / the slot's extents), members' store columns
79097914 call s_amr_select_slot(g)
79107915 amr_bat_ext = [amr_slots(g)%m, amr_slots(g)%n, amr_slots(g)%p]
@@ -10542,6 +10547,12 @@ contains
1054210547
1054310548 call s_xa_report()
1054410549 call s_amr_cov_report()
10550+ if (rank_time_wrt) then
10551+ write (0, '(A,I0,A,I0,A,I0,A)', advance='no') '[amr-bat] rank ', proc_rank, ' batches ', sum(amr_bat_hist), &
10552+ & ' single ', amr_bat_hist(1), ' sizes'
10553+ do i = 1, amr_bat_max; write (0, '(A,I0,A,I0)', advance='no') ' ', i, 'x', amr_bat_hist(i); end do
10554+ write (0, '(A)') ''
10555+ end if
1054510556 if (.not. amr) return
1054610557 do islot = 1, amr_max_blocks
1054710558 call s_amr_free_slot(islot)
0 commit comments