OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

btl_ugni_frag.h
1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
2 /*
3 * Copyright (c) 2011-2012 Los Alamos National Security, LLC. All rights
4 * reserved.
5 * Copyright (c) 2011 UT-Battelle, LLC. All rights reserved.
6 * $COPYRIGHT$
7 *
8 * Additional copyrights may follow
9 *
10 * $HEADER$
11 */
12
13 #if !defined(MCA_BTL_UGNI_FRAG_H)
14 #define MCA_BTL_UGNI_FRAG_H
15
16 #include "btl_ugni.h"
17 #include "btl_ugni_endpoint.h"
18
19 typedef struct mca_btl_ugni_send_frag_hdr_t {
20 size_t len;
21 mca_btl_base_tag_t tag;
22 } mca_btl_ugni_send_frag_hdr_t;
23
24 typedef struct mca_btl_ugni_rdma_frag_hdr_t {
25 mca_btl_base_segment_t src_seg;
26 mca_btl_base_segment_t dst_seg;
27 void *ctx;
28 } mca_btl_ugni_rdma_frag_hdr_t;
29
30 typedef struct mca_btl_ugni_eager_frag_hdr_t {
31 size_t len;
32 mca_btl_base_tag_t tag;
33 mca_btl_base_segment_t src_seg;
34 void *ctx;
35 } mca_btl_ugni_eager_frag_hdr_t;
36
37 typedef union mca_btl_ugni_frag_hdr_t {
38 mca_btl_ugni_send_frag_hdr_t send;
39 mca_btl_ugni_rdma_frag_hdr_t rdma;
40 mca_btl_ugni_eager_frag_hdr_t eager;
41 } mca_btl_ugni_frag_hdr_t;
42
43 typedef struct mca_btl_ugni_base_frag_t {
44 mca_btl_base_descriptor_t base;
45 mca_btl_base_segment_t segments[2];
46 mca_btl_ugni_frag_hdr_t hdr;
47 ompi_common_ugni_post_desc_t post_desc;
48 mca_btl_base_endpoint_t *endpoint;
49 mca_btl_ugni_reg_t *registration;
50 ompi_free_list_t *my_list;
51 uint32_t msg_id;
52 } mca_btl_ugni_base_frag_t;
53
54 typedef struct mca_btl_ugni_base_frag_t mca_btl_ugni_smsg_frag_t;
55 typedef struct mca_btl_ugni_base_frag_t mca_btl_ugni_rdma_frag_t;
56 typedef struct mca_btl_ugni_base_frag_t mca_btl_ugni_eager_frag_t;
57
58 #define MCA_BTL_UGNI_DESC_TO_FRAG(desc) \
59 ((mca_btl_ugni_base_frag_t *)((uintptr_t) (desc) - offsetof (mca_btl_ugni_base_frag_t, post_desc)))
60
61 OBJ_CLASS_DECLARATION(mca_btl_ugni_smsg_frag_t);
62 OBJ_CLASS_DECLARATION(mca_btl_ugni_rdma_frag_t);
63 OBJ_CLASS_DECLARATION(mca_btl_ugni_eager_frag_t);
64
65 void mca_btl_ugni_frag_init (mca_btl_ugni_base_frag_t *frag, mca_btl_ugni_module_t *ugni_module);
66
67 static inline int mca_btl_ugni_frag_alloc (mca_btl_base_endpoint_t *ep,
68 ompi_free_list_t *list,
69 mca_btl_ugni_base_frag_t **frag)
70 {
71 ompi_free_list_item_t *item = NULL;
72 int rc;
73
74 OMPI_FREE_LIST_GET(list, item, rc);
75 *frag = (mca_btl_ugni_base_frag_t *) item;
76 if (OPAL_LIKELY(NULL != item)) {
77 (*frag)->my_list = list;
78 (*frag)->endpoint = ep;
79 }
80
81 return rc;
82 }
83
84 static inline void mca_btl_ugni_frag_return (mca_btl_ugni_base_frag_t *frag)
85 {
86 if (frag->registration) {
87 frag->endpoint->btl->super.btl_mpool->mpool_deregister(frag->endpoint->btl->super.btl_mpool,
88 &frag->registration->base);
89 frag->registration = NULL;
90 }
91
92 OMPI_FREE_LIST_RETURN(frag->my_list, (ompi_free_list_item_t *) frag);
93 }
94
95 #define MCA_BTL_UGNI_FRAG_ALLOC_SMSG(ep, frag) \
96 mca_btl_ugni_frag_alloc((ep), &(ep)->btl->smsg_frags, &(frag))
97 #define MCA_BTL_UGNI_FRAG_ALLOC_RDMA(ep, frag) \
98 mca_btl_ugni_frag_alloc((ep), &(ep)->btl->rdma_frags, &(frag))
99 #define MCA_BTL_UGNI_FRAG_ALLOC_RDMA_INT(ep, frag) \
100 mca_btl_ugni_frag_alloc((ep), &(ep)->btl->rdma_int_frags, &(frag))
101 #define MCA_BTL_UGNI_FRAG_ALLOC_EAGER_SEND(ep, frag) \
102 mca_btl_ugni_frag_alloc((ep), &(ep)->btl->eager_frags_send, &(frag))
103 #define MCA_BTL_UGNI_FRAG_ALLOC_EAGER_RECV(ep, frag) \
104 mca_btl_ugni_frag_alloc((ep), &(ep)->btl->eager_frags_recv, &(frag))
105
106 #endif /* MCA_BTL_UGNI_FRAG_H */
mca_btl_base_descriptor_t
A descriptor that holds the parameters to a send/put/get operation along w/ a callback routine that i...
Definition: btl.h:275
mca_btl_ugni_base_frag_t
Definition: btl_ugni_frag.h:43
mca_btl_ugni_module_t
Definition: btl_ugni.h:51
mca_btl_ugni_rdma_frag_hdr_t
Definition: btl_ugni_frag.h:24
ompi_free_list_t
Definition: ompi_free_list.h:39
mca_mpool_base_module_t::mpool_deregister
mca_mpool_base_module_deregister_fn_t mpool_deregister
deregister memory
Definition: mpool.h:181
mca_btl_ugni_send_frag_hdr_t
Definition: btl_ugni_frag.h:19
mca_btl_base_endpoint_t
State of ELAN endpoint connection.
Definition: btl_elan_endpoint.h:33
ompi_free_list_item_t
Definition: ompi_free_list.h:62
mca_btl_ugni_eager_frag_hdr_t
Definition: btl_ugni_frag.h:30
mca_btl_base_module_t::btl_mpool
mca_mpool_base_module_t * btl_mpool
the mpool associated with this btl (optional)
Definition: btl.h:818
mca_btl_ugni_reg_t
Definition: btl_ugni.h:241
ompi_common_ugni_post_desc_t
Definition: common_ugni.h:81
mca_btl_ugni_frag_hdr_t
Definition: btl_ugni_frag.h:37
mca_btl_base_segment_t
Describes a region/segment of memory that is addressable by an BTL.
Definition: btl.h:236
OBJ_CLASS_DECLARATION
#define OBJ_CLASS_DECLARATION(NAME)
Declaration for class descriptor.
Definition: opal_object.h:236