1
1

Comments and doxygen updates to the oob.

This commit was SVN r1993.
Этот коммит содержится в:
Tim Prins 2004-08-09 23:07:53 +00:00
родитель 63ad2ba8de
Коммит 593b0542ae
11 изменённых файлов: 73 добавлений и 68 удалений

Просмотреть файл

@ -21,14 +21,25 @@ extern ompi_process_name_t mca_oob_name_any;
extern ompi_process_name_t mca_oob_name_seed; extern ompi_process_name_t mca_oob_name_seed;
extern ompi_process_name_t mca_oob_name_self; extern ompi_process_name_t mca_oob_name_self;
/**
* The wildcard for recieves from any peer.
*/
#define MCA_OOB_NAME_ANY &mca_oob_name_any #define MCA_OOB_NAME_ANY &mca_oob_name_any
/**
* The process name of the seed deamon
*/
#define MCA_OOB_NAME_SEED &mca_oob_name_seed #define MCA_OOB_NAME_SEED &mca_oob_name_seed
/**
* Process name of self
*/
#define MCA_OOB_NAME_SELF &mca_oob_name_self #define MCA_OOB_NAME_SELF &mca_oob_name_self
/* /*
* Other constants * Other constants
*/ */
/**
* Recieve from any tag.
*/
#define MCA_OOB_TAG_ANY 0 #define MCA_OOB_TAG_ANY 0
/* /*
@ -54,9 +65,9 @@ typedef enum {
* int size = mca_oob_recv(name, 0, 0, MSG_OOB_PEEK|MSG_OOB_TRUNC); * int size = mca_oob_recv(name, 0, 0, MSG_OOB_PEEK|MSG_OOB_TRUNC);
*/ */
#define MCA_OOB_PEEK 0x01 /* flag to oob_recv to allow caller to peek a portion of the next available #define MCA_OOB_PEEK 0x01 /**< flag to oob_recv to allow caller to peek a portion of the next available
* message w/out removing the message from the queue. */ * message w/out removing the message from the queue. */
#define MCA_OOB_TRUNC 0x02 /* flag to oob_recv to return the actual size of the message even if the receive #define MCA_OOB_TRUNC 0x02 /**< flag to oob_recv to return the actual size of the message even if the receive
buffer is smaller than the number of bytes available */ buffer is smaller than the number of bytes available */
#if defined(c_plusplus) || defined(__cplusplus) #if defined(c_plusplus) || defined(__cplusplus)

Просмотреть файл

@ -2,8 +2,8 @@
* $HEADER$ * $HEADER$
*/ */
/** @file **/ /** @file
/** *
* The pack and unpack routines for the oob * The pack and unpack routines for the oob
*/ */
#include "mca/oob/base/base.h" #include "mca/oob/base/base.h"

Просмотреть файл

