Skip to content

Refactor /common and beta buffer routines for future particle inclusion#1672

Draft
joshgillis wants to merge 11 commits into
MFlowCode:masterfrom
UF-MFC:refactor/particle-arrays
Draft

Refactor /common and beta buffer routines for future particle inclusion#1672
joshgillis wants to merge 11 commits into
MFlowCode:masterfrom
UF-MFC:refactor/particle-arrays

Conversation

@joshgillis

Copy link
Copy Markdown
Contributor

Description

The beta buffer communication routines were generalized to support both bubble and particle data. Previously, these routines were hard-coded to use beta_vars, which defines the communication mapping for bubble variables. Particle communication will require a different mapping (vars_send). Instead of duplicating the communication routines for each case, a generic communication variable list (vars_comm) is now passed through the call chain. Bubble routines pass beta_vars, while particle routines will pass vars_send, allowing the same communication infrastructure to be reused for both implementations.

Type of change (delete unused ones)

  • Refactor

Testing

How did you test your changes?

Test suite ran on personal machine cpu, and tuolumne gpu

Checklist

Check these like this [x] to indicate which of the below applies.

  • I added or updated tests for new behavior
  • I updated documentation if user-facing behavior changed

See the developer guide for full coding standards.

GPU changes (expand if you modified src/simulation/)
  • GPU results match CPU results
  • Tested on NVIDIA GPU or AMD GPU

AI code reviews

Reviews are not retriggered automatically. To request a review, comment on the PR:

  • @claude full review — Claude full review (also triggers on PR open/reopen/ready)
  • Or add label claude-full-review — Claude full review via label

@sbryngelson sbryngelson added claude-full-review Trigger Claude Code review and removed claude-full-review Trigger Claude Code review labels Jul 24, 2026
@github-actions

Copy link
Copy Markdown

Claude Code Review

Head SHA: df0a969

Files changed:

  • 4
  • src/common/m_boundary_common.fpp
  • src/common/m_boundary_primitives.fpp
  • src/common/m_mpi_common.fpp
  • src/simulation/m_bubbles_EL.fpp

Findings:

  • src/common/m_boundary_primitives.fpp: s_beta_extrapolation gains a new mandatory vars_comm dummy argument (and its body now indexes via idx = vars_comm(i) instead of beta_vars(i)), but no hunk in this diff updates any call site to pass the new argument — s_beta_periodic and s_beta_reflective had their call sites updated in m_boundary_common.fpp, s_beta_extrapolation did not. If this routine is invoked anywhere with the old 6-argument form, the build breaks; please confirm every caller was updated.
  • src/common/m_boundary_common.fpp, src/common/m_boundary_primitives.fpp, src/common/m_mpi_common.fpp: the new vars_comm parameter is threaded through s_populate_beta_bufferss_populate_beta_bc_directions_beta_periodic/s_beta_reflectives_mpi_reduce_beta_variables_buffers, but both call sites in m_bubbles_EL.fpp pass the same beta_vars array that was previously hardcoded inside these routines. As written, this is generalization with no current caller variation — per CLAUDE.md's guidance against "abstractions for one call site," consider whether this parameter is actually needed yet or should be added alongside the code that first varies it.

@joshgillis

Copy link
Copy Markdown
Contributor Author

I'm not sure what the review means about the updated call site for s_beta_extrapolation, I'm actually not even sure if where that subroutine is called. I can remove the changes there if that subroutine is not in use.

As for the PR as a whole, if it is preferred that this structure is not added until particles are functional I can wait and make other adjustments.

@wilfonba

Copy link
Copy Markdown
Contributor

I believe s_beta_extrapolation can just be removed. It must have slipped through at some point. Extrapolation boundary conditions for beta don't make any physical sense.

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

Labels

claude-full-review Trigger Claude Code review

Development

Successfully merging this pull request may close these issues.

3 participants