This source file includes following definitions.
- ompi_osc_pt2pt_request_complete
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 #ifndef OMPI_OSC_PT2PT_REQUEST_H
16 #define OMPI_OSC_PT2PT_REQUEST_H
17
18 #include "osc_pt2pt.h"
19
20 #include "ompi/request/request.h"
21 #include "opal/util/output.h"
22
23 struct ompi_osc_pt2pt_request_t {
24 ompi_request_t super;
25
26 int type;
27 const void *origin_addr;
28 int origin_count;
29 struct ompi_datatype_t *origin_dt;
30 ompi_osc_pt2pt_module_t* module;
31 opal_atomic_int32_t outstanding_requests;
32 bool internal;
33 };
34 typedef struct ompi_osc_pt2pt_request_t ompi_osc_pt2pt_request_t;
35 OBJ_CLASS_DECLARATION(ompi_osc_pt2pt_request_t);
36
37
38
39 #define OMPI_OSC_PT2PT_REQUEST_ALLOC(win, req) \
40 do { \
41 opal_free_list_item_t *item; \
42 do { \
43 item = opal_free_list_get (&mca_osc_pt2pt_component.requests); \
44 if (NULL == item) { \
45 opal_progress(); \
46 } \
47 } while (NULL == item); \
48 req = (ompi_osc_pt2pt_request_t*) item; \
49 OMPI_REQUEST_INIT(&req->super, false); \
50 req->super.req_mpi_object.win = win; \
51 req->super.req_complete = false; \
52 req->super.req_state = OMPI_REQUEST_ACTIVE; \
53 req->module = GET_MODULE(win); \
54 req->internal = false; \
55 } while (0)
56
57 #define OMPI_OSC_PT2PT_REQUEST_RETURN(req) \
58 do { \
59 OMPI_REQUEST_FINI(&(req)->super); \
60 (req)->outstanding_requests = 0; \
61 opal_free_list_return (&mca_osc_pt2pt_component.requests, \
62 (opal_free_list_item_t *) (req)); \
63 } while (0)
64
65 static inline void ompi_osc_pt2pt_request_complete (ompi_osc_pt2pt_request_t *request, int mpi_error)
66 {
67 if (!request->internal) {
68 request->super.req_status.MPI_ERROR = mpi_error;
69
70
71 ompi_request_complete (&request->super, true);
72 } else {
73 OMPI_OSC_PT2PT_REQUEST_RETURN (request);
74 }
75 }
76
77 #endif