Repository navigation
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Owner
|
I think there is a better way that doesn't involve logic checks:
|
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.
The problem: every generated MPI wrapper called through a function pointer without checking it. At startup the library looks up each symbol in the backend MPI library and only counts the ones it can't find. Calling one of those missing functions then dereferenced a NULL pointer and
crashed with a segfault and no message. This can happen with an older backend, or one built without the mpif patch, which lacks the MPI_*_f2c/c2f functions.
The fix (in trampi/emitter.py): each wrapper now checks the pointer before calling.
Testing: I compiled a proxy against a backend with no MPI symbols. MPI_Barrier returned 55 (MPI_ERR_UNSUPPORTED_OPERATION) instead of crashing, and MPI_Wtime printed the message and aborted. The new unit test passes. pytest isn't installed here, so I ran only that test by hand, not
the full suite, and I haven't tried a real MPICH or Open MPI backend.
To open the PR:
The returned error code bypasses the MPI error handler, so an application relying on MPI_ERRORS_ARE_FATAL won't see the usual fatal behaviour. The abort for non-int return types is my judgement call.
Smaller problems I noticed but did not change (also listed in the PR text):
Disclaimer: fully generated by Claude AI, at request of @ocaisa