OpenMPI  0.1.1
rml_oob.h
1 /*
2  * Copyright (c) 2004-2010 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 (c) 2007 Cisco Systems, Inc. All rights reserved.
13  * $COPYRIGHT$
14  *
15  * Additional copyrights may follow
16  *
17  * $HEADER$
18  */
19 
20 #ifndef MCA_RML_OOB_RML_OOB_H
21 #define MCA_RML_OOB_RML_OOB_H
22 
23 #include "orte_config.h"
24 #include "opal/threads/condition.h"
25 #include "opal/threads/mutex.h"
26 #include "opal/mca/event/event.h"
27 #include "orte/mca/rml/rml.h"
28 #include "orte/mca/oob/oob.h"
29 #include "opal/dss/dss_types.h"
30 
31 BEGIN_C_DECLS
32 
34  struct orte_rml_module_t super;
35  mca_oob_t *active_oob;
36  opal_list_t exceptions;
37  opal_mutex_t exceptions_lock;
38  opal_list_t queued_routing_messages;
39  opal_mutex_t queued_lock;
40  opal_event_t *timer_event;
41  struct timeval timeout;
42 };
44 
45 ORTE_MODULE_DECLSPEC extern orte_rml_component_t mca_rml_oob_component;
46 extern orte_rml_oob_module_t orte_rml_oob_module;
47 
48 
49 typedef enum {
50  ORTE_RML_BLOCKING_SEND,
51  ORTE_RML_NONBLOCKING_IOV_SEND,
52  ORTE_RML_NONBLOCKING_BUFFER_SEND,
53  ORTE_RML_BLOCKING_RECV,
54  ORTE_RML_NONBLOCKING_IOV_RECV,
55  ORTE_RML_NONBLOCKING_BUFFER_RECV
56 } orte_rml_oob_msg_type_t;
57 
59  orte_process_name_t origin;
60  orte_process_name_t destination;
61  int tag;
62 };
64 
65 #define ORTE_RML_OOB_MSG_HEADER_HTON(hdr) \
66  do { \
67  ORTE_PROCESS_NAME_HTON((hdr).origin); \
68  ORTE_PROCESS_NAME_HTON((hdr).destination); \
69  (hdr).tag = htonl((hdr).tag); \
70  } while (0)
71 
72 
73 #define ORTE_RML_OOB_MSG_HEADER_NTOH(hdr) \
74  do { \
75  ORTE_PROCESS_NAME_NTOH((hdr).origin); \
76  ORTE_PROCESS_NAME_NTOH((hdr).destination); \
77  (hdr).tag = ntohl((hdr).tag); \
78  } while (0)
79 
80 
82  opal_object_t super;
83 
84  opal_mutex_t msg_lock;
85  opal_condition_t msg_cond;
86 
87  orte_rml_oob_msg_type_t msg_type;
88  int msg_status;
89  volatile bool msg_complete;
90  bool msg_persistent;
91 
92  union {
95  } msg_cbfunc;
96  void *msg_cbdata;
97 
98  struct iovec *msg_data;
99 
100  /** buffer for non-blocking buffer sends */
102  /** pointer to user buffer for buffered sends */
104 
105  orte_rml_oob_msg_header_t msg_header;
106 };
109 
111  opal_list_item_t super;
112  struct iovec payload[1];
113 };
116 
117 int orte_rml_oob_init(void);
118 int orte_rml_oob_fini(void);
119 int orte_rml_oob_ft_event(int state);
120 
121 int orte_rml_oob_send(orte_process_name_t* peer,
122  struct iovec *msg,
123  int count,
124  int tag,
125  int flags);
126 int orte_rml_oob_send_nb(orte_process_name_t* peer,
127  struct iovec* msg,
128  int count,
129  orte_rml_tag_t tag,
130  int flags,
131  orte_rml_callback_fn_t cbfunc,
132  void* cbdata);
133 int orte_rml_oob_send_buffer(orte_process_name_t* peer,
134  opal_buffer_t* buffer,
135  orte_rml_tag_t tag,
136  int flags);
137 
138 int orte_rml_oob_send_buffer_nb(orte_process_name_t* peer,
139  opal_buffer_t* buffer,
140  orte_rml_tag_t tag,
141  int flags,
143  void* cbdata);
144 
145 int orte_rml_oob_recv(orte_process_name_t* peer,
146  struct iovec *msg,
147  int count,
148  orte_rml_tag_t tag,
149  int flags);
150 int orte_rml_oob_recv_nb(orte_process_name_t* peer,
151  struct iovec* msg,
152  int count,
153  orte_rml_tag_t tag,
154  int flags,
155  orte_rml_callback_fn_t cbfunc,
156  void* cbdata);
157 int orte_rml_oob_recv_buffer(orte_process_name_t* peer,
158  opal_buffer_t *buf,
159  orte_rml_tag_t tag,
160  int flags);
161 int orte_rml_oob_recv_buffer_nb(orte_process_name_t* peer,
162  orte_rml_tag_t tag,
163  int flags,
165  void* cbdata);
166 int orte_rml_oob_recv_cancel(orte_process_name_t* peer,
167  orte_rml_tag_t tag);
168 
169 int orte_rml_oob_ping(const char* uri,
170  const struct timeval* tv);
171 
172 char* orte_rml_oob_get_uri(void);
173 int orte_rml_oob_set_uri(const char*);
174 
175 int orte_rml_oob_add_exception(orte_rml_exception_callback_t cbfunc);
176 int orte_rml_oob_del_exception(orte_rml_exception_callback_t cbfunc);
177 void orte_rml_oob_exception_callback(const orte_process_name_t *peer,
178  orte_rml_exception_t exception);
179 
180 
181 int orte_rml_oob_purge(orte_process_name_t *peer);
182 
183 END_C_DECLS
184 
185 #endif
RML module interface.
Definition: rml.h:577
RML component interface.
Definition: rml.h:89
Definition: rml_oob.h:58
Contains the internal functions and typedefs for the use of the oob.
Definition: condition.h:49
Definition: types.h:146
Structure to represent a single event.
Definition: event_struct.h:87
Definition: rml_oob.h:110
Definition: rml_oob.h:81
Definition: mutex_unix.h:53
Definition: opal_list.h:98
void(* orte_rml_callback_fn_t)(int status, struct orte_process_name_t *peer, struct iovec *msg, int count, orte_rml_tag_t tag, void *cbdata)
Funtion prototype for callback from non-blocking iovec send and receive.
Definition: rml.h:123
opal_buffer_t msg_recv_buffer
buffer for non-blocking buffer sends
Definition: rml_oob.h:101
Definition: rml_oob.h:33
Runtime Messaging Layer (RML) Communication Interface.
Definition: ompi_uio.h:29
Buffer management types.
Base object.
Definition: opal_object.h:182
uint32_t orte_rml_tag_t
Message matching tag.
Definition: rml_types.h:220
Definition: opal_list.h:147
OOB Module.
Definition: oob.h:161
void(* orte_rml_buffer_callback_fn_t)(int status, struct orte_process_name_t *peer, struct opal_buffer_t *buffer, orte_rml_tag_t tag, void *cbdata)
Funtion prototype for callback from non-blocking buffer send and receive.
Definition: rml.h:149
Structure for holding a buffer to be used with the RML or OOB subsystems.
Definition: dss_types.h:159
opal_buffer_t * user_buffer
pointer to user buffer for buffered sends
Definition: rml_oob.h:103
Mutual exclusion functions.
void(* orte_rml_exception_callback_t)(const orte_process_name_t *peer, orte_rml_exception_t exception)
Function prototype for exception callback.
Definition: rml.h:167
#define OBJ_CLASS_DECLARATION(NAME)
Declaration for class descriptor.
Definition: opal_object.h:236