OpenMPI  0.1.1
btl_mx_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_MX_FRAG_H
20 #define MCA_BTL_MX_FRAG_H
21 
22 
23 #include "ompi_config.h"
24 #include "ompi/class/ompi_free_list.h"
25 #include "btl_mx.h"
26 
27 #define MCA_BTL_MX_SEND 0x01
28 #define MCA_BTL_MX_RECV 0x02
29 
30 BEGIN_C_DECLS
31 
32 /**
33  * MX send framxent derived type.
34  */
37  mca_btl_base_segment_t segment[2];
38  struct mca_btl_base_endpoint_t* endpoint;
39  uint8_t type;
40  mx_request_t mx_request;
41  size_t size;
42  ompi_free_list_t* mx_frag_list;
43 };
46 
48 
50 
52 
54 
56 
58 
59 /*
60  * Macros to allocate/return descriptors from module specific
61  * free list(s).
62  */
63 
64 #define MCA_BTL_MX_FRAG_ALLOC_EAGER(btl, frag, rc) \
65 do { \
66  ompi_free_list_item_t *item; \
67  OMPI_FREE_LIST_GET( &mca_btl_mx_component.mx_send_eager_frags, item, rc); \
68  if( OPAL_LIKELY(NULL != item) ) { \
69  frag = (mca_btl_mx_frag_t*) item; \
70  frag->mx_frag_list = &(mca_btl_mx_component.mx_send_eager_frags); \
71  frag->segment[0].seg_addr.pval = (void*)(frag+1); \
72  } \
73 } while(0)
74 
75 #define MCA_BTL_MX_FRAG_ALLOC_USER(btl, frag, rc) \
76 do { \
77  ompi_free_list_item_t *item; \
78  OMPI_FREE_LIST_GET( &mca_btl_mx_component.mx_send_user_frags, item, rc); \
79  if( OPAL_LIKELY(NULL != item) ) { \
80  frag = (mca_btl_mx_frag_t*) item; \
81  frag->mx_frag_list = &(mca_btl_mx_component.mx_send_user_frags); \
82  } \
83 } while(0)
84 
85 #define MCA_BTL_MX_FRAG_RETURN(btl, frag) \
86 do { \
87  OMPI_FREE_LIST_RETURN( frag->mx_frag_list, \
88  (ompi_free_list_item_t*)(frag)); \
89 } while(0)
90 
91 END_C_DECLS
92 
93 #endif
A descriptor that holds the parameters to a send/put/get operation along w/ a callback routine that i...
Definition: btl.h:275
Definition: ompi_free_list.h:39
State of ELAN endpoint connection.
Definition: btl_elan_endpoint.h:33
MX send framxent derived type.
Definition: btl_mx_frag.h:35
Describes a region/segment of memory that is addressable by an BTL.
Definition: btl.h:236
#define OBJ_CLASS_DECLARATION(NAME)
Declaration for class descriptor.
Definition: opal_object.h:236