@ -22,7 +22,7 @@
static int do_recv(mca_ns_base_jobid_t jobid, mca_ns_base_vpid_t procid, const struct iovec* iov, int count, int tag, int flags); static int do_recv(mca_ns_base_jobid_t jobid, mca_ns_base_vpid_t procid, const struct iovec* iov, int count, int tag, int flags);
/** /*
* Similiar to unix send(2). * Similiar to unix send(2).
* *
* @param peer (IN) Opaque name of peer process. * @param peer (IN) Opaque name of peer process.

Просмотреть файл

@ -108,27 +108,34 @@ typedef int (*mca_oob_base_module_recv_nb_fn_t)(
mca_oob_callback_fn_t cbfunc, mca_oob_callback_fn_t cbfunc,
void* cbdata); void* cbdata);
/* /**
* OOB Module * OOB Module
*/ */
struct mca_oob_1_0_0_t { struct mca_oob_1_0_0_t {
mca_oob_base_module_send_fn_t oob_send; mca_oob_base_module_send_fn_t oob_send;
mca_oob_base_module_recv_fn_t oob_recv; mca_oob_base_module_recv_fn_t oob_recv;
mca_oob_base_module_send_nb_fn_t oob_send_nb; mca_oob_base_module_send_nb_fn_t oob_send_nb;
mca_oob_base_module_recv_nb_fn_t oob_recv_nb; mca_oob_base_module_recv_nb_fn_t oob_recv_nb;
}; };
/**
* Convenience Typedef
*/
typedef struct mca_oob_1_0_0_t mca_oob_1_0_0_t; typedef struct mca_oob_1_0_0_t mca_oob_1_0_0_t;
/**
* Convenience typedef
*/
typedef struct mca_oob_1_0_0_t mca_oob_t; typedef struct mca_oob_1_0_0_t mca_oob_t;
/** /**
* OOB Component * OOB Component
*/ */
typedef mca_oob_t* (*mca_oob_base_component_init_fn_t)( typedef mca_oob_t* (*mca_oob_base_component_init_fn_t)(
bool *allow_multi_user_threads, bool *allow_multi_user_threads,
bool *have_hidden_threads); bool *have_hidden_threads);
/**
* OOB finalize function
*/
typedef int (*mca_oob_base_component_finalize_fn_t)(void); typedef int (*mca_oob_base_component_finalize_fn_t)(void);
/** /**
@ -141,11 +148,17 @@ struct mca_oob_base_component_1_0_0_t {
mca_oob_base_component_init_fn_t oob_init; mca_oob_base_component_init_fn_t oob_init;
mca_oob_base_component_finalize_fn_t oob_finalize; mca_oob_base_component_finalize_fn_t oob_finalize;
}; };
/**
* Convenience Typedef
*/
typedef struct mca_oob_base_component_1_0_0_t mca_oob_base_component_1_0_0_t; typedef struct mca_oob_base_component_1_0_0_t mca_oob_base_component_1_0_0_t;
/**
* Convenience Typedef
*/
typedef mca_oob_base_component_1_0_0_t mca_oob_base_component_t; typedef mca_oob_base_component_1_0_0_t mca_oob_base_component_t;
/* /**
* Macro for use in components that are of type oob v1.0.0 * Macro for use in components that are of type oob v1.0.0
*/ */
#define MCA_OOB_BASE_VERSION_1_0_0 \ #define MCA_OOB_BASE_VERSION_1_0_0 \
@ -168,6 +181,9 @@ struct mca_oob_base_info_t {
mca_oob_base_component_t *oob_component; mca_oob_base_component_t *oob_component;
mca_oob_t *oob_module; mca_oob_t *oob_module;
}; };
/**
* Convenience Typedef
*/
typedef struct mca_oob_base_info_t mca_oob_base_info_t; typedef struct mca_oob_base_info_t mca_oob_base_info_t;
/** /**
@ -185,37 +201,6 @@ extern "C" {
int mca_oob_base_open(void); int mca_oob_base_open(void);
int mca_oob_base_init(bool *allow_multi_user_threads, bool *have_hidden_threads); int mca_oob_base_init(bool *allow_multi_user_threads, bool *have_hidden_threads);
int mca_oob_base_close(void); int mca_oob_base_close(void);
/*
* functions for pack and unpack routines
*/
/**
* This function packs the passed data according to the type enum.
*
* @param dest the destination for the packed data
* @param src the source of the data
* @param n the number of elements in the src
* @param type the type of data
*
* @retval OMPI_SUCCESS
* @retval OMPI_ERROR
*/
int mca_oob_base_pack(void * dest, void * src, size_t n, mca_oob_base_type_t type);
/**
* This function unpacks the passed data according to the type enum.
*
* @param dest the destination for the unpacked data
* @param src the source of the packed data
* @param n the number of elements in the src
* @param type the type of the data to unpack
*
* @retval OMPI_SUCCESS
* @retval OMPI_ERROR
*/
int mca_oob_base_unpack(void * dest, void * src, size_t n, mca_oob_base_type_t type);
#if defined(c_plusplus) || defined(__cplusplus) #if defined(c_plusplus) || defined(__cplusplus)
} }
#endif #endif

Просмотреть файл

