MPIX_QUERY_ROCM_SUPPORT(3)
π MPIX_QUERY_ROCM_SUPPORT π
okay so bestie, this is an Open MPI man page (from the Open MPI manual, section 3) and it's about MPIX_Query_rocm_support β a little function that tells you "yes queen" (1) if there's AMD ROCm-aware support, or "nope" (0) if there isn't. That's literally the whole vibe check. π«Ά
β¨ SYNTAX β¨
π C Syntax
#include <mpi.h>
#include <mpi-ext.h>
int MPIX_Query_rocm_support(void)
π¦ Fortran Syntax
sooo there is literally no Fortran binding for this function. none. zero. nada. π
πΈ C++ Syntax
same energy β there is no C++ binding for this function either. π
π DESCRIPTION π
okay so first things first: this function is part of an Open MPI extension, which means it is not part of standard MPI. it's giving "special bonus feature" energy, not "everybody has this" energy. π
This routine returns 1 if both of these things are true:
- the MPI library was built with the AMD ROCm library, and
- the runtime supports ROCm buffers.
Otherwise? It returns 0. that's it, that's the whole deal. π
β οΈ important bestie: this routine must be called after MPI is initialized, like by a call toMPI_Init(3)orMPI_Init_thread(3). don't be out here calling it before MPI wakes up, okay? π
Including the Open MPI-specific file <mpi-ext.h> will define the C preprocessor macro OMPI_HAVE_MPI_EXT to 1. Otherwise, it will be undefined. so this macro is literally the sentinel that tells your app whether <mpi-ext.h> has been included or not. iykyk. π₯
Now here's the tea β: the Open MPI ROCm extension is built by default (regardless of whether or not Open MPI was built with ROCm support), but it could have been disabled by an administrative action. so it's safest for applications to check that the preprocessor macro OMPI_HAVE_MPI_EXT_ROCM is defined and is set to 1 to know whether the MPIX_Query_rocm_support() function is actually available. π§
And lowkey the best part? Checking for this macro also protects the use of this function when you're compiling the application with older versions of Open MPI, or with other MPI implementations that don't have this function at all. protective queen behavior, honestly. π
π EXAMPLES π
here's the example, copied exactly and slaying:
#include <stdio.h>
#include <mpi.h>
#include <mpi-ext.h> /* Needed for ROCm-aware check */
int main(int argc, char *argv[])
{
MPI_Init(&argc, &argv);
bool happy = false;
#if defined(OMPI_HAVE_MPI_EXT_ROCM) && OMPI_HAVE_MPI_EXT_ROCM
happy = (bool) MPIX_Query_rocm_support();
#endif
if (happy) {
printf("This Open MPI installation has ROCm-aware support.\n");
} else {
printf("This Open MPI installation does not have ROCm-aware support.\n");
}
MPI_Finalize();
return 0;
}
see how she checks OMPI_HAVE_MPI_EXT_ROCM before even touching the function? that's the main character energy we're talking about. β
π SEE ALSO π
MPIX_Query_cuda_supportβ the CUDA sibling, go say hi π
π COPYRIGHT π
2003-2026, The Open MPI Community β iconic, periodt. π«Ά
and that's the whole page bestie! π β¨ this edition dropped May 14, 2026, so you know it's fresh β mwah, go check your ROCm support and text me later. πΈπ¦π
π¦ where this page comes from
- arch rolling: nvhpc-comm-libs 26.9-1 Β· LicenseRef-NVIDIA-HPC-SDK
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms