OpenMPI 0.1.1

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

- File List
- Globals

btl_portals_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-2006 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 OMPI_BTL_PORTALS_FRAG_H
20 #define OMPI_BTL_PORTALS_FRAG_H
21
22 BEGIN_C_DECLS
23
24 /**
25 * Portals send fragment derived type
26 */
27 struct mca_btl_portals_frag_t {
28 mca_btl_base_descriptor_t base;
29 mca_btl_base_segment_t segments[1];
30 /* needed for retransmit case */
31 struct mca_btl_base_endpoint_t *endpoint;
32 /* needed for retransmit case */
33 mca_btl_base_header_t hdr;
34 /* handle to use for communication */
35 ptl_handle_md_t md_h;
36 /* size of the allocated memory region -- not the amount of data
37 we need to send */
38 size_t size;
39
40 enum { BTL_PORTALS_FRAG_TYPE_EAGER,
41 BTL_PORTALS_FRAG_TYPE_MAX,
42 BTL_PORTALS_FRAG_TYPE_USER } type;
43 unsigned char data[16];
44 };
45 typedef struct mca_btl_portals_frag_t mca_btl_portals_frag_t;
46 OBJ_CLASS_DECLARATION(mca_btl_portals_frag_t);
47
48 typedef struct mca_btl_portals_frag_t mca_btl_portals_frag_eager_t;
49 OBJ_CLASS_DECLARATION(mca_btl_portals_frag_eager_t);
50
51 typedef struct mca_btl_portals_frag_t mca_btl_portals_frag_max_t;
52 OBJ_CLASS_DECLARATION(mca_btl_portals_frag_max_t);
53
54 typedef struct mca_btl_portals_frag_t mca_btl_portals_frag_user_t;
55 OBJ_CLASS_DECLARATION(mca_btl_portals_frag_user_t);
56
57 typedef struct mca_btl_portals_frag_t mca_btl_portals_frag_recv_t;
58 OBJ_CLASS_DECLARATION(mca_btl_portals_frag_recv_t);
59
60 /*
61 * Macros to allocate/return descriptors from module specific
62 * free list(s).
63 */
64 #define OMPI_BTL_PORTALS_FRAG_ALLOC_EAGER(btl_macro, frag, rc) \
65 { \
66 \
67 ompi_free_list_item_t *item; \
68 OMPI_FREE_LIST_GET(&((mca_btl_portals_module_t*)btl_macro)->portals_frag_eager, item, rc); \
69 frag = (mca_btl_portals_frag_t*) item; \
70 if (OPAL_SOS_GET_ERROR_CODE(rc) == OMPI_ERR_TEMP_OUT_OF_RESOURCE) { \
71 OMPI_BTL_PORTALS_FRAG_ALLOC_MAX(btl_macro, frag, rc); \
72 } \
73 }
74
75
76 #define OMPI_BTL_PORTALS_FRAG_RETURN_EAGER(btl_macro, frag) \
77 { \
78 assert(BTL_PORTALS_FRAG_TYPE_EAGER == frag->type); \
79 OMPI_FREE_LIST_RETURN(&((mca_btl_portals_module_t*)btl_macro)->portals_frag_eager, \
80 (ompi_free_list_item_t*)(frag)); \
81 }
82
83
84 #define OMPI_BTL_PORTALS_FRAG_ALLOC_MAX(btl_macro, frag, rc) \
85 { \
86 \
87 ompi_free_list_item_t *item_macro; \
88 OMPI_FREE_LIST_GET(&((mca_btl_portals_module_t*)btl_macro)->portals_frag_max, item_macro, rc); \
89 frag = (mca_btl_portals_frag_t*) item_macro; \
90 }
91
92
93 #define OMPI_BTL_PORTALS_FRAG_RETURN_MAX(btl_macro, frag) \
94 { \
95 assert(BTL_PORTALS_FRAG_TYPE_MAX == frag->type); \
96 OMPI_FREE_LIST_RETURN(&((mca_btl_portals_module_t*)btl_macro)->portals_frag_max, \
97 (ompi_free_list_item_t*)(frag)); \
98 }
99
100
101 #define OMPI_BTL_PORTALS_FRAG_ALLOC_USER(btl_macro, frag, rc) \
102 { \
103 ompi_free_list_item_t *item; \
104 OMPI_FREE_LIST_WAIT(&((mca_btl_portals_module_t*)btl_macro)->portals_frag_user, item, rc); \
105 frag = (mca_btl_portals_frag_t*) item; \
106 }
107
108
109 #define OMPI_BTL_PORTALS_FRAG_RETURN_USER(btl_macro, frag) \
110 { \
111 assert(BTL_PORTALS_FRAG_TYPE_USER == frag->type); \
112 OMPI_FREE_LIST_RETURN(&((mca_btl_portals_module_t*)btl_macro)->portals_frag_user, \
113 (ompi_free_list_item_t*)(frag)); \
114 }
115
116
117 END_C_DECLS
118 #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_base_header_t
Definition: btl.h:321
mca_btl_portals_frag_t
Portals send fragment derived type.
Definition: btl_portals_frag.h:27
mca_btl_base_endpoint_t
State of ELAN endpoint connection.
Definition: btl_elan_endpoint.h:33
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