Skip to content

Broadcast periodic_bc to all simulation ranks - #2122

Draft
sbryngelson wants to merge 1 commit into
MFlowCode:masterfrom
sbryngelson:wave1/periodic-bc-bcast
Draft

sbryngelson wants to merge 1 commit into
MFlowCode:masterfrom
sbryngelson:wave1/periodic-bc-bcast

Conversation

@sbryngelson

Copy link
Copy Markdown
Member

What

periodic_bc is set from the global bc_[xyz] values in s_read_input_file, which only rank 0 runs, and was never broadcast. s_mpi_sendrecv_particles reads it on every rank to decide whether to wrap Lagrangian bubble positions across periodic boundaries, so on every other rank it stayed .false. and bubbles leaving through a periodic face were never wrapped.

Broadcast it next to bc_io. Computing it after the broadcast is not an option because domain decomposition overwrites the interior ranks' bc values with neighbour ids. pre_process and post_process have no periodic_bc.

Verification

On a 2-rank 2D Lagrangian bubble case with periodic x, rank 1 now holds periodic_bc = T F F (it held F F F before). Lagrange bubble tests pass.

Testing. Built with GPU offload (OpenMP, AMD) and ran the full test suite with this fix and three other independent fixes applied together: 729 tests in 4 shards, 0 failures (three shards on MI300A, one on MI250X).

Prepared with Claude Code (AI-assisted); I reviewed the change and ran the tests.

periodic_bc is set from the global bc_[xyz] values in s_read_input_file,
which only rank 0 runs, and was never broadcast. s_mpi_sendrecv_particles
reads it on every rank to decide whether to wrap Lagrangian bubble
positions across periodic boundaries, so on every other rank it stayed
.false. and bubbles leaving through a periodic face were never wrapped.

Broadcast it next to bc_io. Computing it after the broadcast is not an
option because domain decomposition overwrites the interior ranks' bc
values with neighbor ids. pre_process and post_process have no
periodic_bc.

Verified on a 2-rank 2D Lagrangian bubble case with periodic x: rank 1
now holds periodic_bc = T F F (it held F F F before). Lagrange bubble
tests pass.
@sbryngelson
sbryngelson requested a review from a team as a code owner November 3, 2026 03:26
@sbryngelson
sbryngelson requested review from danieljvickers and removed request for a team November 3, 2026 03:26
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Lines of Code

File Lines Diff
src/simulation/m_mpi_proxy.fpp 535 +1
Directory Lines Diff
simulation 28581 +1
total 47631 +1

@sbryngelson
sbryngelson marked this pull request as draft November 3, 2026 03:39
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Claude Code Review

Head SHA: 20a5591

Files changed:

  • 1
  • src/simulation/m_mpi_proxy.fpp

Findings:
No issues found. Checked in step 4: src/simulation/m_mpi_proxy.fpp (periodic_bc is set only on rank 0 in s_read_input_file and is declared as logical, dimension(3); the new 3-element MPI_LOGICAL broadcast is correct and runs in s_mpi_bcast_user_inputs before the s_wrap_particle_positions use).

@codecov

codecov Bot commented Nov 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.90%. Comparing base (a03848a) to head (20a5591).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2122   +/-   ##
=======================================
  Coverage   61.90%   61.90%           
=======================================
  Files          86       86           
  Lines       22948    22949    +1     
  Branches     3386     3386           
=======================================
+ Hits        14205    14206    +1     
  Misses       6229     6229           
  Partials     2514     2514           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant