This source file includes following definitions.
- mca_btl_uct_frag_alloc
- mca_btl_uct_frag_return
- mca_btl_uct_frag_complete
- mca_btl_uct_frag_alloc_short
- mca_btl_uct_frag_alloc_eager
- mca_btl_uct_frag_alloc_max
1
2
3
4
5
6
7
8
9
10
11
12 #if !defined(MCA_BTL_UCT_FRAG_H)
13 #define MCA_BTL_UCT_FRAG_H
14
15 #include "btl_uct.h"
16
17 static inline mca_btl_uct_base_frag_t *mca_btl_uct_frag_alloc (mca_btl_uct_module_t *uct_btl, opal_free_list_t *fl,
18 mca_btl_base_endpoint_t *endpoint)
19 {
20 mca_btl_uct_base_frag_t *frag = (mca_btl_uct_base_frag_t *) opal_free_list_get (fl);
21 if (OPAL_LIKELY(NULL != frag)) {
22 frag->free_list = fl;
23 frag->endpoint = endpoint;
24 frag->btl = uct_btl;
25 }
26
27 return frag;
28 }
29
30 static inline void mca_btl_uct_frag_return (mca_btl_uct_base_frag_t *frag)
31 {
32 opal_free_list_return (frag->free_list, &frag->base.super);
33 }
34
35 static inline void mca_btl_uct_frag_complete (mca_btl_uct_base_frag_t *frag, int rc) {
36 mca_btl_uct_module_t *uct_btl = frag->btl;
37
38
39 if (frag->base.des_flags & MCA_BTL_DES_SEND_ALWAYS_CALLBACK) {
40 frag->base.des_cbfunc(&uct_btl->super, frag->endpoint, &frag->base, rc);
41 }
42
43 if (OPAL_LIKELY(frag->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP)) {
44 mca_btl_uct_frag_return (frag);
45 }
46 }
47
48 static inline mca_btl_uct_base_frag_t *mca_btl_uct_frag_alloc_short (mca_btl_uct_module_t *uct_btl, mca_btl_base_endpoint_t *endpoint)
49 {
50 return mca_btl_uct_frag_alloc (uct_btl, &uct_btl->short_frags, endpoint);
51 }
52
53 static inline mca_btl_uct_base_frag_t *mca_btl_uct_frag_alloc_eager (mca_btl_uct_module_t *uct_btl, mca_btl_base_endpoint_t *endpoint)
54 {
55 return mca_btl_uct_frag_alloc (uct_btl, &uct_btl->eager_frags, endpoint);
56 }
57
58 static inline mca_btl_uct_base_frag_t *mca_btl_uct_frag_alloc_max (mca_btl_uct_module_t *uct_btl, mca_btl_base_endpoint_t *endpoint)
59 {
60 return mca_btl_uct_frag_alloc (uct_btl, &uct_btl->max_frags, endpoint);
61 }
62
63 #endif