ch4/ofi: make seg_sz a multiple of datatype size - #7897
Open
colleeneb wants to merge 3 commits into
Open
Conversation
hzhou
reviewed
Jul 23, 2026
| if (elem_sz) { | ||
| seg_sz -= (seg_sz % elem_sz); | ||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
This is not robust since it assumes 1. contiguous datatype, 2. no alignment requirement. Rather, we should adjust am_hdr_sz so it landed on MAX_ALIGNMENT. I'll push a commit on top of this.
The am payload data need land on MAX_ALIGNMENT or the limited seg_sz may
chop the data elements in half, resulting either ubsan error or
MPIR_Typerep_{pack,unpack} issue.
Collaborator
|
test:mpich/ch4/ofi |
We never call MPIDI_OFI_am_init_sreq with MPIDI_OFI_AMREQUEST(sreq, sreq_hdr) set. Remove the dead branch.
Collaborator
|
test:mpich/ch4/ofi |
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.
Pull Request Description
This PR changes
seg_szto a multiple of the element size inMPIDI_OFI_am_isend_pipeline.This is done because the
packed_sizeis being made a multiple of the element sizein MPIR_Typerep_pack, but
seg_szhas no such restriction, so in some cases they do notmatch.
This is a potential fix for Issue #7881 .
With
MPIR_CVAR_CH4_OFI_ENABLE_RMA=0the reproducer in that issue hitsAssertion failed in file [...]/ofi/ofi_am_impl.h at line 413: packed_size == seg_sz,which led to this PR.
Possibly there are other ways to get this work, but changing
seg_szto a multiple ofthe element size seemed the cleanest to me. The code patch here is copied from
similar code in MPIR_Typerep_pack to match it exactly.
Author Checklist
Particularly focus on why, not what. Reference background, issues, test failures, xfail entries, etc.
Commits are self-contained and do not do two things at once.
Commit message is of the form:
module: short descriptionCommit message explains what's in the commit.
Whitespace checker. Warnings test. Additional tests via comments.
For non-Argonne authors, check contribution agreement.
If necessary, request an explicit comment from your companies PR approval manager.