You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IBM: 1-rank and 2-rank runs differ when two bodies touch at a rank seam (corrected_gps flags do not cross the seam) #2388
Two bodies in contact across a rank seam give a different fluid force on 1 rank and on 2 ranks. A seam test (two circles head-on across the x = 10 seam, friction 0.1, D/ib_forces.dat) is bitwise identical through step 16 stage 0, then the y force and torque differ by about 1e-6 at step 17, the x force by 7e-4 at step 20 and 5.6e-2 on body 2 at step 46.
Cause (found by a per-stage cell dump on the CPU, verified by reading, not yet by a fix)
The collision force is identical across rank counts (up to the sign of the pair order), and listing the bodies in the opposite order is bitwise identical on 1 rank, so lookup order is not the cause.
At t = 0.64 stage 2, four interior body cells at the point where the bodies touch the seam, (39,59), (39,60), (40,59), (40,60), differ: in the 2-rank run they hold one body's velocity (about 0.285 in x), in the 1-rank run the average of the two bodies (0.163 and -0.162). Markers and all other cells are identical.
These cells are set by the "ghost point whose image point is buried in a neighboring IB" fallback in src/simulation/m_ibm.fpp (about lines 1024-1090). It averages the neighbouring valid ghost points, found through corrected_gps%sf(jj,kk,ll) == 1. That flag is set only for a rank's own interior ghost points (about line 2416, rebuilt about line 4137) and never in halo cells, so on 2 ranks the average cannot see the other body's ghost cells across the seam. All 216 flag mismatches in the dump are halo cells.
The averaging loop also reads q values that may be one stage stale in the halo.
Proposed fix
Fill corrected_gps (and whatever the average reads) in the halo cells when the ghost points are rebuilt, with an integer halo exchange like ib_markers. The work is O(surface), so it scales to many bodies. Test: the seam case on 1, 2 and 4 ranks (x seam, y seam, periodic edge) must agree to about 1e-12; 2-rank IBM goldens generated with this defect will change toward the 1-rank answer.
Status
A fix is being prepared (draft PR to follow). The earlier 2.6e-4 residual with friction off and the 0.355 force difference in a larger study are probably the same effect.
Related pull requests: #2354 (friction regularisation, merged), #2371 and #2384 (num_procs device update, merged), #2201 (collision detection, merged). The fix PR will be linked here when opened.
Activity
sbryngelson commentedon Nov 22, 2026
Related pull requests: #2354 (friction regularisation, merged), #2371 and #2384 (num_procs device update, merged), #2201 (collision detection, merged). The fix PR will be linked here when opened.
AI-assisted (Claude Code).