Fix NaN check reading wrong index in MPI unpack#1231
Fix NaN check reading wrong index in MPI unpack#1231sbryngelson wants to merge 1 commit intoMFlowCode:masterfrom
Conversation
The NaN diagnostic check used q_comm(i)%sf(j, k, l) but the value was unpacked into q_comm(i)%sf(j + unpack_offset, k, l). This meant the check was reading a stale or unrelated cell instead of the just- received value. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in Intel compiler-specific diagnostic code where NaN checks after MPI buffer unpacking were reading from incorrect array indices. The data was being written to offset indices (j + unpack_offset, k + unpack_offset, or l + unpack_offset depending on the spatial direction), but the NaN checks were reading from non-offset indices (j, k, or l), effectively checking the wrong memory cells.
Changes:
- Fixed NaN check index in j-direction MPI buffer unpacking to use
j + unpack_offsetinstead ofj - Fixed NaN check index in k-direction MPI buffer unpacking to use
k + unpack_offsetinstead ofk - Fixed NaN check index in l-direction MPI buffer unpacking to use
l + unpack_offsetinstead ofl
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1231 +/- ##
==========================================
- Coverage 44.07% 44.05% -0.02%
==========================================
Files 70 70
Lines 20431 20498 +67
Branches 1974 1990 +16
==========================================
+ Hits 9004 9030 +26
- Misses 10291 10329 +38
- Partials 1136 1139 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Superseded by #1242 (batched HPC-sensitive fixes) |
User description
Summary
q_comm(i)%sf(j, k, l)instead ofq_comm(i)%sf(j + unpack_offset, k, l)Test plan
🤖 Generated with Claude Code
CodeAnt-AI Description
Fix NaN diagnostic to check unpacked MPI buffer locations
What Changed
Impact
✅ Fewer spurious NaN error stops during MPI unpack✅ Clearer diagnostics that point to the just-received value✅ More reliable MPI data validation on Intel compilers💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.