MPIX_QUERY_ROCM_SUPPORT(3)

πŸ“¦
version 5.0.10 Β· 4 versions
, in ubuntu stonking

πŸ’– MPIX_QUERY_ROCM_SUPPORT πŸ’–

okay bestie, welcome to the Open MPI manual page for MPIX_Query_rocm_support 😌 this one's short and sweet fr fr. Here's the vibe:

MPIX_Query_rocm_support β€” returns 1 if there is AMD ROCm-aware support and 0 if there is not. That's it, that's the whole personality. πŸ’…


✨ SYNTAX ✨

🌸 C Syntax

#include <mpi.h>
#include <mpi-ext.h>

int MPIX_Query_rocm_support(void)

πŸ¦‹ Fortran Syntax

There is no Fortran binding for this function. Sorry Fortran girlies, not today 😭

πŸŽ€ C++ Syntax

There is no C++ binding for this function either. Nope nope nope πŸ’€


πŸ‘‘ DESCRIPTION πŸ‘‘

okay so, real talk: this function is part of an Open MPI extension β€” it is not part of standard MPI. So like, don't go waving it around at other MPI implementations expecting them to know her. 🫢

This routine returns 1 if both:

  • the MPI library was built with the AMD ROCm library, and
  • the runtime supports ROCm buffers.

Otherwise, it returns 0. Simple as.

⚠️ Gotta call this one after MPI is initialized, bestie β€” like, via a call to MPI_Init(3) or MPI_Init_thread(3). Calling it before init is giving chaos energy and we do not want that. 🚫

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. This macro can be used by applications as a sentinel to know whether <mpi-ext.h> has been included or not. πŸ”₯

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 the safest move for applications is 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 available. Checking for this macro also protects the use of this function when compiling the application with older versions of Open MPI or other MPI implementations that do not have this function. iykyk πŸ’œ

🌈 EXAMPLES 🌈

here's the moment you've been waiting for, the example, she's iconic:

#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 also:

  • MPIX_Query_cuda_support

2003-2026, The Open MPI Community


and that's the whole page, bestie!! you ate that πŸŽ€βœ¨ this was MPIX_QUERY_ROCM_SUPPORT(3) from the Open MPI crew, dated Sep 10, 2026 β€” go forth and query your ROCm support responsibly, mwah πŸ’–πŸ¦‹πŸ‘‘

πŸ“¦ where this page comes from