Repository navigation
IBM: wrap a periodic centroid that lands exactly on the domain end - #2335
Conversation
s_wrap_periodic_ibs wrapped a centroid only when it was greater than the domain end, but the last rank owns [beg, end), so a centroid exactly on the end belonged to no rank until the next step. The body then lost its row in ib_forces.dat (and its owner) for that step. Wrap at >= end. Adds a 2-rank test whose circle reaches x = 1 exactly.
|
Claude Code Review Head SHA: d503aac Files changed:
Findings: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2335 +/- ##
==========================================
+ Coverage 65.68% 65.71% +0.02%
==========================================
Files 111 111
Lines 30258 30258
Branches 4616 4616
==========================================
+ Hits 19875 19884 +9
+ Misses 6670 6657 -13
- Partials 3713 3717 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
For information, from tests on one node of MI250X applying each branch alone to the base it was cut from (cd2180c): a periodic box with 1000 free moving circles that aborts on the ICFL check at step 2 on that base still aborts with only this change applied, and runs with #2340 applied. With both applied, six free spinning circles on and across the seams of a 2x2 split give 1-rank and 4-rank force and torque histories identical to 1e-14 over 100 steps. This comment was made with Claude Code (AI). |
Contribution Policy
All contributions are expected to demonstrate:
If these expectations are not met, we would prefer to implement the changes ourselves rather than spend time reviewing low-effort submissions.
Summary
With periodic boundaries a moving body's centroid is wrapped by
s_wrap_periodic_ibsonly when it is strictly greater than the domain end. The last rank owns the half-open interval[beg, end), so a centroid exactly on the end belongs to no rank until the next step wraps it. For that step no rank owns the body: it has no row inib_forces.dat(a hole of NUL bytes) and no owner for its force reduction. This changes the wrap to>=(all three directions share the macro). The left end needs no change: a centroid equal tobegis owned by the first rank.A centroid lands exactly on the end whenever positions and steps are exactly representable, for example bodies started on a regular lattice and moved with dyadic steps.
Evidence
Periodic 2D box (128x128 cells, 8 prescribed-velocity circles, 300 steps,
dt= 2^-6), a circle reaching x = 8 = the domain end exactly at step 256. On 2, 4 and 8 ranksib_forces.dathad one NUL-filled record for that body and step (1 rank: none). With the change the file has every record.Tests
New test
IBM -> Centroid On Periodic Domain End -> 2 MPI Ranks(50B98DBF): a circle that reaches x = 1 exactly after 3 steps (dt= 2^-11),ib_force_wrt, 2 ranks. Golden generated with the fix (CPU build, Cray CCE, MI250X node). Without the change the test fails:Failed to interpret the content of .../D/ib_forces.dat as a list of floating point numbers(the NUL record). With it, the test passes on rerun../mfc.sh precheckpasses.Limitations
Only the CPU build was run by hand; the change is host-side-equivalent in the GPU loop (one comparison). A centroid placed exactly on the end in the input file is not wrapped at start-up and is still unowned at step 0; that is not changed here.
This PR was made with Claude Code (AI).