1
2
3
4
5
6
7
8
9
10 #ifndef PML_YALLA_H_
11 #define PML_YALLA_H_
12
13 #include "pml_yalla_freelist.h"
14
15 #include "ompi_config.h"
16 #include "ompi/request/request.h"
17 #include "ompi/mca/pml/pml.h"
18 #include "ompi/mca/pml/base/base.h"
19 #include "ompi/datatype/ompi_datatype.h"
20 #include "ompi/communicator/communicator.h"
21 #include "ompi/request/request.h"
22
23 #include <mxm/api/mxm_api.h>
24
25 typedef struct mca_pml_yalla_module mca_pml_yalla_module_t;
26 typedef struct pml_yalla_base_request mca_pml_yalla_base_request_t;
27 typedef struct pml_yalla_send_request mca_pml_yalla_send_request_t;
28 typedef struct pml_yalla_bsend_request mca_pml_yalla_bsend_request_t;
29 typedef struct pml_yalla_recv_request mca_pml_yalla_recv_request_t;
30 typedef struct pml_yalla_convertor mca_pml_yalla_convertor_t;
31
32 #if MXM_API < MXM_VERSION(2,0)
33 # error "MXM 2.0 or above is required"
34 #endif
35
36 struct mca_pml_yalla_module {
37 mca_pml_base_module_t super;
38
39
40 mxm_context_opts_t *ctx_opts;
41 mxm_ep_opts_t *ep_opts;
42 mxm_h mxm_context;
43 mxm_ep_h mxm_ep;
44
45
46 mca_pml_yalla_freelist_t send_reqs;
47 mca_pml_yalla_freelist_t bsend_reqs;
48 mca_pml_yalla_freelist_t recv_reqs;
49
50
51 mca_pml_yalla_freelist_t convs;
52
53 int using_mem_hooks;
54 int priority;
55 int verbose;
56 int output;
57 };
58
59 extern mca_pml_base_component_2_0_0_t mca_pml_yalla_component;
60 extern mca_pml_yalla_module_t ompi_pml_yalla;
61
62
63
64 #define PML_YALLA_ENABLE_DEBUG OPAL_ENABLE_DEBUG
65 #if PML_YALLA_ENABLE_DEBUG
66 # define PML_YALLA_MAX_VERBOSE 9
67 # define PML_YALLA_ASSERT(_x) assert(_x)
68 #else
69 # define PML_YALLA_MAX_VERBOSE 2
70 # define PML_YALLA_ASSERT(_x)
71 #endif
72
73
74 #define PML_YALLA_ERROR(format, ... ) \
75 opal_output_verbose(0, ompi_pml_yalla.output, "Error: %s:%d - %s() " format, \
76 __FILE__, __LINE__, __FUNCTION__, ## __VA_ARGS__)
77
78 #define PML_YALLA_VERBOSE(_level, format, ... ) \
79 if (((_level) <= PML_YALLA_MAX_VERBOSE) && ((_level) <= ompi_pml_yalla.verbose)) { \
80 opal_output_verbose(_level, ompi_pml_yalla.output, "%s:%d - %s() " format, \
81 __FILE__, __LINE__, __FUNCTION__, ## __VA_ARGS__); \
82 }
83
84 int mca_pml_yalla_open(void);
85 int mca_pml_yalla_close(void);
86 int mca_pml_yalla_init(void);
87 int mca_pml_yalla_cleanup(void);
88
89 int mca_pml_yalla_add_procs(struct ompi_proc_t **procs, size_t nprocs);
90 int mca_pml_yalla_del_procs(struct ompi_proc_t **procs, size_t nprocs);
91
92 int mca_pml_yalla_enable(bool enable);
93 int mca_pml_yalla_progress(void);
94
95 int mca_pml_yalla_add_comm(struct ompi_communicator_t* comm);
96 int mca_pml_yalla_del_comm(struct ompi_communicator_t* comm);
97
98 int mca_pml_yalla_irecv_init(void *buf, size_t count, ompi_datatype_t *datatype,
99 int src, int tag, struct ompi_communicator_t* comm,
100 struct ompi_request_t **request);
101
102 int mca_pml_yalla_irecv(void *buf, size_t count, ompi_datatype_t *datatype,
103 int src, int tag, struct ompi_communicator_t* comm,
104 struct ompi_request_t **request);
105
106 int mca_pml_yalla_recv(void *buf, size_t count, ompi_datatype_t *datatype, int src,
107 int tag, struct ompi_communicator_t* comm,
108 ompi_status_public_t* status);
109
110 int mca_pml_yalla_isend_init(const void *buf, size_t count, ompi_datatype_t *datatype,
111 int dst, int tag, mca_pml_base_send_mode_t mode,
112 struct ompi_communicator_t* comm,
113 struct ompi_request_t **request);
114
115 int mca_pml_yalla_isend(const void *buf, size_t count, ompi_datatype_t *datatype,
116 int dst, int tag, mca_pml_base_send_mode_t mode,
117 struct ompi_communicator_t* comm,
118 struct ompi_request_t **request);
119
120 int mca_pml_yalla_send(const void *buf, size_t count, ompi_datatype_t *datatype, int dst,
121 int tag, mca_pml_base_send_mode_t mode,
122 struct ompi_communicator_t* comm);
123
124 int mca_pml_yalla_iprobe(int src, int tag, struct ompi_communicator_t* comm,
125 int *matched, ompi_status_public_t* status);
126
127 int mca_pml_yalla_probe(int src, int tag, struct ompi_communicator_t* comm,
128 ompi_status_public_t* status);
129
130 int mca_pml_yalla_improbe(int src, int tag, struct ompi_communicator_t* comm,
131 int *matched, struct ompi_message_t **message,
132 ompi_status_public_t* status);
133
134 int mca_pml_yalla_mprobe(int src, int tag, struct ompi_communicator_t* comm,
135 struct ompi_message_t **message,
136 ompi_status_public_t* status);
137
138 int mca_pml_yalla_imrecv(void *buf, size_t count, ompi_datatype_t *datatype,
139 struct ompi_message_t **message,
140 struct ompi_request_t **request);
141
142 int mca_pml_yalla_mrecv(void *buf, size_t count, ompi_datatype_t *datatype,
143 struct ompi_message_t **message,
144 ompi_status_public_t* status);
145
146 int mca_pml_yalla_start(size_t count, ompi_request_t** requests);
147
148 int mca_pml_yalla_dump(struct ompi_communicator_t* comm, int verbose);
149
150 #endif