Skip to content

AMR: Lagrangian particles (particles_lagrange): two-way coupling faults or stalls with a refined block #2255

In progress

Description

@sbryngelson

Summary

Lagrangian particles (particles_lagrange = T) are not validated under AMR. With the validator gate lifted, one-way coupled cases run, but two-way coupled cases either fault on the GPU or do not finish as soon as a refined block is added.

Current behaviour

case_validator.py rejects the combination today through the fail-closed list:

amr has not been validated with particle_params%pressure_gradient_force, particle_params%write_particles, particles_lagrange = T

So this is not reachable by a user. It was found by a scratch sweep that reran every non-AMR test in the suite with one static refined block added (amr = T, amr_regrid_int = 0) and the AMR gates turned into notes. Frontier, MI250X, amdflang, OpenMP offload, master at 53957c0.

Of the Lagrange-particle tests in the suite:

  • One-way coupling: all 6 run (2D/3D, tracer, 2 MPI ranks). The level-0 output differs from the uniform-grid golden by a relative L1 of 1e-2 to 3e-2, which is the size expected from refining part of the flow.
  • Two-way coupling: 13 abort with HSA_STATUS_ERROR_MEMORY_FAULT right after "Lagrangian particles in the domain" is printed, i.e. at or just after start-up (A7437748, EDD3540A, AF7E892D, 0342F987, 6F03C3A6, A2AEA396, 4A791BAE, 3C74B315, 1A7F785E, 8EEBC162, E24A8B63, 6F973A65, 77BBD2AD).
  • Two-way coupling: 4 to 7 never finish. 3FDDCD53, 42C85A5A, FC93895D and 04AB4F8D produced no result in either pass, and E24A8B63, 6F973A65 and 77BBD2AD none in the first pass (where the block was placed differently); three of four test shards hit their time limit with these outstanding. I take that as a hang, but I did not attach to a stuck process, so some of them may only have been queued behind one that was.
  • Three two-way cases run (24344628, 8A5F1D3C, E7CD0EFF) but land far from the golden (relative L1 near 1). I have not looked at why; the block covers half the domain and these may simply be sensitive cases.

What is not known

Whether the fault is in the particle-to-grid source deposit reading or writing outside the swapped fine arrays, in a particle array sized from the coarse grid, or elsewhere. I did not debug it. The memory fault and the hang may be one bug.

What is needed

  1. Reproduce one faulting case (2D two-way coupling, A7437748, is the smallest) on a single GPU with the offload debug agent, and find the kernel.
  2. Decide where the particle source terms live under AMR: the simplest consistent choice is the one the acoustic source already uses, coarse grid only with an abort when a particle's support overlaps a fine block, but that defeats the purpose for particle-laden flows. The alternative is depositing on the finest level that covers the particle and restricting.
  3. Add particles_lagrange and the particle_params switches to AMR_VETTED_FLAGS only when goldens exist for one-way and two-way coupling.

Done when

One-way and two-way coupled cases run under AMR with goldens, or the validator message says specifically that two-way coupling is unsupported and why.


Context: follow-up to #2117, tracked in #2247. Found by a sweep run with Claude Code; the failures above were observed, the causes were not investigated.

Activity

  1. added
    enhancement
    on Nov 14, 2026
  2. changed the title [-]AMR: Lagrangian particles (particles_lagrange): two-way coupling faults or hangs with a refined block[/-] [+]AMR: Lagrangian particles (particles_lagrange): two-way coupling faults or stalls with a refined block[/+] on Nov 14, 2026
  3. sbryngelson commented on Nov 27, 2026

    @sbryngelson
    MemberAuthor

    Status. On master, particles_lagrange is rejected under AMR because it is not on the vetted list, so the faults and stalls cannot happen for users. #2536 makes the message give the reason.

    • Probable cause. m_rhs runs the particle dynamics and the two-way source with no .not. amr_in_fine_advance guard. Lagrangian bubbles have one. So a fine RHS would run particle updates on block indices, with their own MPI calls.
    • Fix: M, keeping particles on level 0.
      • The guard, on the dynamics, the two-way source and s_compute_particle_gradients.
      • A particle support box.
      • Extend the bubbles_lagrange AMR hooks to particles: regrid clipping (s_amr_compute_lag_supp), the per-stage overlap check, the ghost validity in m_amr_stage, and the volume-fraction closure.
      • Goldens for one-way, two-way and np = 2.
    • Depositing on fine levels is L.

    (Posted with Claude Code.)

  4. sbryngelson commented on Nov 28, 2026

    @sbryngelson
    MemberAuthor

    One remainder moved out of this issue. A Lagrangian particle or bubble cloud under a refined block (today a run-time abort), together with an acoustic source under a block, is now #2554. Level-0 particles with blocks clear of them are in #2539, so this issue can close when #2539 merges.

    (Posted with Claude Code.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions