This source file includes following definitions.
- get_nsec
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 #ifndef OPAL_BTL_USNIC_H
28 #define OPAL_BTL_USNIC_H
29
30 #include "opal_config.h"
31 #include <sys/types.h>
32
33 #include "opal_stdint.h"
34 #include "opal/util/alfg.h"
35 #include "opal/class/opal_hash_table.h"
36 #include "opal/class/opal_hash_table.h"
37 #include "opal/mca/event/event.h"
38
39 #include "opal/mca/btl/btl.h"
40 #include "opal/mca/btl/base/btl_base_error.h"
41 #include "opal/mca/btl/base/base.h"
42 #include "opal/mca/rcache/rcache.h"
43
44 #include "btl_usnic_compat.h"
45
46 BEGIN_C_DECLS
47
48
49
50
51
52
53
54 extern uint64_t opal_btl_usnic_ticks;
55
56
57 extern opal_recursive_mutex_t btl_usnic_lock;
58
59 static inline uint64_t
60 get_nsec(void)
61 {
62 return opal_btl_usnic_ticks;
63 }
64
65
66 extern opal_rng_buff_t opal_btl_usnic_rand_buff;
67
68 #ifndef container_of
69 #define container_of(ptr, type, member) ( \
70 (type *)( ((char *)(ptr)) - offsetof(type,member) ))
71 #endif
72
73 #ifndef max
74 #define max(a, b) (((a) > (b)) ? (a) : (b))
75 #endif
76
77
78 #define MSGDEBUG2 (MSGDEBUG1||0)
79
80 #define MSGDEBUG1 0
81
82
83 #if MSGDEBUG1
84 #define MSGDEBUG1_OUT(...) opal_output(0, __VA_ARGS__)
85 #else
86 #define MSGDEBUG1_OUT(...) do {} while (0)
87 #endif
88 #if MSGDEBUG2
89 #define MSGDEBUG2_OUT(...) opal_output(0, __VA_ARGS__)
90 #else
91 #define MSGDEBUG2_OUT(...) do {} while (0)
92 #endif
93
94
95
96 #define WANT_RECV_DROPS 0
97
98
99 #define WANT_FAIL_TO_SEND_ACK 0
100
101
102
103 #define WANT_FAIL_TO_RESEND_FRAG 0
104
105 #if WANT_RECV_DROPS > 0
106 #define FAKE_RECV_DROP (opal_rand(&opal_btl_usnic_rand_buff) < WANT_RECV_DROPS)
107 #else
108 #define FAKE_RECV_DROP 0
109 #endif
110
111 #if WANT_FAIL_TO_SEND_ACK > 0
112 #define FAKE_FAIL_TO_SEND_ACK (opal_rand(&opal_btl_usnic_rand_buff) < WANT_FAIL_TO_SEND_ACK)
113 #else
114 #define FAKE_FAIL_TO_SEND_ACK 0
115 #endif
116
117 #if WANT_FAIL_TO_RESEND_FRAG > 0
118 #define FAKE_FAIL_TO_RESEND_FRAG (opal_rand(&opal_btl_usnic_rand_buff) < WANT_FAIL_TO_RESEND_FRAG)
119 #else
120 #define FAKE_FAIL_TO_RESEND_FRAG 0
121 #endif
122
123
124
125
126
127 typedef struct opal_btl_usnic_component_t {
128
129 mca_btl_base_component_2_0_0_t super;
130
131
132
133
134
135 int max_modules;
136
137 int num_modules;
138
139
140
141 uint64_t my_hashed_rte_name;
142
143
144 struct opal_btl_usnic_module_t* usnic_all_modules;
145
146 struct opal_btl_usnic_module_t** usnic_active_modules;
147
148
149 int pack_lazy_threshold;
150
151
152
153
154 opal_list_t usnic_procs;
155
156
157 char* usnic_mpool_hints;
158
159
160 char *usnic_rcache_name;
161
162 char *if_include;
163 char *if_exclude;
164
165
166 bool stats_enabled;
167 bool stats_relative;
168 int stats_frequency;
169
170
171
172 bool want_numa_device_assignment;
173
174
175 int32_t sd_num;
176
177
178 int32_t rd_num;
179
180
181 int32_t prio_sd_num;
182 int32_t prio_rd_num;
183
184
185 int32_t cq_num;
186
187
188 int32_t av_eq_num;
189
190
191 int retrans_timeout;
192
193
194
195
196
197 int transport_header_len;
198 uint32_t transport_protocol;
199
200
201
202
203 int udp_port_base;
204
205
206
207 bool show_route_failures;
208
209
210
211 bool connectivity_enabled;
212 int connectivity_ack_timeout;
213 int connectivity_num_retries;
214
215
216
217 uint32_t max_short_packets;
218
219
220
221 char *connectivity_map_prefix;
222
223
224
225
226
227 uint32_t prefix_send_offset;
228
229
230 opal_event_base_t *opal_evbase;
231 } opal_btl_usnic_component_t;
232
233 OPAL_MODULE_DECLSPEC extern opal_btl_usnic_component_t mca_btl_usnic_component;
234
235 typedef mca_btl_base_recv_reg_t opal_btl_usnic_recv_reg_t;
236
237
238
239
240
241 typedef uint16_t opal_btl_usnic_seq_t;
242 #define UDSEQ PRIu16
243
244
245
246
247
248 #define SEQ_DIFF(A,B) ((int16_t)((A)-(B)))
249 #define SEQ_LT(A,B) (SEQ_DIFF(A,B) < 0)
250 #define SEQ_LE(A,B) (SEQ_DIFF(A,B) <= 0)
251 #define SEQ_GT(A,B) (SEQ_DIFF(A,B) > 0)
252 #define SEQ_GE(A,B) (SEQ_DIFF(A,B) >= 0)
253
254
255
256
257 int opal_btl_usnic_component_register(void);
258
259
260
261
262 void opal_btl_usnic_component_debug(void);
263
264
265
266
267 void opal_btl_usnic_connectivity_map(void);
268
269 END_C_DECLS
270 #endif