Skip to content

Default and broadcast particle_cloud shell_axis in pre_process - #2123

Draft
sbryngelson wants to merge 1 commit into
MFlowCode:masterfrom
sbryngelson:wave1/pre-shell-axis-bcast
Draft

sbryngelson wants to merge 1 commit into
MFlowCode:masterfrom
sbryngelson:wave1/pre-shell-axis-bcast

Conversation

@sbryngelson

Copy link
Copy Markdown
Member

What

pre_process reads particle_cloud(i)%shell_axis in s_sample_cloud_candidate
but never gave it a default or broadcast it; only simulation, which does
not use it, did both. Under file_per_process every rank samples the
cloud itself, so non-root ranks placed hemisphere-shell particles with an
uninitialized axis, and without a namelist value even rank 0 read
garbage.

Default it to 3 (+z) and broadcast it with the other hand-written
particle_cloud members, mirroring simulation.

Verified with a 3D hemisphere-shell cloud (shell_axis = 1,
file_per_process, 20 particles): the IB state from 2 ranks now matches
the 1-rank run exactly and every particle lies on the +x side.

Verification

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

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

pre_process reads particle_cloud(i)%shell_axis in s_sample_cloud_candidate
but never gave it a default or broadcast it; only simulation, which does
not use it, did both. Under file_per_process every rank samples the
cloud itself, so non-root ranks placed hemisphere-shell particles with an
uninitialized axis, and without a namelist value even rank 0 read
garbage.

Default it to 3 (+z) and broadcast it with the other hand-written
particle_cloud members, mirroring simulation.

Verified with a 3D hemisphere-shell cloud (shell_axis = 1,
file_per_process, 20 particles): the IB state from 2 ranks now matches
the 1-rank run exactly and every particle lies on the +x side.
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Lines of Code

File Lines Diff
src/pre_process/m_global_parameters.fpp 476 +1
src/pre_process/m_mpi_proxy.fpp 145 +1
Directory Lines Diff
pre_process 5024 +2
total 47632 +2

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Claude Code Review

Head SHA: 194e606

Files changed:

  • 2
  • src/pre_process/m_global_parameters.fpp
  • src/pre_process/m_mpi_proxy.fpp

Findings:
No issues found. Checked in step 4: src/pre_process/m_global_parameters.fpp, src/pre_process/m_mpi_proxy.fpp (the new shell_axis default of 3 matches the simulation default, the derived type field and the validator default. The MPI broadcast is placed in the same loop as the other particle_cloud integer fields).

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