@ -316,8 +316,8 @@ int mca_oob_tcp_finalize(void)
errno); errno);
} }
/*** temporarily disable the removal of the revieve event /*** temporarily disable the removal of the revieve event
* to prevent segfaults * to prevent segfaults */
* ompi_event_del(&mca_oob_tcp_component.tcp_recv_event); */ ompi_event_del(&mca_oob_tcp_component.tcp_recv_event);
if(0 != close(mca_oob_tcp_component.tcp_listen_sd)) { if(0 != close(mca_oob_tcp_component.tcp_listen_sd)) {
ompi_output(0, "mca_oob_tcp_finalize: error closing listen socket. errno=%d", errno); ompi_output(0, "mca_oob_tcp_finalize: error closing listen socket. errno=%d", errno);
} }
@ -332,7 +332,7 @@ int mca_oob_tcp_finalize(void)
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }
/** /*
* Compare two process names for equality. * Compare two process names for equality.
* *
* @param n1 Process name 1. * @param n1 Process name 1.

Просмотреть файл

@ -33,23 +33,21 @@ int mca_oob_tcp_close(void);
mca_oob_t* mca_oob_tcp_init(bool *allow_multi_user_threads, bool *have_hidden_threads); mca_oob_t* mca_oob_tcp_init(bool *allow_multi_user_threads, bool *have_hidden_threads);
int mca_oob_tcp_finalize(void); int mca_oob_tcp_finalize(void);
/* /**
* Convert process name from network to host byte order. * Convert process name from network to host byte order.
* *
* @param name * @param name
*/ */
#define OMPI_PROCESS_NAME_NTOH(n) \ #define OMPI_PROCESS_NAME_NTOH(n) \
n.cellid = ntohl(n.cellid); \ n.cellid = ntohl(n.cellid); \
n.jobid = ntohl(n.jobid); \ n.jobid = ntohl(n.jobid); \
n.vpid = ntohl(n.vpid); n.vpid = ntohl(n.vpid);
/* /**
* Convert process name from host to network byte order. * Convert process name from host to network byte order.
* *
* @param name * @param name
*/ */
#define OMPI_PROCESS_NAME_HTON(n) \ #define OMPI_PROCESS_NAME_HTON(n) \
n.cellid = htonl(n.cellid); \ n.cellid = htonl(n.cellid); \
n.jobid = htonl(n.jobid); \ n.jobid = htonl(n.jobid); \
@ -101,7 +99,7 @@ int mca_oob_tcp_send(
int mca_oob_tcp_recv( int mca_oob_tcp_recv(
ompi_process_name_t* peer, ompi_process_name_t* peer,
const struct iovec *iov, const struct iovec * msg,
int count, int count,
int tag, int tag,
int flags); int flags);
@ -127,7 +125,7 @@ int mca_oob_tcp_recv(
int mca_oob_tcp_send_nb( int mca_oob_tcp_send_nb(
const ompi_process_name_t* peer, const ompi_process_name_t* peer,
const struct iovec* iov, const struct iovec* msg,
int count, int count,
int tag, int tag,
int flags, int flags,
@ -149,7 +147,7 @@ int mca_oob_tcp_send_nb(
int mca_oob_tcp_recv_nb( int mca_oob_tcp_recv_nb(
ompi_process_name_t* peer, ompi_process_name_t* peer,
const struct iovec* iov, const struct iovec* msg,
int count, int count,
int tag, int tag,
int flags, int flags,
@ -177,6 +175,9 @@ struct mca_oob_tcp_component_t {
ompi_list_t tcp_msg_recv; /**< list of recieved messages */ ompi_list_t tcp_msg_recv; /**< list of recieved messages */
ompi_mutex_t tcp_match_lock; /**< lock held while searching/posting messages */ ompi_mutex_t tcp_match_lock; /**< lock held while searching/posting messages */
}; };
/**
* Convenience Typedef
*/
typedef struct mca_oob_tcp_component_t mca_oob_tcp_component_t; typedef struct mca_oob_tcp_component_t mca_oob_tcp_component_t;
extern mca_oob_tcp_component_t mca_oob_tcp_component; extern mca_oob_tcp_component_t mca_oob_tcp_component;

Просмотреть файл

@ -9,7 +9,7 @@
#ifndef _MCA_OOB_TCP_HDR_H_ #ifndef _MCA_OOB_TCP_HDR_H_
#define _MCA_OOB_TCP_HDR_H_ #define _MCA_OOB_TCP_HDR_H_
/* /**
* Header used by tcp oob protocol. * Header used by tcp oob protocol.
*/ */
struct mca_oob_tcp_hdr_t { struct mca_oob_tcp_hdr_t {
@ -18,10 +18,16 @@ struct mca_oob_tcp_hdr_t {
}; };
typedef struct mca_oob_tcp_hdr_t mca_oob_tcp_hdr_t; typedef struct mca_oob_tcp_hdr_t mca_oob_tcp_hdr_t;
/**
* Convert the message header to host byte order
*/
#define MCA_OOB_TCP_HDR_NTOHL(h) \ #define MCA_OOB_TCP_HDR_NTOHL(h) \
ntohl(h->msg_size); \ ntohl(h->msg_size); \
ntohl(h->msg_tag); ntohl(h->msg_tag);
/**
* Convert the message header to network byte order
*/
#define MCA_OOB_TCP_HDR_HTONL(h) \ #define MCA_OOB_TCP_HDR_HTONL(h) \
htonl(h->msg_size); \ htonl(h->msg_size); \
htonl(h->msg_tag); htonl(h->msg_tag);

Просмотреть файл

@ -27,7 +27,7 @@ static void mca_oob_tcp_msg_destruct(mca_oob_tcp_msg_t* msg)
} }
/** /*
* Wait for a msg to complete. * Wait for a msg to complete.
* @param msg (IN) Message to wait on. * @param msg (IN) Message to wait on.
* @param rc (OUT) Return code (number of bytes read on success or error code on failure). * @param rc (OUT) Return code (number of bytes read on success or error code on failure).
@ -50,7 +50,7 @@ int mca_oob_tcp_msg_wait(mca_oob_tcp_msg_t* msg, int* rc)
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }
/** /*
* Signal that a message has completed. * Signal that a message has completed.
* @param msg (IN) Message to wait on. * @param msg (IN) Message to wait on.
* @param peer (IN) the peer of the message * @param peer (IN) the peer of the message
@ -113,7 +113,7 @@ bool mca_oob_tcp_msg_send_handler(mca_oob_tcp_msg_t* msg, struct mca_oob_tcp_pee
} }
} }
/** /*
* Receives message data. * Receives message data.
* @param msg the message to be recieved into * @param msg the message to be recieved into
* @param peer the peer to recieve from * @param peer the peer to recieve from
@ -154,7 +154,7 @@ bool mca_oob_tcp_msg_recv_handler(mca_oob_tcp_msg_t* msg, struct mca_oob_tcp_pee
} }
} }
/** /*
* Called to copy the results of a message into user supplied iovec array. * Called to copy the results of a message into user supplied iovec array.
* @param msg (IN) Message send that is in progress. * @param msg (IN) Message send that is in progress.
* @param iov (IN) Iovec array of user supplied buffers. * @param iov (IN) Iovec array of user supplied buffers.
@ -195,7 +195,7 @@ int mca_oob_tcp_msg_copy(mca_oob_tcp_msg_t* msg, const struct iovec* iov, int co
return rc; return rc;
} }
/** /*
* Match name to a message that has been received asynchronously (unexpected). * Match name to a message that has been received asynchronously (unexpected).
* *
* @param name (IN) Name associated with peer or wildcard to match first posted recv. * @param name (IN) Name associated with peer or wildcard to match first posted recv.
@ -221,7 +221,7 @@ mca_oob_tcp_msg_t* mca_oob_tcp_msg_match_recv(const ompi_process_name_t* name, i
return NULL; return NULL;
} }
/** /*
* Match name to a posted recv request. * Match name to a posted recv request.
* *
* @param name (IN) Name associated with peer or wildcard to match first posted recv. * @param name (IN) Name associated with peer or wildcard to match first posted recv.

Просмотреть файл

@ -107,7 +107,7 @@ int mca_oob_tcp_msg_copy(mca_oob_tcp_msg_t* msg, const struct iovec* iov, int co
/** /**
* Called asynchronously to progress sending a message from the event library thread. * Called asynchronously to progress sending a message from the event library thread.
* @param msg (IN) Message send that is in progress. * @param msg (IN) Message send that is in progress.
* @param sd (IN) Socket descriptor to use for send. * @param peer (IN) Peer we are sending to.
* @retval Number of bytes copied. * @retval Number of bytes copied.
*/ */
bool mca_oob_tcp_msg_send_handler(mca_oob_tcp_msg_t* msg, struct mca_oob_tcp_peer_t * peer); bool mca_oob_tcp_msg_send_handler(mca_oob_tcp_msg_t* msg, struct mca_oob_tcp_peer_t * peer);
@ -115,7 +115,7 @@ bool mca_oob_tcp_msg_send_handler(mca_oob_tcp_msg_t* msg, struct mca_oob_tcp_pee
/** /**
* Called asynchronously to progress sending a message from the event library thread. * Called asynchronously to progress sending a message from the event library thread.
* @param msg (IN) Message send that is in progress. * @param msg (IN) Message send that is in progress.
* @param sd (IN) Socket descriptor to use for send. * @param peer (IN) Peer theat we are recieving from.
* @retval bool Bool flag indicating wether operation has completed. * @retval bool Bool flag indicating wether operation has completed.
*/ */
@ -131,7 +131,7 @@ bool mca_oob_tcp_msg_recv_handler(mca_oob_tcp_msg_t* msg, struct mca_oob_tcp_pee
* Note - this routine requires the caller to be holding the module lock. * Note - this routine requires the caller to be holding the module lock.
*/ */
mca_oob_tcp_msg_t* mca_oob_tcp_msg_match_recv(const ompi_process_name_t*, int tag); mca_oob_tcp_msg_t* mca_oob_tcp_msg_match_recv(const ompi_process_name_t* name, int tag);
/** /**
* Match name to a posted recv request. * Match name to a posted recv request.
@ -144,7 +144,7 @@ mca_oob_tcp_msg_t* mca_oob_tcp_msg_match_recv(const ompi_process_name_t*, int ta
* Note - this routine requires the caller to be holding the module lock. * Note - this routine requires the caller to be holding the module lock.
*/ */
mca_oob_tcp_msg_t* mca_oob_tcp_msg_match_post(const ompi_process_name_t*, int tag, bool peek); mca_oob_tcp_msg_t* mca_oob_tcp_msg_match_post(const ompi_process_name_t* name, int tag, bool peek);
/** /**
* Allocate space for iovec array - if the request number of elements is less than * Allocate space for iovec array - if the request number of elements is less than
@ -152,11 +152,10 @@ mca_oob_tcp_msg_t* mca_oob_tcp_msg_match_post(const ompi_process_name_t*, int ta
* allocate count elements. * allocate count elements.
* *
* @param msg (IN) Message to allocate array. * @param msg (IN) Message to allocate array.
* @param count (IN) the number of iovecs
* @return Array of iovec elements. * @return Array of iovec elements.
* *
*/ */
static inline struct iovec* mca_oob_tcp_msg_iov_alloc(mca_oob_tcp_msg_t* msg, int count) static inline struct iovec* mca_oob_tcp_msg_iov_alloc(mca_oob_tcp_msg_t* msg, int count)
{ {
if(count <= MCA_OOB_TCP_IOV_MAX) if(count <= MCA_OOB_TCP_IOV_MAX)

Просмотреть файл

@ -55,14 +55,14 @@ static void mca_oob_tcp_peer_construct(mca_oob_tcp_peer_t* peer)
*/ */
static void mca_oob_tcp_peer_destruct(mca_oob_tcp_peer_t * peer) static void mca_oob_tcp_peer_destruct(mca_oob_tcp_peer_t * peer)
{ {
/* temporarily not delete the events to prevent segfaults /* temporarily not delete the events to prevent segfaults */
* mca_oob_tcp_peer_close(peer); */ mca_oob_tcp_peer_close(peer);
if(peer->peer_state != MCA_OOB_TCP_CLOSED && /*if(peer->peer_state != MCA_OOB_TCP_CLOSED &&
peer->peer_sd >= 0) { peer->peer_sd >= 0) {
ompi_event_del(&peer->peer_send_event); ompi_event_del(&peer->peer_send_event);
close(peer->peer_sd); close(peer->peer_sd);
peer->peer_sd = -1; peer->peer_sd = -1;
} }*/
OBJ_DESTRUCT(&(peer->peer_send_queue)); OBJ_DESTRUCT(&(peer->peer_send_queue));
OBJ_DESTRUCT(&(peer->peer_lock)); OBJ_DESTRUCT(&(peer->peer_lock));
} }

Просмотреть файл

@ -46,6 +46,9 @@ struct mca_oob_tcp_peer_t {
mca_oob_tcp_msg_t *peer_send_msg; /**< current send in progress */ mca_oob_tcp_msg_t *peer_send_msg; /**< current send in progress */
mca_oob_tcp_msg_t *peer_recv_msg; /**< current recv in progress */ mca_oob_tcp_msg_t *peer_recv_msg; /**< current recv in progress */
}; };
/**
* Convenience Typedef
*/
typedef struct mca_oob_tcp_peer_t mca_oob_tcp_peer_t; typedef struct mca_oob_tcp_peer_t mca_oob_tcp_peer_t;
/* /*