File: MPIX_Query_cuda_support.3

package info (click to toggle)
openmpi 5.0.8-4
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 201,684 kB
  • sloc: ansic: 613,078; makefile: 42,353; sh: 11,194; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,179; python: 1,859; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (124 lines) | stat: -rw-r--r-- 3,230 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
.\" Man page generated from reStructuredText.
.
.TH "MPIX_QUERY_CUDA_SUPPORT" "3" "May 30, 2025" "" "Open MPI"
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.sp
\fBMPIX_Query_cuda_support\fP \- Returns 1 if there is CUDA\-aware support
and 0 if there is not.
.SH SYNTAX
.SS C Syntax
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
#include <mpi.h>
#include <mpi\-ext.h>

int MPIX_Query_cuda_support(void)
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Fortran Syntax
.sp
There is no Fortran binding for this function.
.SS C++ Syntax
.sp
There is no C++ binding for this function.
.SH DESCRIPTION
.sp
This function is part of an \fI\%Open MPI extension\fP; it is not part of standard MPI.
.sp
This routine returns 1 if both the MPI library was built with the
NVIDIA CUDA library and the runtime supports CUDA buffers.  Otherwise,
it returns 0.  This routine must be called after MPI is initialized,
e.g., by a call to \fI\%MPI_Init(3)\fP or
\fI\%MPI_Init_thread(3)\fP\&.
.sp
Including the Open MPI\-specific file \fB<mpi\-ext.h>\fP will define the C
preprocessor macro \fBOMPI_HAVE_MPI_EXT\fP to \fB1\fP\&.  Otherwise, it will
be undefined.  This macro can be used by applications as a sentinel to
know whether \fB<mpi\-ext.h>\fP has been included or not.
.sp
The Open MPI CUDA extension is built by default (regardless of whether
or not Open MPI was built with CUDA support), but \fIcould\fP have been
disabled by an administrative action.  It is therefore safest for
applications to check that the preprocessor macro
\fBOMPI_HAVE_MPI_EXT_CUDA\fP is defined and is set to 1 to know whether
the \fBMPIX_Query_CUDA_support()\fP 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.
.SS EXAMPLES
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
#include <stdio.h>
#include <mpi.h>
#include <mpi\-ext.h> /* Needed for CUDA\-aware check */

int main(int argc, char *argv[])
{
    MPI_Init(&argc, &argv);

    bool happy = false;
#if defined(OMPI_HAVE_MPI_EXT_CUDA) && OMPI_HAVE_MPI_EXT_CUDA
    happy = (bool) MPIX_Query_cuda_support();
#endif

    if (happy) {
        printf("This Open MPI installation has CUDA\-aware support.\en");
    } else {
        printf("This Open MPI installation does not have CUDA\-aware support.\en");
    }

    MPI_Finalize();
    return 0;
}
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
\fI\%MPIX_Query_rocm_support\fP
.UNINDENT
.UNINDENT
.UNINDENT
.SH COPYRIGHT
2003-2025, The Open MPI Community
.\" Generated by docutils manpage writer.
.