forked from pmodels/mpich
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Support mpi_abi.h #1
Open
hzhou
wants to merge
963
commits into
mpiwg-abi:main
Choose a base branch
from
hzhou:2302_abi
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.
Open
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
hzhou
force-pushed
the
2302_abi
branch
11 times, most recently
from
February 23, 2023 20:46
e45657d
to
1771074
Compare
hzhou
force-pushed
the
2302_abi
branch
9 times, most recently
from
March 4, 2023 01:13
c425c43
to
ac182e0
Compare
Provide cptr version of MPI_Alloc_mem. This is needed by the generic interface in mpi.mod.
Provide specific interface so MPI_Alloc_mem could return baseptr as TYPE(C_PTR), as specified in the standard.
We need PMPI_Wtime and PMPI_Wtick since otherwise the compiler doesn't know the function return type. We need PMPI interfaces for other functions for the same reason that we need MPI interfaces.
It was a bug previously but it did not trigger test failures due to not using generic interfaces. Now we it triggers compile error that we switched all functions to generic interfaces.
Add test for MPI_Alloc_mem and return Type(C_PTR).
binding/f90: Add `c_ptr` interface for `MPI_Alloc_mem` Approved-by: Ken Raffenetti
Move MPIR_Request_completion_processing inside MPIR_Test and MPIR_Wait. The call frees potential resource and transfers the status. Do it inside MPIR_Test and MPIR_Wait makes the code more consistent and cleaner.
For MPI_{Test,Wait}_{all,any,some}, free the completed requests and set to MPI_REQUEST_NULL in the binding layer. This prepares for MPI_Get_status_{all,any,some} that are added in MPI 4.1. We also convert all request pointers for MPI_Testall and MPI_Waitall. MPI_Waitall will need to convert all pointers anyway, so there shouldn't be performance difference -- if any, should be better. MPI_Testall has no impact for count < 64, the batch size. The impact of large testall request arrays will be negligible compared to the overhead of running progress.
This allows gforker and remshell to handle longer pmi commands and commodate longer kvs values. This is needed to handle larger port names such as the case for ch4:ucx.
Allow users to request support for MPI memory allocation kinds via this command line option. The string will be propagated to the proxies and returned via PMI job attribute query (key="PMI_mpi_memory_alloc_kinds").
pm: increase PMI max length to 4096 Approved-by: Ken Raffenetti
* Try avoid print handle as int * MPI_MESSAGE_NULL may not be MPI_REQUEST_NULL * MPI_Comm may not be the same as MPI_Win * Cast to (long long) to print MPI_Count
We should not assume handles to be of integer type.
Custom clean up code (ref. MPI_Comm_spawn_multiple) are loaded in func['code-clean_up']. We need avoid overwriting this attribute or we will lose the custom cleanup code then function is being processed twice.
Newer gcc warns when non-null array constants such as MPI_UNWEIGHTED is passed to paramber typed as "int param[]". Make the parameter type simply a pointer avoids such warnings.
Remove the assumption that MPI_PROC_NULL is -1 and MPI_ANY_SOURCE is -2.
The constants may be defined as negative integers, as in the current ABI draft.
MPID_MAX_PORT_NAME is 1024, and it is the same as abi MPI_MAX_PORT_NAME. Alternatively, we can raise MPID_MAX_PORT_NAME to higher value.
This is a stand-in mpi_abi.h, extracted from https://github.com/jeffhammond/mukautuva.
Then internal code need deal with both the types from ABI header and the actual types used by MPICH. Generate mpi_abi_internal.h from mpi_abi.h by renaming all MPI_ typenames into ABI_ prefix. Generate mpi_abi_util.c to initialize an internal table for builtin datatypes and ops conversions. Generates: src/binding/abi/mpi_abi_internal.h src/binding/abi/mpi_abi_util.c
Various conversion functions.
Use --enable-mpi-abi configure option to enable build and installing libmpi_abi.so.
Dump c_binding_abi.c, to be linked into libmpi_abi.so.
If MPI_ABI is defined, make mpi.h to effectively the same as mpi_abi.h. This allows applications to use mpicc_abi to compile their code without any changes.
When BUILD_MPI_ABI is defined, include mpi_abi_internal.h, and exclude the portion that defines constants and typedefs that are already defined in mpi_abi_internal.h. We essentially swapping the ABI for all internal code. Note that we need to always define the MPICH specific parts or some internal code won't build. MPICH_SUPPRESS_PROTOTYPES is no longer used, so we removed it.
Internal all handles object may not be part of the ABI. Add check macro to replace it on entry.
The ABI signature of callback functions can be different. We need convert the handle input upon calling callbacks.
MPI-5 ABI may define various DUP_FN as constants. We can easily swap them during input.
MPI_COMBINER_HVECTOR_INTEGER, MPI_COMBINER_HINDEXED_INTEGER, and MPI_COMBINER_STRUCT_INTEGER are removed in the current MPI standards and thus can be missing from the abi header. Add macro-guard to prevent compile failures.
* Pass --enable-mpi-abi to romio configure * Build libromio_abi.so and libpromio_abi.so when enabled * Include mpi_abi.h instead of mpi.h when BUILD_MPI_ABI is defined * internally adio.h will include mpio.h without abi, and romio_abi_internal.h with abi. I.e. mpio.h is skipped ifdef BUILD_MPI_ABI.
Three routines are defined in ROMIO, potentially using ABI header. We need handler conversion to use inside MPICH. Only include mpir_ext.h in the code that needs it. With BUILD_MPI_ABI, we need alter the function parameter types for conversions. Since we no longer include mpir_ext.h in the binding files, we need explicitly declare them. We can treat them as void pointers to avoid the distinction between ABI and non-ABI versions.
ROMIO directly uses the MPI ABI header since it sits on top of the MPI layer. As such, we need add ABI handle conversions for functions defined in MPICH and called by ROMIO. Define them all in src/glue/romio/glue_romio.c.
Update builtin handle constants based on upstream huffman coding scheme. Ref: https://github.com/mpiwg-abi/specification-text-draft/blob/main/print-handle-constants.py
Update constant definitions based on upstream reference - https://github.com/mpiwg-abi/specification-text-draft/blob/main/IntegerConstants.md
Taking mpi.h from https://github.com/mpiwg-abi/header_and_stub_library at commit 38a272b.
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
Reference: pmodels#6390
Synopsis
Checklist
make install
mpicc_abi -o cpi_abi examples/cpi.c && mpirun -n 2 ./cpi_abi