OpenMPI
0.1.1
|
contains the data structure we will use to describe a message More...
#include "orte_config.h"
#include "orte/types.h"
#include <errno.h>
#include "orte/mca/oob/oob.h"
#include "oob_tcp_hdr.h"
Go to the source code of this file.
Data Structures | |
struct | mca_oob_tcp_msg_t |
describes each message being progressed. More... | |
Macros | |
#define | MCA_OOB_TCP_IOV_MAX 16 |
#define | MCA_OOB_TCP_MSG_ALLOC(msg, rc) |
Get a new structure for use with a message. More... | |
#define | MCA_OOB_TCP_MSG_RETURN(msg) |
return a message structure that is no longer needed More... | |
Typedefs | |
typedef struct mca_oob_tcp_msg_t | mca_oob_tcp_msg_t |
Convenience typedef. | |
Enumerations | |
enum | mca_oob_tcp_type_t { MCA_OOB_TCP_POSTED, MCA_OOB_TCP_UNEXPECTED } |
Functions | |
OBJ_CLASS_DECLARATION (mca_oob_tcp_msg_t) | |
int | mca_oob_tcp_msg_wait (mca_oob_tcp_msg_t *msg, int *size) |
Wait for a msg to complete. More... | |
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. More... | |
int | mca_oob_tcp_msg_complete (mca_oob_tcp_msg_t *msg, orte_process_name_t *peer) |
Signal that a message has completed. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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). More... | |
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. More... | |
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 then use the array allocated along w/ the message - otherwise allocate count elements. More... | |
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. More... | |
contains the data structure we will use to describe a message
#define MCA_OOB_TCP_MSG_ALLOC | ( | msg, | |
rc | |||
) |
Get a new structure for use with a message.
Referenced by mca_oob_tcp_recv_nb().
#define MCA_OOB_TCP_MSG_RETURN | ( | msg | ) |
return a message structure that is no longer needed
Referenced by mca_oob_tcp_msg_complete(), mca_oob_tcp_msg_recv_complete(), mca_oob_tcp_recv_cancel(), and mca_oob_tcp_recv_nb().
int mca_oob_tcp_msg_complete | ( | mca_oob_tcp_msg_t * | msg, |
orte_process_name_t * | peer | ||
) |
Signal that a message has completed.
Wakes up any pending threads (for blocking send) or invokes callbacks for non-blocking case.
msg | (IN) Message send/recv that has completed. |
peer | (IN) The peer the send/receive was from |
ORTE_SUCCESS | or error code on failure. |
References MCA_OOB_TCP_MSG_RETURN, mca_oob_tcp_msg_t::msg_cbdata, mca_oob_tcp_msg_t::msg_cbfunc, mca_oob_tcp_msg_t::msg_complete, mca_oob_tcp_msg_t::msg_condition, mca_oob_tcp_msg_t::msg_flags, mca_oob_tcp_msg_t::msg_hdr, mca_oob_tcp_msg_t::msg_lock, mca_oob_tcp_msg_t::msg_peer, mca_oob_tcp_msg_t::msg_rc, mca_oob_tcp_hdr_t::msg_tag, mca_oob_tcp_msg_t::msg_ucnt, mca_oob_tcp_msg_t::msg_uiov, opal_list_append, opal_list_get_size(), opal_list_remove_first(), opal_list_remove_item(), OPAL_THREAD_LOCK, OPAL_THREAD_UNLOCK, ORTE_RML_FLAG_RECURSIVE_CALLBACK, mca_oob_tcp_component_t::tcp_lock, and mca_oob_tcp_component_t::tcp_msg_completed.
Referenced by mca_oob_tcp_peer_send().
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.
msg | (IN) Message send that is in progress. |
iov | (IN) Iovec array of user supplied buffers. |
count | Number of elements in iovec array. |
References mca_oob_tcp_msg_t::msg_flags, mca_oob_tcp_msg_t::msg_hdr, mca_oob_tcp_msg_t::msg_rwbuf, mca_oob_tcp_hdr_t::msg_size, and ORTE_RML_ALLOC.
|
static |
Allocate space for iovec array - if the request number of elements is less than MCA_OOB_TCP_IOV_MAX then use the array allocated along w/ the message - otherwise allocate count elements.
msg | (IN) Message to allocate array. |
count | (IN) the number of iovecs |
|
inlinestatic |
Release resource held by iovec array if this is not part of the message.
msg | (IN) Message to allocate array. |
iov | (IN) Iovec array to return. |
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.
name | (IN) Name associated with peer or wildcard to match first posted recv. |
tag | (IN) Message tag. |
Note - this routine requires the caller to be holding the module lock.
References mca_oob_tcp_msg_t::msg_flags, mca_oob_tcp_msg_t::msg_hdr, mca_oob_tcp_msg_t::msg_peer, mca_oob_tcp_hdr_t::msg_tag, opal_list_get_end(), opal_list_get_first(), opal_list_get_next, opal_list_remove_item(), ORTE_NAME, ORTE_RML_PERSISTENT, mca_oob_tcp_msg_t::super, and mca_oob_tcp_component_t::tcp_msg_post.
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).
name | (IN) Name associated with peer or wildcard to match first posted recv. |
tag | (IN) Message tag. |
Note - this routine requires the caller to be holding the module lock.
References mca_oob_tcp_msg_t::msg_hdr, mca_oob_tcp_hdr_t::msg_tag, opal_list_get_end(), opal_list_get_first(), opal_list_get_next, ORTE_NAME, and mca_oob_tcp_component_t::tcp_msg_recv.
Referenced by mca_oob_tcp_recv_nb().
void mca_oob_tcp_msg_recv_complete | ( | mca_oob_tcp_msg_t * | msg, |
mca_oob_tcp_peer_t * | peer | ||
) |
The message has been completely received - so attempt to match against posted recvs.
The message has been completely received - so attempt to match against posted recvs.
References MCA_OOB_TCP_MSG_RETURN, mca_oob_tcp_msg_t::msg_hdr, mca_oob_tcp_hdr_t::msg_type, opal_output(), ORTE_PROC_MY_NAME, and mca_oob_tcp_peer_t::peer_name.
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.
msg | (IN) Message send that is in progress. |
peer | (IN) Peer theat we are recieving from. |
bool | Bool flag indicating wether operation has completed. |
References MCA_OOB_TCP_HDR_NTOH, mca_oob_tcp_peer_close(), mca_oob_tcp_msg_t::msg_hdr, mca_oob_tcp_msg_t::msg_rwbuf, mca_oob_tcp_msg_t::msg_rwiov, mca_oob_tcp_msg_t::msg_rwnum, mca_oob_tcp_msg_t::msg_rwptr, mca_oob_tcp_hdr_t::msg_size, mca_oob_tcp_hdr_t::msg_type, opal_output(), ORTE_PROC_MY_NAME, mca_oob_tcp_peer_t::peer_name, and mca_oob_tcp_component_t::tcp_debug.
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.
msg | (IN) Message send that is in progress. |
peer | (IN) Peer we are sending to. |
Number | of bytes copied. |
References mca_oob_tcp_peer_close(), mca_oob_tcp_msg_t::msg_rc, mca_oob_tcp_msg_t::msg_rwnum, mca_oob_tcp_msg_t::msg_rwptr, opal_output(), ORTE_PROC_MY_NAME, mca_oob_tcp_peer_t::peer_name, and mca_oob_tcp_peer_t::peer_sd.
Referenced by mca_oob_tcp_peer_send().
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.
msg | (IN) Message to wait on. |
size | (OUT) Number of bytes delivered. |
ORTE_SUCCESS | or error code on failure. |
int mca_oob_tcp_msg_wait | ( | mca_oob_tcp_msg_t * | msg, |
int * | size | ||
) |
Wait for a msg to complete.
msg | (IN) Message to wait on. |
size | (OUT) Number of bytes delivered. |
ORTE_SUCCESS | or error code on failure. |