-
Notifications
You must be signed in to change notification settings - Fork 279
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
ABI: Fortran binding on top of core C ABI #6953
base: main
Are you sure you want to change the base?
Conversation
@dalcinl This what I am experimenting. |
Current ABI draft -
My rejection:
My proposal:
Examplescase 1:
case 2:
case 3:
|
IIUC, your proposal makes the API of the ABI a subset of the full MPI API. Now code that uses the full API will not be able to swap implementations at runtime, just because you cannot constraint If Fortran interoperability cannot be achieved exclusively through the C MPI ABI library, then mpi4py will simply stop supporting any kind of Fortran interoperability, and I'll blame the Forum decision for such short-sighted view of the software ecosystem. The C programming language should be considered lingua franca for language interoperability: Python/Julia/Rust/Java all have established and robust mechanisms tp interoperate well with C, and Fortran interoperate with C with its own mechanism, then it is obvious that C can be the easy bridge between languages. |
Seems irrational. The |
The Fortran related APIs are meant for interoperation from C to Fortran, and it only can be implemented by a Fortran binding implementation. Split the header allows an independent Fortran binding implementation. For most C MPI code, it won't need mpi_abi_fort.h nor a Fortran binding. For those C code that need Fortran inter-op APIs, they must be linked to a Fortran binding library, e.g. libmpifort.so and likely also linked to Fortran runtime.
Skip MPI_Fint, _{f2c,c2f,f2f08,f082f,c2f08,f082c}, MPI_{F,F08}_STATUS(ES)_IGNORE etc.
Add an option so different bindings can selectively choose to whether to only load function defined in the custom_dir or all functions listed in the binding_dir.
Start from a duplicate copy. We'll refactor later. Or, if things work out, the ABI fortran binding will be the only binding we need.
Port MPICH's fortran binding implementation to abi_fortran.
Re-implement proxy wrappers for attribute callbacks that does not rely on internal backdoor functions to pass the Fortran context.
Notes so far:
|
This rationale itches me a bit... This stuff is not only useful for language bindings. Third party quality libraries making advanced used of MPI can definitely take advantage all these features to handle state and lifetime of things the proper and easy way.
You should clarify whether these hooks are collective or not on invocation. You most likely want collective. Finalize hooks are somewhat supported via silly attributes set in MPI_COMM_SELF, but my understanding is that these are not collective. |
Yes, it may seem irrational, but only until the day you have to deal with the many issues you may face by introducing binary dependencies (either statically embedded in libraries at link time or dynamically linked via Look, I'm really serious about avoiding hard-dependencies. For example, 99% of mpi4py users also use NumPy. Making mpi4py depend on NumPy would allow me to simplify a lot of stuff and cleanup my code. NumPy have well established API/ABI mechanisms that minimize the dependency problem when upgrading versions, so that's another point in favor. Yet, I refuse for mpi4py to explicitly depend on NumPy. Hard dependencies eventually produce pain points downstream. Fortran support is baggage MPI still has to deal with. In the mid to long term I'm totally in favor of moving away from old bad practice. But that should not happen at the expense of pain and mess pushed on users. Current ABI proposal may already generate controversy as it is. What you are trying to do with your Fortran changes adds a lot of mess on top, and IMHO you are jeopardizing the current effort. Is not about the "what", it is about the "when". |
Pull Request Description
This is an experimental draft, (very) incomplete
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.