Skip to content

Two-stage MUSIC pairs: grid-boundary flag reset, MUSIC4GPU pin, droplet pruning - #141

Merged
jhputschke merged 3 commits into
music4gpu_testfrom
pair_h5_music
Sep 25, 2026
Merged

jhputschke merged 3 commits into
music4gpu_testfrom
pair_h5_music

Conversation

@jhputschke

@jhputschke jhputschke commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

These are the X-SCAPE changes for the two-stage MUSIC pair production. A MUSIC_1 background feeds Matter + LBT + CausalLiquefier, and MUSIC_2 runs with the jet deposition. PyJetscape's PairH5Writer (js-contrib) writes both legs to one file. This builds on PR #138, which is already merged into music4gpu_test (4f5bdb2a).

  • MusicWrapper: reset MUSIC's grid-boundary flag per event (ca8dd84a).
    • When the freeze-out surface reaches the transverse grid edge, MUSIC sets reRunHydro and expects its driver to re-run on a larger grid. X-SCAPE never re-runs, and MUSIC clears the flag only in its constructor.
    • So after one edge hit, every later event of that MUSIC instance silently stopped at its first freeze-out check.
    • The flag is now cleared before each evolution, a hit raises a JSWARN, and MpiMusic::get_hit_grid_boundary() lets writers record it.
  • get_music4gpu.sh: pin MUSIC4GPU and fetch EOS 9 (3046389a).
    • After cloning, it checks out a fixed MUSIC4GPU commit, as get_music.sh does for MUSIC, instead of the moving XSCAPE head.
    • It also downloads the UrQMD-matched hotQCD table (EOS 9) that the PyJetscape productions use.
  • Liquefier: evaluate only the droplets that can deposit in the current step (896e3d1c).
    • A CausalLiquefier droplet deposits in exactly one hydro step, but LiquefierBase::get_source() looped over every droplet for every cell and step: 126 s of a 184 s event.
    • LiquefierBase::prepare_active_droplets() and CausalLiquefier::droplet_may_contribute() keep only the droplets of the current step window.
    • HydroSourceJETSCAPE::prepare_list_for_current_tau_frame() sets that window once per MUSIC step; MUSIC4GPU 3037be7 calls it.
    • Callers that never set a window get the old behaviour.
    • The pin moves to MUSIC4GPU 3037be7.

Results

Setup: 0–10% Au+Au, 3D MC-Glauber (InitialProfile 131), 100×100×60 grid, music4gpu on a GB10, seed 1.

check result
pair event with deposition 184 s → 60 s; arr, arr_bg and droplets bit-identical before and after, on both the GPU and the forced-CPU (MUSIC_FORCE_CPU=1) path
null test (no deposition) 58 s; jet leg identical to the background in all 95 frames
with deposition the legs are identical up to τ = 1.0 and separate at the first deposit time
CPU vs GPU wake Δe maps have correlation ≥ 0.99999
hydro-only production (prod_AuAu_0_10) reproduces the existing output bit for bit
multi-event, setReuseHydro no truncated events after the boundary fix

Merge notes

🤖 Generated with Claude Code

https://claude.ai/code/session_019CrjXPHRbBKFbRYS7cdbKC

jhputschke and others added 3 commits September 24, 2026 17:58
…eport it

When MUSIC's freeze-out surface reaches the transverse grid edge it sets
DATA.reRunHydro and returns from the evolution, expecting its driver to
re-run on a larger grid (MUSIC's own main.cpp loops on it). X-SCAPE never
re-runs, and MUSIC clears the flag only in its constructor, so once one
event touched the edge every later event of that MUSIC instance stopped at
its first freeze-out check, silently. Seen in a 3-event two-stage run on a
small test grid: event 2's jet leg stopped after 1 frame.

- Clear the flag before each evolution (full and time-stepped paths).
- After the evolution, JSWARN if the surface hit the boundary: the stored
  evolution is truncated.
- MpiMusic::get_hit_grid_boundary() exposes it, so writers can record it
  per event.

Works with both MUSIC (CPU) and music4gpu, which have the same accessors.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019CrjXPHRbBKFbRYS7cdbKC
- Check out MUSIC4GPU b9cc8be (XSCAPE branch) after cloning, the way
  get_music.sh pins MUSIC. It adds add_hydro_source_terms_from_jet, which
  MusicWrapper calls since PR #138; the unpinned branch head made builds
  non-reproducible.
- Also download the hotQCD EOS table matched to UrQMD (EOS 9). Only the
  SMASH-matched one (EOS 91) was fetched, but the PyJetscape prod_AuAu_0_10
  productions use EOS 9.

The pin needs b9cc8be pushed to github.com/jhputschke/MUSIC4GPU.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019CrjXPHRbBKFbRYS7cdbKC
… step

A CausalLiquefier droplet deposits in exactly one hydro step, the one that
contains tau_drop + tau_delay, but LiquefierBase::get_source() looped over
every droplet (with a cosh each) for every cell at every step, and
HydroSourceJETSCAPE locked the liquefier's weak_ptr once per cell. For a
0-10% Au+Au two-stage event with 25 droplets that was 126 s of 184 s.

- LiquefierBase::prepare_active_droplets(tau_lo, tau_hi) keeps the droplets
  for which droplet_may_contribute() holds; get_source() visits only those
  (in their original order) for query times inside the window, and every
  droplet otherwise, so callers that never prepare are unaffected. Adding a
  droplet or clearing the list drops the window.
- CausalLiquefier::droplet_may_contribute(): the deposit time lies within
  the window, widened by dtau/2 + 1e-3 fm (tau arrives as a float).
- HydroSourceJETSCAPE::prepare_list_for_current_tau_frame() prepares the
  window [tau - step, tau + 2 step] once per MUSIC time step and locks the
  liquefier once there. MUSIC4GPU 3037be7 calls it for the jet source.
- get_music4gpu.sh: pin MUSIC4GPU 3037be7.

Result: 184 s -> 60 s per event (the no-deposition run takes 58 s), output
bit-identical (arr, arr_bg, droplets) on the GPU and CPU paths, full and
small grids, single and multi-event.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019CrjXPHRbBKFbRYS7cdbKC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant