23 #ifndef _MCA_OOB_TCP_MESSAGE_H_
24 #define _MCA_OOB_TCP_MESSAGE_H_
26 #include "orte_config.h"
39 #define MCA_OOB_TCP_IOV_MAX 16
41 typedef enum { MCA_OOB_TCP_POSTED, MCA_OOB_TCP_UNEXPECTED } mca_oob_tcp_type_t;
66 struct iovec msg_iov[MCA_OOB_TCP_IOV_MAX];
79 #define MCA_OOB_TCP_MSG_ALLOC(msg, rc) \
81 opal_free_list_item_t* item; \
82 OPAL_FREE_LIST_GET(&mca_oob_tcp_component.tcp_msgs, item, rc); \
83 msg = (mca_oob_tcp_msg_t*)item; \
89 #define MCA_OOB_TCP_MSG_RETURN(msg) \
92 if(NULL != msg->msg_rwiov) \
93 mca_oob_tcp_msg_iov_return(msg,msg->msg_rwiov); \
94 if(NULL != msg->msg_rwbuf) \
95 free(msg->msg_rwbuf); \
96 OPAL_FREE_LIST_RETURN(&mca_oob_tcp_component.tcp_msgs, \
194 if(count <= MCA_OOB_TCP_IOV_MAX)
196 return (
struct iovec *)malloc(
sizeof(
struct iovec) * count);
210 if(iov != msg->msg_iov)
void * msg_cbdata
the data for the callback fnuction
Definition: oob_tcp_msg.h:61
orte_process_name_t msg_peer
the name of the peer
Definition: oob_tcp_msg.h:63
mca_oob_tcp_hdr_t msg_hdr
header used to convey message properties to peer
Definition: oob_tcp_msg.h:52
bool mca_oob_tcp_msg_send_handler(mca_oob_tcp_msg_t *msg, struct mca_oob_tcp_peer_t *peer)
Called asynchronously to progress sending a message from the event library thread.
Definition: oob_tcp_msg.c:138
Contains the internal functions and typedefs for the use of the oob.
Definition: condition.h:49
struct iovec * msg_rwptr
current read/write pointer into msg_iov
Definition: oob_tcp_msg.h:56
void * msg_rwbuf
optional buffer for send/recv
Definition: oob_tcp_msg.h:59
Definition: mutex_unix.h:53
int msg_rwcnt
total number of iovecs for read/write
Definition: oob_tcp_msg.h:58
mca_oob_tcp_msg_t * mca_oob_tcp_msg_match_recv(orte_process_name_t *name, int tag)
Match name to a message that has been received asynchronously (unexpected).
Definition: oob_tcp_msg.c:515
opal_mutex_t msg_lock
lock for the condition variable
Definition: oob_tcp_msg.h:64
Header used by tcp oob protocol.
Definition: oob_tcp_hdr.h:40
static struct iovec * mca_oob_tcp_msg_iov_alloc(mca_oob_tcp_msg_t *msg, int count)
Allocate space for iovec array - if the request number of elements is less than MCA_OOB_TCP_IOV_MAX t...
Definition: oob_tcp_msg.h:192
mca_oob_tcp_type_t msg_type
posted receive or unexpected
Definition: oob_tcp_msg.h:49
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
mca_oob_tcp_msg_t * mca_oob_tcp_msg_match_post(orte_process_name_t *name, int tag)
Match name to a posted recv request.
Definition: oob_tcp_msg.c:540
describes each message being progressed.
Definition: oob_tcp_msg.h:47
Definition: opal_free_list.h:47
int mca_oob_tcp_msg_wait(mca_oob_tcp_msg_t *msg, int *size)
Wait for a msg to complete.
int mca_oob_tcp_msg_complete(mca_oob_tcp_msg_t *msg, orte_process_name_t *peer)
Signal that a message has completed.
Definition: oob_tcp_msg.c:77
int msg_rc
the return code for the send/recv (amount sent/recvd or errno)
Definition: oob_tcp_msg.h:51
static void mca_oob_tcp_msg_iov_return(mca_oob_tcp_msg_t *msg, struct iovec *iov)
Release resource held by iovec array if this is not part of the message.
Definition: oob_tcp_msg.h:208
bool mca_oob_tcp_msg_recv_handler(mca_oob_tcp_msg_t *msg, struct mca_oob_tcp_peer_t *peer)
Called asynchronously to progress sending a message from the event library thread.
Definition: oob_tcp_msg.c:195
struct iovec * msg_rwiov
copy of iovec array - not data
Definition: oob_tcp_msg.h:55
int mca_oob_tcp_msg_timedwait(mca_oob_tcp_msg_t *msg, int *size, struct timespec *ts)
Wait - up to a timeout - for a msg to complete.
Contains header used by tcp oob.
Definition: ompi_uio.h:29
struct iovec * msg_uiov
the user supplied iovec array
Definition: oob_tcp_msg.h:53
int msg_flags
flags to send/recv
Definition: oob_tcp_msg.h:50
This structure describes a peer.
Definition: oob_tcp_peer.h:59
int msg_ucnt
the number of items in the user iovec array
Definition: oob_tcp_msg.h:54
bool msg_complete
whether the message is done sending or not
Definition: oob_tcp_msg.h:62
opal_free_list_item_t super
allow this item to be put on a list
Definition: oob_tcp_msg.h:48
Definition: ompi_time.h:160
int msg_rwnum
number of iovecs left for read/write
Definition: oob_tcp_msg.h:57
opal_condition_t msg_condition
condition variable for completion
Definition: oob_tcp_msg.h:65
orte_rml_callback_fn_t msg_cbfunc
the callback function for the send/receive
Definition: oob_tcp_msg.h:60
int mca_oob_tcp_msg_copy(mca_oob_tcp_msg_t *msg, struct iovec *iov, int count)
Called to copy the results of a message into user supplied iovec array.
Definition: oob_tcp_msg.c:470
#define OBJ_CLASS_DECLARATION(NAME)
Declaration for class descriptor.
Definition: opal_object.h:236
void mca_oob_tcp_msg_recv_complete(mca_oob_tcp_msg_t *msg, struct mca_oob_tcp_peer_t *peer)
The message has been completely received - so attempt to match against posted recvs.
Definition: oob_tcp_msg.c:322