-
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
Some MPI Functions can be Macros #7
Comments
The F2C/C2F functions aren't on the critical path of most code. They really only matter if somebody writes a Fortran interface that talks to C without assuming implementation details (as I've been doing). If we standardize a C ABI and change Fortran MPI_VAL to match, conversions can be macros for F08. Then we can make the others real functions and just tell the F90 users that it isn't 1992 anymore. Wtime should be a symbol. Nobody should call it so much that it matters. Most implementations call enough stuff that a macro implementation is pointless (Blue Gene is the only exception in recent times and it's dead). The AINT arithmetic functions were created because Fortran doesn't have unsigned integers. It is a stupid problem and deserves a stupid solution (function call). Modern links can do inclining now anyways. |
Yes, just for the story, once wrote a toy generator from MPI bindings description, for exactly this too: https://github.com/besnardjb/mpi_meta#cfbindpy Thanks for all these interesting details that I overlooked on the Fortran side ! Yes if it impacts you -- you probably looked for it. Advice would then be close to: make it a Macro if you can write it in plain C / ASM without function call, this way we do not close to door to optimized C2F (or others). |
It looks like we will get symbols for timers and handle conversions in 4.1. The AINT macros might remain, because they're just too stupid to mess with. The primary reason they're there is segmented addressing in C, which isn't a thing anymore. Another reason is specific to dynamic windows in RMA. |
My preference is to expose the MPI ABI in Whether an implementation's |
We should be able to get them into |
Problem
The ABI is all about being able to retarget MPI binaries to another MPI implementation. It means all MPI libraries should provides the same interface and therefore there should be no "hidden" expectation from the binary, for example through macros coming from
mpi.h
. In the standard, there are of course constants as handled in #1 but some functions could also be manipulated at compile time through macros as per2.6.4
:Hidden Function Call
Therefore, if you consider an
MPI_WTIME
unfolded as:Changing the MPI library would lead to an undefined symbol as it would not be caught as part of the regular interface.
Handle Magics
The
C2F
interface is also concerned and therefore if there is some bit-manipulation magic in place in the conversion functions, this conversion would not be relevant for another implementation. This second issue is probably going to mitigate itself when working on the C ABI (as there will be less handle freedom).Proposal
Changes to the Text
TBD
Impact on Implementations
Impact on Users
WTIME
is not inlined anymore it can change perf (but it is not already BTW)References and Pull Requests
TBD
The text was updated successfully, but these errors were encountered: