1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 #ifndef OMPI_GEN_REQUEST_H
23 #define OMPI_GEN_REQUEST_H
24
25 #include "ompi_config.h"
26 #include "ompi/request/request.h"
27
28 BEGIN_C_DECLS
29 OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_grequest_t);
30
31
32
33
34 typedef void (MPI_F_Grequest_query_function)(MPI_Aint *extra_state,
35 MPI_Fint *status,
36 MPI_Fint *ierr);
37
38
39
40 typedef void (MPI_F_Grequest_free_function)(MPI_Aint *extra_state,
41 MPI_Fint *ierr);
42
43
44
45 typedef void (MPI_F_Grequest_cancel_function)(MPI_Aint *extra_state,
46 ompi_fortran_logical_t *complete,
47 MPI_Fint *ierr);
48
49 #if OMPI_ENABLE_GREQUEST_EXTENSIONS
50
51
52
53 typedef int (ompi_grequestx_poll_function)(void *, MPI_Status *);
54
55 typedef void (ompi_f_grequestx_poll_function)(MPI_Aint *extra_state,
56 MPI_Fint *status,
57 MPI_Fint *ierr);
58 #endif
59
60
61
62
63 typedef union {
64 MPI_Grequest_query_function* c_query;
65 MPI_F_Grequest_query_function* f_query;
66 } MPI_Grequest_query_fct_t;
67
68
69
70
71 typedef union {
72 MPI_Grequest_free_function* c_free;
73 MPI_F_Grequest_free_function* f_free;
74 } MPI_Grequest_free_fct_t;
75
76
77
78
79 typedef union {
80 MPI_Grequest_cancel_function* c_cancel;
81 MPI_F_Grequest_cancel_function* f_cancel;
82 } MPI_Grequest_cancel_fct_t;
83
84 #if OMPI_ENABLE_GREQUEST_EXTENSIONS
85
86
87
88 typedef union {
89 ompi_grequestx_poll_function* c_poll;
90 ompi_f_grequestx_poll_function* f_poll;
91 } ompi_grequestx_poll_fct_t;
92 #endif
93
94
95
96
97 struct ompi_grequest_t {
98 ompi_request_t greq_base;
99 MPI_Grequest_query_fct_t greq_query;
100 MPI_Grequest_free_fct_t greq_free;
101 MPI_Grequest_cancel_fct_t greq_cancel;
102 #if OMPI_ENABLE_GREQUEST_EXTENSIONS
103 ompi_grequestx_poll_fct_t greq_poll;
104 #endif
105 void *greq_state;
106 bool greq_funcs_are_c;
107 };
108
109
110
111 typedef struct ompi_grequest_t ompi_grequest_t;
112
113
114
115
116 OMPI_DECLSPEC int ompi_grequest_start(
117 MPI_Grequest_query_function *gquery,
118 MPI_Grequest_free_function *gfree,
119 MPI_Grequest_cancel_function *gcancel,
120 void* gstate,
121 ompi_request_t** request);
122
123
124
125
126 OMPI_DECLSPEC int ompi_grequest_complete(ompi_request_t *req);
127
128
129
130
131 OMPI_DECLSPEC int ompi_grequest_invoke_query(ompi_request_t *request,
132 ompi_status_public_t *status);
133 END_C_DECLS
134
135 #endif