core/lb: fix LBWalberla::ghost_communication_pdf dispatch (bug-sweep #18)#5382
Draft
RudolfWeeber wants to merge 1 commit into
Draft
core/lb: fix LBWalberla::ghost_communication_pdf dispatch (bug-sweep #18)#5382RudolfWeeber wants to merge 1 commit into
RudolfWeeber wants to merge 1 commit into
Conversation
) LB::LBWalberla::ghost_communication_pdf() forwarded to lb_fluid->ghost_communication_vel() instead of lb_fluid->ghost_communication_pdf() (a verbatim copy-paste typo from the sibling vel wrapper, introduced in commit 5e39e84 "Split LB communicators"). The two backing methods use distinct communicators and distinct lazy pending flags (GhostComm::PDF vs GhostComm::VEL). Consequence: after a PDF-only setter such as set_node_density (which sets ONLY GhostComm::PDF), the wrapper's mis-wired vel call sees VEL not pending and no-ops, so the PDF ghost layer is never communicated. A neighbouring rank then reads stale ghost densities (e.g. via the CylindricalLBFluxDensityProfile observable on the setter-then-observe path), and in an assert build the consider_ghosts PDF-pending assertion in get_node_density fires. Fix: forward to lb_fluid->ghost_communication_pdf(). The method has a clear contract (flush the PDF ghost layer) with a correct backing implementation; only the wrapper dispatched to the wrong one. Adds a NUM_PROC 2 regression test exercising the CORE wrapper via espresso::system->lb.ghost_communication_pdf(): write a distinct density on every owned node, flush through the wrapper, and verify the ghost layer on the neighbouring rank holds the communicated value. The existing walberla_bridge tests cannot catch this because they call LBWalberlaImpl::ghost_communication_pdf() directly, which is correct. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LB::LBWalberla::ghost_communication_pdf() forwarded to
lb_fluid->ghost_communication_vel() instead of
lb_fluid->ghost_communication_pdf() (a verbatim copy-paste typo from the
sibling vel wrapper, introduced in commit 5e39e84 "Split LB
communicators"). The two backing methods use distinct communicators and
distinct lazy pending flags (GhostComm::PDF vs GhostComm::VEL).
Consequence: after a PDF-only setter such as set_node_density (which sets
ONLY GhostComm::PDF), the wrapper's mis-wired vel call sees VEL not
pending and no-ops, so the PDF ghost layer is never communicated. A
neighbouring rank then reads stale ghost densities (e.g. via the
CylindricalLBFluxDensityProfile observable on the setter-then-observe
path), and in an assert build the consider_ghosts PDF-pending assertion
in get_node_density fires.
Fix: forward to lb_fluid->ghost_communication_pdf(). The method has a
clear contract (flush the PDF ghost layer) with a correct backing
implementation; only the wrapper dispatched to the wrong one.
Adds a NUM_PROC 2 regression test exercising the CORE wrapper via
espresso::system->lb.ghost_communication_pdf(): write a distinct density
on every owned node, flush through the wrapper, and verify the ghost
layer on the neighbouring rank holds the communicated value. The
existing walberla_bridge tests cannot catch this because they call
LBWalberlaImpl::ghost_communication_pdf() directly, which is correct.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
🤖 Generated with Claude Code