Skip to content

Add GPU-support queries (MPIX_Query_*_support, MPIX_GPU_query_support) - #15

Open
casparvl wants to merge 1 commit into
ocaisa:mainfrom
casparvl:gpu-support-queries
Open

casparvl wants to merge 1 commit into
ocaisa:mainfrom
casparvl:gpu-support-queries

Conversation

@casparvl

@casparvl casparvl commented Oct 5, 2026

Copy link
Copy Markdown

What I did: the issue is a one-liner that points at an upstream PR in eschnett/mpi_abi_wrapper. That PR adds the GPU-support queries to that project. I decided traMPI should do the same.

  • The generated mpi_proxy.c now defines MPIX_Query_cuda_support, hip, rocm, ze, MPIX_GPU_query_support(gpu_type, &is_supported), and PMPIX_ versions of each.
  • Each query is looked up in the backend library at load time. If the backend lacks it, the query returns 0 rather than failing.
  • hip and rocm are treated as the same question, and an unknown gpu_type returns MPI_ERR_ARG.
  • With --header-patch, the prototypes and constants are appended to the generated mpi.h.
  • I added a README section and a unit test.

Testing: I generated the proxy, compiled it, and ran it against a fake backend that exports only the CUDA and ROCm queries. The results were correct. pytest isn't installed here, so I ran only the new test, by hand; I didn't run the full suite. I haven't tried it against real MPICH
or Open MPI, or on a GPU.

Doubts:

  • The issue gives no detail, so mirroring upstream is my assumption.
  • The constant values come from the upstream PR description, not from the MPICH or Open MPI headers.
  • Without --header-patch no mpi.h is written, so the prototypes only appear in patched-header builds. The CMake build always uses the patch.

I initialised the git submodules to run the generator. That left the working tree changed, but I didn't commit those changes.

Disclaimer: fully generated by Claude, at the request of @ocaisa

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ocaisa

ocaisa commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Unfortunately, this is not a good fit. It doesn't seem to have paid a lot of attention to #14 (comment) , and is not searching to connect the MPIX_ calls to the right locations for OpenMPI and MPICH.

I'm not sure if they constants declarations are really necessary are they?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants