-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
datatype: map builtin MPI datatypes to internal types #7264
Draft
hzhou
wants to merge
10
commits into
pmodels:main
Choose a base branch
from
hzhou:2501_type_swap
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
4 tasks
dalcinl
reviewed
Jan 15, 2025
dalcinl
reviewed
Jan 15, 2025
dalcinl
reviewed
Jan 15, 2025
dalcinl
reviewed
Jan 15, 2025
dalcinl
reviewed
Jan 15, 2025
Many builtin or predefined datatypes are equivalent. Define a list of supported internal types and map predefined datatypes to internal datatypes. This way, internally we only need support a fixed list of datatypes.
Add op support for internal types such as MPIR_SIGNED_INT8 etc.
So that internally we only deal with fixed types. FIXME: type creation routines should swap types at a later stage so the get_content still work correctly.
For v/w collectives with array inputs, we need array dimensions for parameter validation and potential large count swap. Get the dimension at the front of the function to avoid duplicating code. Note: we need this dimension for swapping input datatype with internal datatype.
We need allocate local arrays for swapping large count array inputs. Use MPIR_CHLMEM_MALLOC simplifies the checking of MPL_free.
Swap builtin datatyps with internal builtins upon user input, so that internally we deal with a fixed set of builtin datatypes. TODO: handle the swap for datatype creation routines inside the impl functions. This is because we need report the original input datatypes in MPI_Type_get_contents.
For example, map MPI_INT to MPIR_SIGNED_INT4 at configure and init time, and internally only deal with MPIR_SIGNED_INT4.
It is unnecessary. And internal types don't have corresponding datatype structures.
The external builtin datatypes, e.g. MPI_INT, may be reconfigured at runtime. This won't be the case practically, but it is possibility by design, so that all MPI builtin datatypes, MPI_INT or MPI_INTEGER, are treated the same.
Reorder the MPI datatype definitions according to their builtin index.
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
Many of the MPI Datatypes are redundant, for example,
MPI_INT
,MPI_INT32_t
,MPI_INTEGER
. The new ABI proposal requires setting some of these types at runtime, for example,MPI_Abi_set_fortran_info
. In this PR, we create a set of fixed-size internal datatypes and then map all external builtin types to internal ones. This allows runtime setting and resetting any builtin types. And internally, we only need to support a fixed set.Discussion
MPI_Send
,MPI_Bcast
, we can replace builtin datatypes withMPIR_FIXED#
, since all we care is the data size.MPI_Reduce
,MPI_Accumulate
, we can replace builtin datatypes with internal types (but notMPIR_FIXED#
)MPIR_FIXED#
. We don't need worry about reduction op because we'll always rely on user op for them.MPI_INT
toMPI_FLOAT
. But we don't perform such validation today anyway. It is an extra overhead that we can't afford. In principle, we could perform strict type matching under e.g.--enable-error-checking=2
[skip warnings]
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 description
Commit 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.