MPIX_GPU_query_support(3)
π MPIX_GPU_query_support(3) π
okay bestie, so this little cutie lives in the MPI family, and her whole job is answering one (1) very important question: does this machine vibe with your GPU or not? She's MPIX_GPU_query_support, and she is the name of the page you're reading rn. π«Ά
β¨ NAME β¨
MPIX_GPU_query_support β returns whether the specific type of GPU is supported π
πΈ SYNOPSIS πΈ
int MPIX_GPU_query_support(int gpu_type, int *is_supported)
like... that's it. two args. she's low maintenance. π
π INPUT PARAMETERS π
gpu_typeβ the GPU flavor you're asking about, as an integer. Your options are literally just these three besties:MPIX_GPU_SUPPORT_CUDAMPIX_GPU_SUPPORT_ZEMPIX_GPU_SUPPORT_HIP
π OUTPUT PARAMETERS π
is_supportedβ logical. It comes back as true if a GPU of the given type is supported, and false otherwise. no maybes, no "it's complicated", just true/false energy. periodt. β¨
π¦ THREAD AND INTERRUPT SAFETY π¦
This routine is thread-safe, okay? That means multiple threads can call her at the same time and you do not need to bring your own user-provided thread locks. She handles herself. π
But β and this is the important part β she is not interrupt safe. π
Typically that's because of memory allocation routines like malloc, or other non-MPICH runtime routines that are themselves not interrupt-safe. so like... threads? yes. interrupts? absolutely not, bestie. π«
π§ NOTES FOR FORTRAN π§
Real talk for the Fortran girlies: every MPI routine in Fortran (except for MPI_WTIME and MPI_WTICK) gets an extra argument called ierr tacked onto the end of the argument list. ierr is an integer and it means the exact same thing as the return value of the routine in C.
Also, in Fortran, MPI routines are subroutines and you invoke them with the call statement.
And all MPI objects (like MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. no cap. π
β ERRORS β
So every MPI routine (except MPI_Wtime and MPI_Wtick) returns an error value β C routines hand it back as the value of the function, and Fortran routines put it in that last argument. Before that value gets returned, the current MPI error handler gets called. And by default? That error handler aborts the MPI job. π yes, the whole thing.
You can change the error handler with:
MPI_Comm_set_errhandler(for communicators)MPI_File_set_errhandler(for files)MPI_Win_set_errhandler(for RMA windows)
There's also the MPI-1 routine MPI_Errhandler_set, which you may use, but heads up: its use is deprecated. π
If you want error values returned instead of the job just dying, you can use the predefined error handler MPI_ERRORS_RETURN. And note that MPI does not guarantee an MPI program can continue past an error β however, MPI implementations will attempt to continue whenever possible.
Here's the error code lineup:
MPI_SUCCESSβ no error; the MPI routine completed successfully. slay. β¨MPI_ERR_ARGβ invalid argument. Some argument is invalid and is not identified by a specific error class (e.g.,MPI_ERR_RANK).MPI_ERR_OTHERβ other error; useMPI_Error_stringto get more information about this error code.
and that's the whole page, bestie. thank you for coming to my ted talk. π«Ά
π bye ily, this was MPIX_GPU_query_support(3) from 4/10/2026 β go ask your GPU some questions π
π¦ where this page comes from
- nixos 26.05: mpich 5.0.1
- ubuntu stonking: mpich-doc 5.0.1-9 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms