-
Notifications
You must be signed in to change notification settings - Fork 15
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_Aint_add
and MPI_Aint_diff
#44
base: master
Are you sure you want to change the base?
Conversation
Hmm for some reason github added my merge of master as individual commits ... Does anyone know how to fix that ? |
Awesome work, as always. |
Thank you :) The idea is to only override the symbols when necessary. Putting the define in That way, if another library decides to change the implementation of the symbol, it will be respected. |
This PR is a good fix for this issue. After review we decided to fix this another way: we will add these functions to the generated ones. Thanks again for this work, it will serve as a base to our implementation. |
Hey again,
Sorry for the multiple PRs, but I felt this one is a feature integration rather than the bug fix of my other one, thus deserving a separate PR.
This PR is meant to fix #18 by introducing support of the MPI 3.1 functions
MPI_Aint_add
andMPI_Aint_diff
.The encountered issue was that OpenMPI's implementation of those functions is a macro, making the symbols absent from the library. This means that when running with preload using
--from MPICH/Intel --to OpenMPI
, the application crashes with an undefined symbol.This is resolved by overriding the symbols and preventing the ASM router from doing its work, and rather implementing the OpenMPI macro directly.
Addition to the header
I added the definition found in the MPI3.1 standard of the two functions to
interface/interface_utils/include/mpi.h
. I have no experience with fortran so I decided not to touch things on the fortran side.Symbol contents
I implemented the overrides by making sure they matched the output of OpenMPI's
mpicc
. For the following code:We get the following assembly, compiled using
mpicc -c -g -O0
:So simple additions and subtractions. This is reflected in the overrides:
https://github.com/spoutn1k/wi4mpi/blob/96e458a0733c14ca80156db7ed0e39aa37fe2da1/src/common/override.c#L340-L357
When this applies
The override is enabled only when OpenMPI is used as target, not when any other combination of library is used. The override directives
#define MPI_AINT_XXX_OVERRIDE
are defined in the following files:interface/header/_OMPI/app_mpi.h
preload/header/INTEL_OMPI/app_mpi.h
preload/header/MPICH_OMPI/app_mpi.h
What's missing
This PR is my first real code contribution to the project, and I am unsure about certain things:
MPI_Aint
variables. This seemed not to be an issue experimentally, but it might be necessary if they stray further between vendors ? I could not find aaint_a2r
oraint_r2a
, so I just skipped that step. Let me know if I should look into implementing that.