Fix fluid_rho broadcast using MPI_LOGICAL instead of mpi_p#1176
Fix fluid_rho broadcast using MPI_LOGICAL instead of mpi_p#1176sbryngelson wants to merge 1 commit intoMFlowCode:masterfrom
Conversation
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Nitpicks 🔍
|
|
CodeAnt AI finished reviewing your PR. |
There was a problem hiding this comment.
Pull request overview
Fixes critical MPI broadcast type mismatch where fluid_rho, a real-valued array, was incorrectly broadcast using MPI_LOGICAL instead of mpi_p, causing data corruption on non-root MPI ranks through bit reinterpretation.
Changes:
- Corrected MPI datatype for
fluid_rhobroadcast fromMPI_LOGICALtompi_p
fluid_rho is a real(wp) array but is broadcast with MPI_LOGICAL type, silently corrupting reference densities via bit reinterpretation on non-root ranks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
54ac4d0 to
27cad3b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1176 +/- ##
=======================================
Coverage 44.05% 44.05%
=======================================
Files 70 70
Lines 20498 20498
Branches 1990 1990
=======================================
Hits 9030 9030
Misses 10329 10329
Partials 1139 1139 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Severity: CRITICAL — silently corrupts reference densities on non-root ranks.
File:
src/pre_process/m_mpi_proxy.fpp, line 61fluid_rhois areal(wp)array but is broadcast usingMPI_LOGICALinstead ofmpi_p. MPI doesn't type-check its arguments, so the bytes are reinterpreted as logicals on the receiving ranks, silently producing wrong density values.Before
After
Why this went undetected
On most systems,
MPI_LOGICALand a real happen to be the same size (4 or 8 bytes), so the call doesn't segfault. It just reinterprets the bits, producing subtly wrong values that are hard to trace back to a broadcast type mismatch.Test plan
🤖 Generated with Claude Code
Fixes #1197