OpenMPI  0.1.1
oob.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2004-2007 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 /** @file:
19  *
20  * Contains the internal functions and typedefs for the use of the oob
21  */
22 
23 #ifndef MCA_OOB_H_
24 #define MCA_OOB_H_
25 
26 #include "orte_config.h"
27 #include "orte/types.h"
28 
29 #ifdef HAVE_UNISTD_H
30 #include <unistd.h>
31 #endif
32 
33 #include "opal/mca/mca.h"
34 
35 #include "orte/mca/rml/rml.h"
36 
37 #include "opal/mca/crs/crs.h"
38 #include "opal/mca/crs/base/base.h"
39 
40 
41 BEGIN_C_DECLS
42 
43 
44 struct mca_oob_1_0_0_t;
45 typedef struct mca_oob_1_0_0_t mca_oob_1_0_0_t;
46 typedef struct mca_oob_1_0_0_t mca_oob_t;
47 
48 
49 typedef mca_oob_t* (*mca_oob_base_component_init_fn_t)(int *priority);
50 
52  mca_base_component_t oob_base;
54  mca_oob_base_component_init_fn_t oob_init;
55 };
58 
59 
60 
61 typedef char* (*mca_oob_base_module_get_addr_fn_t)(void);
62 
63 typedef int (*mca_oob_base_module_set_addr_fn_t)(const orte_process_name_t* peer,
64  const char* uri);
65 
66 
67 
68 /**
69 * Implementation of mca_oob_ping().
70 *
71 * @param peer (IN) Opaque name of peer process.
72 * @param tv (IN) Timeout to wait in connection response.
73 * @return OMPI error code (<0) or ORTE_SUCCESS
74 */
76  const char* uri,
77  const struct timeval* tv);
78 
79 
80 /**
81  * Send an oob message
82  *
83  * Send an oob message. All oob sends are non-blocking, and cbfunc
84  * will be called when the message has been sent. When cbfunc is
85  * called, message has been injected into the network but no guarantee
86  * is made about whether the target has received the message.
87  *
88  * @param[in] target Destination process name
89  * @param[in] origin Origin process for the message, for the purposes
90  * of message matching. This can be different from
91  * the process calling send().
92  * @param[in] msg Array of iovecs describing user buffers and lengths.
93  * @param[in] count Number of elements in iovec array.
94  * @param[in] tag User defined tag for matching send/recv.
95  * @param[in] flags Currently unused.
96  * @param[in] cbfunc Callback function on send completion.
97  * @param[in] cbdata User data that is passed to callback function.
98  *
99  * @return OMPI error code (<0) on error number of bytes actually sent.
100  */
102  orte_process_name_t* target,
103  orte_process_name_t* origin,
104  struct iovec* msg,
105  int count,
106  int tag,
107  int flags,
108  orte_rml_callback_fn_t cbfunc,
109  void* cbdata);
110 
111 /**
112 * Implementation of mca_oob_recv_nb().
113 *
114 * @param peer (IN) Opaque name of peer process or ORTE_NAME_WILDCARD for wildcard receive.
115 * @param msg (IN) Array of iovecs describing user buffers and lengths.
116 * @param count (IN) Number of elements in iovec array.
117 * @param tag (IN) User defined tag for matching send/recv.
118 * @param flags (IN) May be MCA_OOB_PEEK to return up to size bytes of msg w/out removing it from the queue,
119 * @param cbfunc (IN) Callback function on recv completion.
120 * @param cbdata (IN) User data that is passed to callback function.
121 * @return OMPI error code (<0) on error or number of bytes actually received.
122 */
123 
125  orte_process_name_t* peer,
126  struct iovec* msg,
127  int count,
128  int tag,
129  int flags,
130  orte_rml_callback_fn_t cbfunc,
131  void* cbdata);
132 
133 /**
134 * Implementation of mca_oob_recv_cancel().
135 *
136 * @param peer (IN) Opaque name of peer process or ORTE_NAME_WILDCARD for wildcard receive.
137 * @param tag (IN) User defined tag for matching send/recv.
138 * @return OMPI error code (<0) on error or number of bytes actually received.
139 */
140 
142 
143 /**
144  * Hook function called by mca_oob_base_register to allow
145  * the oob component a chance to register contact information
146  */
147 typedef int (*mca_oob_base_module_init_fn_t)(void);
148 
149 /**
150  * Cleanup during finalize.
151  */
152 typedef int (*mca_oob_base_module_fini_fn_t)(void);
153 
154 /* ft event */
155 typedef int (*mca_oob_base_module_ft_event_fn_t)( int state );
156 
157 
158 /**
159  * OOB Module
160  */
164 
165  mca_oob_base_module_get_addr_fn_t oob_get_addr;
166  mca_oob_base_module_set_addr_fn_t oob_set_addr;
167 
169 
171 
173  mca_oob_base_module_recv_cancel_fn_t oob_recv_cancel;
174 
175  mca_oob_base_module_ft_event_fn_t oob_ft_event;
176 
177  orte_rml_exception_callback_t oob_exception_callback;
178 };
179 
180 /**
181  * Macro for use in components that are of type oob
182  */
183 #define MCA_OOB_BASE_VERSION_2_0_0 \
184  MCA_BASE_VERSION_2_0_0, \
185  "oob", 2, 0, 0
186 
187 /*
188  * BWB - FIX ME - This is the first module on the list. This is here
189  * temporarily to make things work
190  */
191 
192 ORTE_DECLSPEC extern mca_oob_t mca_oob;
193 
194 END_C_DECLS
195 
196 #endif
int(* mca_oob_base_module_fini_fn_t)(void)
Cleanup during finalize.
Definition: oob.h:152
Common type for all MCA components.
Definition: mca.h:250
int(* mca_oob_base_module_send_nb_fn_t)(orte_process_name_t *target, orte_process_name_t *origin, struct iovec *msg, int count, int tag, int flags, orte_rml_callback_fn_t cbfunc, void *cbdata)
Send an oob message.
Definition: oob.h:101
int(* mca_oob_base_module_recv_nb_fn_t)(orte_process_name_t *peer, struct iovec *msg, int count, int tag, int flags, orte_rml_callback_fn_t cbfunc, void *cbdata)
Implementation of mca_oob_recv_nb().
Definition: oob.h:124
Definition: types.h:146
Top-level interface for all MCA components.
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
int(* mca_oob_base_module_ping_fn_t)(const orte_process_name_t *, const char *uri, const struct timeval *tv)
Implementation of mca_oob_ping().
Definition: oob.h:75
int(* mca_oob_base_module_init_fn_t)(void)
Hook function called by mca_oob_base_register to allow the oob component a chance to register contact...
Definition: oob.h:147
Runtime Messaging Layer (RML) Communication Interface.
Definition: oob.h:51
Definition: ompi_uio.h:29
Meta data for MCA v2.0.0 components.
Definition: mca.h:309
OOB Module.
Definition: oob.h:161
int(* mca_oob_base_module_recv_cancel_fn_t)(orte_process_name_t *peer, int tag)
Implementation of mca_oob_recv_cancel().
Definition: oob.h:141
Checkpoint and Restart Service (CRS) Interface.
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