Add missing functions to Fortran use_mpi interface - #14219
Conversation
|
You should only need the first commit to fix this problem. The correct interfaces for both PMPI and MPI should be defined in the generated mpi-ignore-tkr-interfaces-generated.h. |
|
mpi-ignore-tkr-interfaces-generated.h only creates a list of defines, guarded by OMPI_BUILD_MPI_PROFILING, for MPI->PMPI, not any new interfaces. As for the build failure, it looks like there's something else broken with the _FTS suffixed functions. I'm taking a look now. |
|
Hello! The Git Commit Checker CI bot found a few problems with this PR: 222ee8b: use-mpi: Generate and compile _FTS C glue
be3d6f6: use-mpi: Make sure PMPI rename exists for interfac...
096e959: use-mpi: Regen interfaces if python generator modi...
Please fix these problems and, if necessary, force-push new commits back up to the PR branch. Thanks! |
|
So it looks like I stumbled into a rabbit hole... With the second commit of this PR I added interfaces for the PMPI versions of all generated use-mpi-ignore-tkr functions, But the interface does not have the _FTS suffix, which leads to: Which is incorrect, and leads to multiple equivalent interface names, one for (P)MPI each but with the same interface name. Correct example from f08: Meaning a define for the TS, big, and interface name each. The reason for that is because its gated away in I'm pretty sure this is to get the non _f08 suffixed name for f08, but it ignores the _FTS suffix for f90. I've added a commit (a76e35e) which fixes this by collecting all required names (TS, big and interface if interface != TS), But when testing this, I got another error. I've essentially recreated the f08 setup in f90 in commit 2b711dc in order to get this to work. Finally, b6a6731 just makes sure that the generated interface is recreated if the script is modified, which tripped me up a few times. |
4c8bdfa to
c081483
Compare
|
@devreal could you do a co-pilot scan on this PR? |
There was a problem hiding this comment.
Pull request overview
This PR fixes missing / incorrect Fortran use mpi (ignore-TKR) interfaces by correcting an unintended MPI_... → PMPI_... macro substitution for MPI_Status_set_elements, and by ensuring PMPI variants are generated for the set of interfaces coming from mpi-ignore-tkr-interfaces-generated.h. It also extends the bindings generator and build system to generate/compile the needed TS-related Fortran/C glue code for the ignore-TKR mpi module.
Changes:
- Remove the stray
MPI_Status_set_elementsprofiling rename macro that caused the non-PMPI interface to be omitted. - Include
mpi-ignore-tkr-interfaces-generated.ha second time withOMPI_BUILD_MPI_PROFILING=1so PMPI interfaces are emitted for the generated interface set. - Add new build targets/subdir to generate and build F90/C wrapper code for TS routines (plus generator updates, config wiring, and ignore patterns).
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ompi/mpi/fortran/use-mpi-ignore-tkr/pmpi-ignore-tkr-interfaces.h | Removes the problematic MPI_Status_set_elements → PMPI_Status_set_elements macro mapping. |
| ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr.F90 | Includes the generated interfaces twice (second time under profiling macro) to produce both MPI and PMPI interfaces. |
| ompi/mpi/fortran/use-mpi-ignore-tkr/Makefile.am | Adds generation/compilation of api_f90_generated.F90 and links in new helper libs; tightens generator dependencies. |
| ompi/mpi/fortran/use-mpi-ignore-tkr/base/Makefile.am | New subdir to compile generated C wrapper code with non-zeroed CPPFLAGS/AM_CPPFLAGS. |
| ompi/mpi/bindings/ompi_bindings/util.py | Renames/expands generic-interface naming helper used by the generator. |
| ompi/mpi/bindings/ompi_bindings/fortran.py | Updates wrapper naming for f90 vs f08, profiling macro emission, include paths, and f90 generation filtering. |
| ompi/mpi/bindings/ompi_bindings/fortran_type.py | Adjusts handle argument passing for f90-generated bindings (integers vs %MPI_VAL). |
| ompi/Makefile.am | Adds the new ignore-tkr base/ subdir to the build ordering. |
| config/ompi_config_files.m4 | Ensures base/Makefile is configured/generated. |
| .gitignore | Ignores newly generated ignore-tkr base C files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This PR looks good to me modulo the copilot finding above and something I noticed in examining the generated api_f90_generated.F90. Namely the 'x' arguments i think should really be replaced by the proper argument name in the standard to allow for keyword argument asociation. Fixing this would involve updating line 363 in fortran.py, but the comments above that line give me pause. See 86c5eab . i'm not sure that comment is right for use mpi. |
jsquyres
left a comment
There was a problem hiding this comment.
Review Summary
Verdict: COMMENT
Findings (3 validated from 12 raw)
- Agreed (cross-source): 0
- v3-reviewer: 3
- Description accuracy: 0
Filter Pipeline
- Dropped (no quote): 0
- Dropped (hallucination): 0 (path: 0, quote: 0, deleted: 0)
- Suppressed (dedup): 1
- Dropped (below cutoff): 8
v3-reviewer
[Bugs and logic errors | MEDIUM] ompi/mpi/bindings/ompi_bindings/fortran.py:302 — see inline comment
[Architecture and design patterns | MEDIUM] ompi/mpi/fortran/use-mpi-ignore-tkr/Makefile.am:86 — see inline comment
[Bugs and logic errors | MEDIUM] ompi/mpi/fortran/use-mpi-ignore-tkr/Makefile.am:96 — see inline comment
|
Hello! The Git Commit Checker CI bot found a few problems with this PR: 6d2460f: use-mpi: Use standard dummy param names for genera...
Please fix these problems and, if necessary, force-push new commits back up to the PR branch. Thanks! |
|
I've modified the pympi parsing to apply to f90 as well, so now the x parameters in the interfaces are gone. The other review comments should be addressed as well (f08 leaking into the generated header, Makefile deps + nodist removed). |
jsquyres
left a comment
There was a problem hiding this comment.
Review Summary
Verdict: COMMENT
Findings (3 validated from 14 raw)
- Agreed (cross-source): 0
- v3-reviewer: 3
- Description accuracy: 0
Filter Pipeline
- Dropped (no quote): 0
- Dropped (hallucination): 0 (path: 0, quote: 0, deleted: 0)
- Suppressed (dedup): 2
- Dropped (below cutoff): 9
Warnings
- Agents failed: codex-reviewer
- Degraded — codex-reviewer: stalled (no new output within the idle window) — treated as timed out
v3-reviewer
[Cross-file consistency | MEDIUM] ompi/mpi/fortran/use-mpi-ignore-tkr/pmpi-ignore-tkr-interfaces.h:266 — see inline comment
[Edge cases and error handling | MEDIUM] ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr.F90:56 — see inline comment
[Test coverage | MEDIUM] ompi/mpi/fortran/use-mpi-ignore-tkr/Makefile.am:180 — see inline comment
|
Addressed review comments regarding the makefile. As for the testing infra, I'm splitting that up into a separate PR. EDIT: See #14229 |
jsquyres
left a comment
There was a problem hiding this comment.
Review Summary
Verdict: COMMENT
Findings (1 validated from 17 raw)
- Agreed (cross-source): 0
- v3-reviewer: 1
- Description accuracy: 0
Filter Pipeline
- Dropped (no quote): 0
- Dropped (hallucination): 0 (path: 0, quote: 0, deleted: 0)
- Suppressed (dedup): 0
- Dropped (below cutoff): 16
v3-reviewer
[cross-file-consistency | MEDIUM] ompi/mpi/fortran/use-mpi-ignore-tkr/base/Makefile.am:44 — see inline comment
8fb3db2 to
301c3b1
Compare
jsquyres
left a comment
There was a problem hiding this comment.
First off: apologies for the slow turnaround on this one, and thank you for your patience — I know this PR has been through several rounds already, and I appreciate you sticking with it. I'm sorry to come back with yet more build-system feedback; the ignore-TKR + TS plumbing is a genuinely subtle corner of the tree.
The good news: the core fix (removing the stray MPI_Status_set_elements PMPI define) looks correct to me — it was the only overlap between the PMPI define list and the generated prototypes — and the double-include profiling scheme holds together.
I've left three inline comments below: one linking concern and two Automake dependency/distribution concerns.
9d43b2e to
fc8f108
Compare
|
@N00byKing would you mind squashing down to one commit? I'll rereview and merge after that. |
699d1c1 to
fc8f108
Compare
MPI_Status_set_elements was not callable, and many PMPI versions were
missing entirely.
The MPI_{Comm/Session}_attach_buffer_FTS functions were also not
generated.
Signed-off-by: Yussur Mustafa Oraji <yussur.oraji@tu-darmstadt.de>
fc8f108 to
dd8326a
Compare
|
Done |
|
/backport v6.0.x |
|
Thank you @N00byKing! |
There's currently two closely related bugs.
The PMPI define for
MPI_Status_set_elementsis defined inpmpi-ignore-tkr-interfaces.hbut the actual interface is inmpi-ignore-tkr-interfaces-generated.h.Then, in
mpi-ignore-tkr.F90both are included in that order. This leads to the preprocessor overwritingMPI_Status_set_elementswith the PMPI version, and the normal one is omitted entirely.This is fixed by the first commit which just removes the superfluous define.
Then, for the functions in
mpi-ignore-tkr-interfaces-generated.h, no PMPI interface versions are being generated at the moment, since the define in that header is unused.In the second commit, I include that header again in
mpi-ignore-tkr.F90with the define to ensure the PMPI interfaces are in the final output.I'm a bit unsure about the second commit, would be grateful for a deeper look.