OpenMPI 0.1.1

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

- File List
- Globals

btl_tcp_frag.h
1 /*
2 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3 * University Research and Technology
4 * Corporation. All rights reserved.
5 * Copyright (c) 2004-2008 The University of Tennessee and The University
6 * of Tennessee Research Foundation. All rights
7 * reserved.
8 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9 * University of Stuttgart. All rights reserved.
10 * Copyright (c) 2004-2005 The Regents of the University of California.
11 * All rights reserved.
12 * $COPYRIGHT$
13 *
14 * Additional copyrights may follow
15 *
16 * $HEADER$
17 */
18
19 #ifndef MCA_BTL_TCP_FRAG_H
20 #define MCA_BTL_TCP_FRAG_H
21
22
23 #define MCA_BTL_TCP_FRAG_ALIGN (8)
24 #include "ompi_config.h"
25
26 #ifdef HAVE_SYS_TYPES_H
27 #include <sys/types.h>
28 #endif
29 #ifdef HAVE_SYS_UIO_H
30 #include <sys/uio.h>
31 #endif
32 #ifdef HAVE_NET_UIO_H
33 #include <net/uio.h>
34 #endif
35
36 #include "btl_tcp.h"
37 #include "btl_tcp_hdr.h"
38
39 BEGIN_C_DECLS
40
41 #define MCA_BTL_TCP_FRAG_IOVEC_NUMBER 4
42
43 /**
44 * TCP fragment derived type.
45 */
46 struct mca_btl_tcp_frag_t {
47 mca_btl_base_descriptor_t base;
48 mca_btl_base_segment_t segments[2];
49 struct mca_btl_base_endpoint_t *endpoint;
50 struct mca_btl_tcp_module_t* btl;
51 mca_btl_tcp_hdr_t hdr;
52 struct iovec iov[MCA_BTL_TCP_FRAG_IOVEC_NUMBER + 1];
53 struct iovec *iov_ptr;
54 size_t iov_cnt;
55 size_t iov_idx;
56 size_t size;
57 int rc;
58 ompi_free_list_t* my_list;
59 };
60 typedef struct mca_btl_tcp_frag_t mca_btl_tcp_frag_t;
61 OBJ_CLASS_DECLARATION(mca_btl_tcp_frag_t);
62
63 typedef struct mca_btl_tcp_frag_t mca_btl_tcp_frag_eager_t;
64
65 OBJ_CLASS_DECLARATION(mca_btl_tcp_frag_eager_t);
66
67 typedef struct mca_btl_tcp_frag_t mca_btl_tcp_frag_max_t;
68
69 OBJ_CLASS_DECLARATION(mca_btl_tcp_frag_max_t);
70
71 typedef struct mca_btl_tcp_frag_t mca_btl_tcp_frag_user_t;
72
73 OBJ_CLASS_DECLARATION(mca_btl_tcp_frag_user_t);
74
75
76 /*
77 * Macros to allocate/return descriptors from module specific
78 * free list(s).
79 */
80
81 #define MCA_BTL_TCP_FRAG_ALLOC_EAGER(frag, rc) \
82 { \
83 ompi_free_list_item_t *item; \
84 OMPI_FREE_LIST_GET(&mca_btl_tcp_component.tcp_frag_eager, item, rc); \
85 frag = (mca_btl_tcp_frag_t*) item; \
86 }
87
88 #define MCA_BTL_TCP_FRAG_ALLOC_MAX(frag, rc) \
89 { \
90 ompi_free_list_item_t *item; \
91 OMPI_FREE_LIST_GET(&mca_btl_tcp_component.tcp_frag_max, item, rc); \
92 frag = (mca_btl_tcp_frag_t*) item; \
93 }
94
95 #define MCA_BTL_TCP_FRAG_ALLOC_USER(frag, rc) \
96 { \
97 ompi_free_list_item_t *item; \
98 OMPI_FREE_LIST_GET(&mca_btl_tcp_component.tcp_frag_user, item, rc); \
99 frag = (mca_btl_tcp_frag_t*) item; \
100 }
101
102 #define MCA_BTL_TCP_FRAG_RETURN(frag) \
103 { \
104 OMPI_FREE_LIST_RETURN(frag->my_list, (ompi_free_list_item_t*)(frag)); \
105 }
106
107 #define MCA_BTL_TCP_FRAG_INIT_DST(frag,ep) \
108 do { \
109 frag->rc = 0; \
110 frag->btl = ep->endpoint_btl; \
111 frag->endpoint = ep; \
112 frag->iov[0].iov_len = sizeof(frag->hdr); \
113 frag->iov[0].iov_base = (IOVBASE_TYPE*)&frag->hdr; \
114 frag->iov_cnt = 1; \
115 frag->iov_idx = 0; \
116 frag->iov_ptr = frag->iov; \
117 frag->base.des_src = NULL; \
118 frag->base.des_src_cnt = 0; \
119 frag->base.des_dst = frag->segments; \
120 frag->base.des_dst_cnt = 1; \
121 } while(0)
122
123
124 bool mca_btl_tcp_frag_send(mca_btl_tcp_frag_t*, int sd);
125 bool mca_btl_tcp_frag_recv(mca_btl_tcp_frag_t*, int sd);
126
127
128 END_C_DECLS
129 #endif
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_tcp_module_t
BTL Module Interface.
Definition: btl_tcp.h:107
btl_tcp.h
ompi_free_list_t
Definition: ompi_free_list.h:39
iovec
Definition: ompi_uio.h:29
mca_btl_base_endpoint_t
State of ELAN endpoint connection.
Definition: btl_elan_endpoint.h:33
mca_btl_tcp_frag_t
TCP fragment derived type.
Definition: btl_tcp_frag.h:46
mca_btl_tcp_hdr_t
Definition: btl_tcp_hdr.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