2004-08-25 21:39:08 +04:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-08-25 21:39:08 +04:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte_config.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/mca/ns/ns.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/mca/oob/tcp/oob_tcp.h"
|
2004-07-01 18:49:54 +04:00
|
|
|
|
|
|
|
/*
|
2004-07-14 01:03:03 +04:00
|
|
|
* Similiar to unix readv(2)
|
2004-07-01 18:49:54 +04:00
|
|
|
*
|
Bring over the update to terminate orteds that are generated by a dynamic spawn such as comm_spawn. This introduces the concept of a job "family" - i.e., jobs that have a parent/child relationship. Comm_spawn'ed jobs have a parent (the one that spawned them). We track that relationship throughout the lineage - i.e., if a comm_spawned job in turn calls comm_spawn, then it has a parent (the one that spawned it) and a "root" job (the original job that started things).
Accordingly, there are new APIs to the name service to support the ability to get a job's parent, root, immediate children, and all its descendants. In addition, the terminate_job, terminate_orted, and signal_job APIs for the PLS have been modified to accept attributes that define the extent of their actions. For example, doing a "terminate_job" with an attribute of ORTE_NS_INCLUDE_DESCENDANTS will terminate the given jobid AND all jobs that descended from it.
I have tested this capability on a MacBook under rsh, Odin under SLURM, and LANL's Flash (bproc). It worked successfully on non-MPI jobs (both simple and including a spawn), and MPI jobs (again, both simple and with a spawn).
This commit was SVN r12597.
2006-11-14 22:34:59 +03:00
|
|
|
* @param peer (IN) Opaque name of peer process or ORTE_NAME_WILDCARD for wildcard receive.
|
2004-07-01 18:49:54 +04:00
|
|
|
* @param msg (IN) Array of iovecs describing user buffers and lengths.
|
|
|
|
* @param types (IN) Parallel array to iovecs describing data type of each iovec element.
|
|
|
|
* @param count (IN) Number of elements in iovec array.
|
2004-08-03 01:24:00 +04:00
|
|
|
* @param tag (IN) User supplied tag for matching send/recv.
|
2004-07-15 23:08:54 +04:00
|
|
|
* @param flags (IN) May be MCA_OOB_PEEK to return up to the number of bytes provided in the
|
2004-07-01 18:49:54 +04:00
|
|
|
* iovec array without removing the message from the queue.
|
|
|
|
* @return OMPI error code (<0) on error or number of bytes actually received.
|
|
|
|
*/
|
2004-08-03 01:24:00 +04:00
|
|
|
int mca_oob_tcp_recv(
|
2005-03-14 23:57:21 +03:00
|
|
|
orte_process_name_t* peer,
|
2004-08-13 02:41:42 +04:00
|
|
|
struct iovec *iov,
|
2004-08-03 01:24:00 +04:00
|
|
|
int count,
|
2005-03-14 23:57:21 +03:00
|
|
|
int tag,
|
2004-08-03 01:24:00 +04:00
|
|
|
int flags)
|
2004-07-01 18:49:54 +04:00
|
|
|
{
|
2004-08-03 01:24:00 +04:00
|
|
|
mca_oob_tcp_msg_t *msg;
|
2004-10-10 01:20:04 +04:00
|
|
|
int i, rc = 0, size = 0;
|
2004-08-03 01:24:00 +04:00
|
|
|
|
2005-03-19 02:40:08 +03:00
|
|
|
if(mca_oob_tcp_component.tcp_debug > 3) {
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output(0, "[%lu,%lu,%lu]-[%lu,%lu,%lu] mca_oob_tcp_recv: tag %d\n",
|
2005-03-14 23:57:21 +03:00
|
|
|
ORTE_NAME_ARGS(orte_process_info.my_name),
|
|
|
|
ORTE_NAME_ARGS(peer),
|
2004-09-02 03:07:40 +04:00
|
|
|
tag);
|
|
|
|
}
|
|
|
|
|
2004-07-15 23:08:54 +04:00
|
|
|
/* lock the tcp struct */
|
2005-07-04 02:45:48 +04:00
|
|
|
OPAL_THREAD_LOCK(&mca_oob_tcp_component.tcp_match_lock);
|
2004-08-03 01:24:00 +04:00
|
|
|
|
|
|
|
/* check to see if a matching receive is on the list */
|
2004-09-02 03:07:40 +04:00
|
|
|
msg = mca_oob_tcp_msg_match_recv(peer, tag);
|
2004-08-03 01:24:00 +04:00
|
|
|
if(NULL != msg) {
|
|
|
|
|
2004-08-04 03:39:46 +04:00
|
|
|
if(msg->msg_rc < 0) {
|
2005-07-04 02:45:48 +04:00
|
|
|
OPAL_THREAD_UNLOCK(&mca_oob_tcp_component.tcp_match_lock);
|
2004-08-03 01:24:00 +04:00
|
|
|
return msg->msg_rc;
|
2004-08-04 03:39:46 +04:00
|
|
|
}
|
2004-08-13 19:15:14 +04:00
|
|
|
|
|
|
|
/* if we are returning an allocated buffer - just take it from the message */
|
|
|
|
if(flags & MCA_OOB_ALLOC) {
|
2004-08-03 01:24:00 +04:00
|
|
|
|
2004-08-13 19:15:14 +04:00
|
|
|
if(NULL == iov || 0 == count) {
|
2006-02-12 04:33:29 +03:00
|
|
|
return ORTE_ERR_BAD_PARAM;
|
2004-08-13 19:15:14 +04:00
|
|
|
}
|
2005-01-26 03:20:35 +03:00
|
|
|
iov[0].iov_base = (ompi_iov_base_ptr_t)msg->msg_rwbuf;
|
2004-11-07 06:18:00 +03:00
|
|
|
iov[0].iov_len = msg->msg_hdr.msg_size;
|
2004-08-13 19:15:14 +04:00
|
|
|
msg->msg_rwbuf = NULL;
|
2004-11-20 22:12:43 +03:00
|
|
|
rc = msg->msg_hdr.msg_size;
|
|
|
|
|
2004-08-13 19:15:14 +04:00
|
|
|
} else {
|
|
|
|
|
|
|
|
/* if we are just doing peek, return bytes without dequeing message */
|
|
|
|
rc = mca_oob_tcp_msg_copy(msg, iov, count);
|
|
|
|
if(rc >= 0 && MCA_OOB_TRUNC & flags) {
|
|
|
|
rc = 0;
|
Not as bad as this all may look. Tim and I made a significant change to the way we handle the startup of the oob, the seed, etc. We have made it backwards-compatible so that mpirun2 and singleton operations remain working. We had to adjust the name server and gpr as well, plus the process_info structure.
This also includes a checkpoint update to openmpi.c and ompid.c. I have re-enabled the ompid compile.
This latter raises an important point. The trunk compiles the programs like ompid just fine under Linux. It also does just fine for OSX under the dynamic libraries. However, we are seeing errors when compiling under OSX for the static case - the linker seems to have trouble resolving some variable names, even though linker diagnostics show the variables as being defined. Thus, a warning to Mac users that you may have to locally turn things off if you are trying to do static compiles. We ask, however, that you don't commit those changes that turn things off for everyone else - instead, let's try to figure out why the static compile is having a problem, and let everyone else continue to work.
Thanks
Ralph
This commit was SVN r2534.
2004-09-08 07:59:06 +04:00
|
|
|
/* skip first iovec element which is the header */
|
|
|
|
for(i=1; i<msg->msg_rwcnt+1; i++)
|
2004-08-13 19:15:14 +04:00
|
|
|
rc += msg->msg_rwiov[i].iov_len;
|
|
|
|
}
|
|
|
|
if(MCA_OOB_PEEK & flags) {
|
2005-07-04 02:45:48 +04:00
|
|
|
OPAL_THREAD_UNLOCK(&mca_oob_tcp_component.tcp_match_lock);
|
2004-08-13 19:15:14 +04:00
|
|
|
return rc;
|
|
|
|
}
|
2004-08-03 01:24:00 +04:00
|
|
|
}
|
2004-08-13 19:15:14 +04:00
|
|
|
|
2004-08-03 01:24:00 +04:00
|
|
|
/* otherwise dequeue the message and return to free list */
|
2005-07-03 20:22:16 +04:00
|
|
|
opal_list_remove_item(&mca_oob_tcp_component.tcp_msg_recv, (opal_list_item_t *) msg);
|
2004-08-03 01:24:00 +04:00
|
|
|
MCA_OOB_TCP_MSG_RETURN(msg);
|
2005-07-04 02:45:48 +04:00
|
|
|
OPAL_THREAD_UNLOCK(&mca_oob_tcp_component.tcp_match_lock);
|
2004-08-03 01:24:00 +04:00
|
|
|
return rc;
|
2004-07-15 23:08:54 +04:00
|
|
|
}
|
2004-08-03 01:24:00 +04:00
|
|
|
|
|
|
|
/* the message has not already been received. So we add it to the receive queue */
|
|
|
|
MCA_OOB_TCP_MSG_ALLOC(msg, rc);
|
2004-07-15 23:08:54 +04:00
|
|
|
if(NULL == msg) {
|
2005-07-04 02:45:48 +04:00
|
|
|
OPAL_THREAD_UNLOCK(&mca_oob_tcp_component.tcp_match_lock);
|
2004-08-03 01:24:00 +04:00
|
|
|
return rc;
|
2004-07-15 23:08:54 +04:00
|
|
|
}
|
2004-08-03 01:24:00 +04:00
|
|
|
|
|
|
|
/* determine overall size of user supplied buffer */
|
|
|
|
for(i = 0; i < count; i++) {
|
|
|
|
size += iov[i].iov_len;
|
|
|
|
}
|
|
|
|
|
2004-07-15 23:08:54 +04:00
|
|
|
/* fill in the struct */
|
2004-09-02 03:07:40 +04:00
|
|
|
msg->msg_hdr.msg_size = size;
|
|
|
|
msg->msg_hdr.msg_tag = tag;
|
2004-09-08 21:02:24 +04:00
|
|
|
msg->msg_hdr.msg_type = MCA_OOB_TCP_DATA;
|
2004-09-02 03:07:40 +04:00
|
|
|
msg->msg_hdr.msg_src = *peer;
|
2005-03-14 23:57:21 +03:00
|
|
|
if (NULL == orte_process_info.my_name) {
|
Bring over the update to terminate orteds that are generated by a dynamic spawn such as comm_spawn. This introduces the concept of a job "family" - i.e., jobs that have a parent/child relationship. Comm_spawn'ed jobs have a parent (the one that spawned them). We track that relationship throughout the lineage - i.e., if a comm_spawned job in turn calls comm_spawn, then it has a parent (the one that spawned it) and a "root" job (the original job that started things).
Accordingly, there are new APIs to the name service to support the ability to get a job's parent, root, immediate children, and all its descendants. In addition, the terminate_job, terminate_orted, and signal_job APIs for the PLS have been modified to accept attributes that define the extent of their actions. For example, doing a "terminate_job" with an attribute of ORTE_NS_INCLUDE_DESCENDANTS will terminate the given jobid AND all jobs that descended from it.
I have tested this capability on a MacBook under rsh, Odin under SLURM, and LANL's Flash (bproc). It worked successfully on non-MPI jobs (both simple and including a spawn), and MPI jobs (again, both simple and with a spawn).
This commit was SVN r12597.
2006-11-14 22:34:59 +03:00
|
|
|
msg->msg_hdr.msg_dst = *ORTE_NAME_INVALID;
|
2005-03-14 23:57:21 +03:00
|
|
|
} else {
|
|
|
|
msg->msg_hdr.msg_dst = *orte_process_info.my_name;
|
|
|
|
}
|
2004-08-03 01:24:00 +04:00
|
|
|
msg->msg_type = MCA_OOB_TCP_POSTED;
|
|
|
|
msg->msg_rc = 0;
|
|
|
|
msg->msg_flags = flags;
|
|
|
|
msg->msg_uiov = iov;
|
|
|
|
msg->msg_ucnt = count;
|
2004-07-15 23:08:54 +04:00
|
|
|
msg->msg_cbfunc = NULL;
|
2004-08-03 01:24:00 +04:00
|
|
|
msg->msg_cbdata = NULL;
|
2004-07-15 23:08:54 +04:00
|
|
|
msg->msg_complete = false;
|
2004-08-03 01:24:00 +04:00
|
|
|
msg->msg_peer = *peer;
|
2004-08-04 18:33:02 +04:00
|
|
|
msg->msg_rwbuf = NULL;
|
|
|
|
msg->msg_rwiov = NULL;
|
2005-07-03 20:22:16 +04:00
|
|
|
opal_list_append(&mca_oob_tcp_component.tcp_msg_post, (opal_list_item_t *) msg);
|
2005-07-04 02:45:48 +04:00
|
|
|
OPAL_THREAD_UNLOCK(&mca_oob_tcp_component.tcp_match_lock);
|
2004-08-03 01:24:00 +04:00
|
|
|
|
|
|
|
/* wait for the receive to complete */
|
|
|
|
mca_oob_tcp_msg_wait(msg, &rc);
|
|
|
|
MCA_OOB_TCP_MSG_RETURN(msg);
|
|
|
|
return rc;
|
2004-07-01 18:49:54 +04:00
|
|
|
}
|
|
|
|
|
2005-10-21 02:06:11 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Process a matched posted receive
|
|
|
|
*
|
|
|
|
* Note that the match lock must be held prior to the call.
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void mca_oob_tcp_msg_matched(mca_oob_tcp_msg_t* msg, mca_oob_tcp_msg_t* match)
|
|
|
|
{
|
|
|
|
int i,rc;
|
|
|
|
if(match->msg_rc < 0) {
|
|
|
|
rc = match->msg_rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* if we are returning an allocated buffer - just take it from the message */
|
|
|
|
else if(msg->msg_flags & MCA_OOB_ALLOC) {
|
|
|
|
|
|
|
|
msg->msg_uiov[0].iov_base = (ompi_iov_base_ptr_t)match->msg_rwbuf;
|
|
|
|
msg->msg_uiov[0].iov_len = match->msg_hdr.msg_size;
|
|
|
|
match->msg_rwbuf = NULL;
|
|
|
|
rc = match->msg_hdr.msg_size;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
/* if we are just doing peek, return bytes without dequeing message */
|
|
|
|
rc = mca_oob_tcp_msg_copy(match, msg->msg_uiov, msg->msg_ucnt);
|
|
|
|
if(rc >= 0 && MCA_OOB_TRUNC & msg->msg_flags) {
|
|
|
|
rc = 0;
|
|
|
|
for(i=1; i<match->msg_rwcnt+1; i++)
|
|
|
|
rc += match->msg_rwiov[i].iov_len;
|
|
|
|
}
|
|
|
|
if(MCA_OOB_PEEK & msg->msg_flags) {
|
|
|
|
OPAL_THREAD_UNLOCK(&mca_oob_tcp_component.tcp_match_lock);
|
|
|
|
msg->msg_cbfunc(rc,
|
|
|
|
&match->msg_peer,
|
|
|
|
msg->msg_uiov,
|
|
|
|
msg->msg_ucnt,
|
|
|
|
match->msg_hdr.msg_tag,
|
|
|
|
msg->msg_cbdata);
|
|
|
|
OPAL_THREAD_LOCK(&mca_oob_tcp_component.tcp_match_lock);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* otherwise remove the match */
|
|
|
|
opal_list_remove_item(&mca_oob_tcp_component.tcp_msg_recv, (opal_list_item_t *) match);
|
|
|
|
|
|
|
|
/* invoke callback */
|
|
|
|
OPAL_THREAD_UNLOCK(&mca_oob_tcp_component.tcp_match_lock);
|
|
|
|
msg->msg_cbfunc(rc,
|
|
|
|
&match->msg_peer,
|
|
|
|
msg->msg_uiov,
|
|
|
|
msg->msg_ucnt,
|
|
|
|
match->msg_hdr.msg_tag,
|
|
|
|
msg->msg_cbdata);
|
|
|
|
OPAL_THREAD_LOCK(&mca_oob_tcp_component.tcp_match_lock);
|
|
|
|
|
|
|
|
/* return match to free list */
|
|
|
|
MCA_OOB_TCP_MSG_RETURN(match);
|
|
|
|
}
|
|
|
|
|
2005-10-20 21:49:13 +04:00
|
|
|
/*
|
|
|
|
* Non-blocking version of mca_oob_recv().
|
|
|
|
*
|
Bring over the update to terminate orteds that are generated by a dynamic spawn such as comm_spawn. This introduces the concept of a job "family" - i.e., jobs that have a parent/child relationship. Comm_spawn'ed jobs have a parent (the one that spawned them). We track that relationship throughout the lineage - i.e., if a comm_spawned job in turn calls comm_spawn, then it has a parent (the one that spawned it) and a "root" job (the original job that started things).
Accordingly, there are new APIs to the name service to support the ability to get a job's parent, root, immediate children, and all its descendants. In addition, the terminate_job, terminate_orted, and signal_job APIs for the PLS have been modified to accept attributes that define the extent of their actions. For example, doing a "terminate_job" with an attribute of ORTE_NS_INCLUDE_DESCENDANTS will terminate the given jobid AND all jobs that descended from it.
I have tested this capability on a MacBook under rsh, Odin under SLURM, and LANL's Flash (bproc). It worked successfully on non-MPI jobs (both simple and including a spawn), and MPI jobs (again, both simple and with a spawn).
This commit was SVN r12597.
2006-11-14 22:34:59 +03:00
|
|
|
* @param peer (IN) Opaque name of peer process or ORTE_NAME_WILDCARD for wildcard receive.
|
2005-10-20 21:49:13 +04:00
|
|
|
* @param msg (IN) Array of iovecs describing user buffers and lengths.
|
|
|
|
* @param count (IN) Number of elements in iovec array.
|
|
|
|
* @param tag (IN) User supplied tag for matching send/recv.
|
|
|
|
* @param flags (IN) May be MCA_OOB_PEEK to return up to size bytes of msg w/out removing it from the queue,
|
|
|
|
* @param cbfunc (IN) Callback function on recv completion.
|
|
|
|
* @param cbdata (IN) User data that is passed to callback function.
|
|
|
|
* @return OMPI error code (<0) on error.
|
2004-07-01 18:49:54 +04:00
|
|
|
*/
|
2005-10-20 21:49:13 +04:00
|
|
|
int mca_oob_tcp_recv_nb(
|
|
|
|
orte_process_name_t* peer,
|
|
|
|
struct iovec* iov,
|
|
|
|
int count,
|
|
|
|
int tag,
|
|
|
|
int flags,
|
|
|
|
mca_oob_callback_fn_t cbfunc,
|
|
|
|
void* cbdata)
|
2004-07-01 18:49:54 +04:00
|
|
|
{
|
2005-10-20 21:49:13 +04:00
|
|
|
mca_oob_tcp_msg_t *msg;
|
2005-10-21 02:06:11 +04:00
|
|
|
mca_oob_tcp_msg_t *match;
|
2005-10-20 21:49:13 +04:00
|
|
|
int i, rc, size = 0;
|
2004-08-03 01:24:00 +04:00
|
|
|
|
2005-10-21 02:06:11 +04:00
|
|
|
/* validate params */
|
|
|
|
if(NULL == iov || 0 == count) {
|
2006-02-12 04:33:29 +03:00
|
|
|
return ORTE_ERR_BAD_PARAM;
|
2004-07-15 23:08:54 +04:00
|
|
|
}
|
2004-08-03 01:24:00 +04:00
|
|
|
|
2005-10-21 02:06:11 +04:00
|
|
|
/* allocate/initialize the posted receive */
|
2004-08-03 01:24:00 +04:00
|
|
|
MCA_OOB_TCP_MSG_ALLOC(msg, rc);
|
2004-07-15 23:08:54 +04:00
|
|
|
if(NULL == msg) {
|
2005-10-20 21:49:13 +04:00
|
|
|
OPAL_THREAD_UNLOCK(&mca_oob_tcp_component.tcp_match_lock);
|
2004-08-03 01:24:00 +04:00
|
|
|
return rc;
|
2004-07-15 23:08:54 +04:00
|
|
|
}
|
2004-08-03 01:24:00 +04:00
|
|
|
|
|
|
|
/* determine overall size of user supplied buffer */
|
|
|
|
for(i = 0; i < count; i++) {
|
2005-10-20 21:49:13 +04:00
|
|
|
size += iov[i].iov_len;
|
2004-08-03 01:24:00 +04:00
|
|
|
}
|
|
|
|
|
2004-09-02 03:07:40 +04:00
|
|
|
/* fill in the header */
|
Bring over the update to terminate orteds that are generated by a dynamic spawn such as comm_spawn. This introduces the concept of a job "family" - i.e., jobs that have a parent/child relationship. Comm_spawn'ed jobs have a parent (the one that spawned them). We track that relationship throughout the lineage - i.e., if a comm_spawned job in turn calls comm_spawn, then it has a parent (the one that spawned it) and a "root" job (the original job that started things).
Accordingly, there are new APIs to the name service to support the ability to get a job's parent, root, immediate children, and all its descendants. In addition, the terminate_job, terminate_orted, and signal_job APIs for the PLS have been modified to accept attributes that define the extent of their actions. For example, doing a "terminate_job" with an attribute of ORTE_NS_INCLUDE_DESCENDANTS will terminate the given jobid AND all jobs that descended from it.
I have tested this capability on a MacBook under rsh, Odin under SLURM, and LANL's Flash (bproc). It worked successfully on non-MPI jobs (both simple and including a spawn), and MPI jobs (again, both simple and with a spawn).
This commit was SVN r12597.
2006-11-14 22:34:59 +03:00
|
|
|
if (NULL == orte_process_info.my_name) {
|
|
|
|
msg->msg_hdr.msg_src = *ORTE_NAME_INVALID;
|
|
|
|
} else {
|
|
|
|
msg->msg_hdr.msg_src = *orte_process_info.my_name;
|
|
|
|
}
|
2004-09-02 03:07:40 +04:00
|
|
|
msg->msg_hdr.msg_dst = *peer;
|
2005-10-20 21:49:13 +04:00
|
|
|
msg->msg_hdr.msg_size = size;
|
2004-09-02 03:07:40 +04:00
|
|
|
msg->msg_hdr.msg_tag = tag;
|
2004-08-03 01:24:00 +04:00
|
|
|
msg->msg_type = MCA_OOB_TCP_POSTED;
|
|
|
|
msg->msg_rc = 0;
|
|
|
|
msg->msg_flags = flags;
|
|
|
|
msg->msg_uiov = iov;
|
|
|
|
msg->msg_ucnt = count;
|
2004-07-15 23:08:54 +04:00
|
|
|
msg->msg_cbfunc = cbfunc;
|
|
|
|
msg->msg_cbdata = cbdata;
|
|
|
|
msg->msg_complete = false;
|
2004-08-03 01:24:00 +04:00
|
|
|
msg->msg_peer = *peer;
|
2004-08-04 18:33:02 +04:00
|
|
|
msg->msg_rwbuf = NULL;
|
|
|
|
msg->msg_rwiov = NULL;
|
2005-10-21 02:06:11 +04:00
|
|
|
|
|
|
|
/* acquire the match lock */
|
|
|
|
OPAL_THREAD_LOCK(&mca_oob_tcp_component.tcp_match_lock);
|
|
|
|
if(flags & MCA_OOB_PERSISTENT) {
|
|
|
|
|
|
|
|
opal_list_append(&mca_oob_tcp_component.tcp_msg_post, (opal_list_item_t *) msg);
|
|
|
|
while(NULL != (match = mca_oob_tcp_msg_match_recv(peer,tag))) {
|
|
|
|
mca_oob_tcp_msg_matched(msg, match);
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
/* check to see if a matching receive is on the list */
|
|
|
|
match = mca_oob_tcp_msg_match_recv(peer, tag);
|
|
|
|
if(NULL != match) {
|
|
|
|
mca_oob_tcp_msg_matched(msg, match);
|
|
|
|
MCA_OOB_TCP_MSG_RETURN(msg);
|
|
|
|
} else {
|
|
|
|
opal_list_append(&mca_oob_tcp_component.tcp_msg_post, (opal_list_item_t *) msg);
|
|
|
|
}
|
|
|
|
}
|
2005-10-20 21:49:13 +04:00
|
|
|
OPAL_THREAD_UNLOCK(&mca_oob_tcp_component.tcp_match_lock);
|
2004-08-03 01:24:00 +04:00
|
|
|
return 0;
|
2004-07-01 18:49:54 +04:00
|
|
|
}
|
|
|
|
|
2004-09-30 19:09:29 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Cancel non-blocking recv.
|
|
|
|
*
|
Bring over the update to terminate orteds that are generated by a dynamic spawn such as comm_spawn. This introduces the concept of a job "family" - i.e., jobs that have a parent/child relationship. Comm_spawn'ed jobs have a parent (the one that spawned them). We track that relationship throughout the lineage - i.e., if a comm_spawned job in turn calls comm_spawn, then it has a parent (the one that spawned it) and a "root" job (the original job that started things).
Accordingly, there are new APIs to the name service to support the ability to get a job's parent, root, immediate children, and all its descendants. In addition, the terminate_job, terminate_orted, and signal_job APIs for the PLS have been modified to accept attributes that define the extent of their actions. For example, doing a "terminate_job" with an attribute of ORTE_NS_INCLUDE_DESCENDANTS will terminate the given jobid AND all jobs that descended from it.
I have tested this capability on a MacBook under rsh, Odin under SLURM, and LANL's Flash (bproc). It worked successfully on non-MPI jobs (both simple and including a spawn), and MPI jobs (again, both simple and with a spawn).
This commit was SVN r12597.
2006-11-14 22:34:59 +03:00
|
|
|
* @param peer (IN) Opaque name of peer process or ORTE_NAME_WILDCARD for wildcard receive.
|
2004-09-30 19:09:29 +04:00
|
|
|
* @param tag (IN) User supplied tag for matching send/recv.
|
|
|
|
* @return OMPI error code (<0) on error or number of bytes actually received.
|
|
|
|
*/
|
|
|
|
|
|
|
|
int mca_oob_tcp_recv_cancel(
|
2005-03-14 23:57:21 +03:00
|
|
|
orte_process_name_t* name,
|
2004-09-30 19:09:29 +04:00
|
|
|
int tag)
|
|
|
|
{
|
Bring over the update to terminate orteds that are generated by a dynamic spawn such as comm_spawn. This introduces the concept of a job "family" - i.e., jobs that have a parent/child relationship. Comm_spawn'ed jobs have a parent (the one that spawned them). We track that relationship throughout the lineage - i.e., if a comm_spawned job in turn calls comm_spawn, then it has a parent (the one that spawned it) and a "root" job (the original job that started things).
Accordingly, there are new APIs to the name service to support the ability to get a job's parent, root, immediate children, and all its descendants. In addition, the terminate_job, terminate_orted, and signal_job APIs for the PLS have been modified to accept attributes that define the extent of their actions. For example, doing a "terminate_job" with an attribute of ORTE_NS_INCLUDE_DESCENDANTS will terminate the given jobid AND all jobs that descended from it.
I have tested this capability on a MacBook under rsh, Odin under SLURM, and LANL's Flash (bproc). It worked successfully on non-MPI jobs (both simple and including a spawn), and MPI jobs (again, both simple and with a spawn).
This commit was SVN r12597.
2006-11-14 22:34:59 +03:00
|
|
|
int matched = 0;
|
2005-07-03 20:22:16 +04:00
|
|
|
opal_list_item_t *item, *next;
|
2004-09-30 19:09:29 +04:00
|
|
|
|
|
|
|
/* wait for any previously matched messages to be processed */
|
2005-07-04 02:45:48 +04:00
|
|
|
OPAL_THREAD_LOCK(&mca_oob_tcp_component.tcp_match_lock);
|
2005-05-19 20:16:19 +04:00
|
|
|
#if OMPI_ENABLE_PROGRESS_THREADS
|
2005-09-12 00:04:40 +04:00
|
|
|
if(opal_event_progress_thread() == false) {
|
2005-05-19 20:16:19 +04:00
|
|
|
while(mca_oob_tcp_component.tcp_match_count) {
|
2005-07-04 02:45:48 +04:00
|
|
|
opal_condition_wait(
|
2005-05-19 20:16:19 +04:00
|
|
|
&mca_oob_tcp_component.tcp_match_cond,
|
|
|
|
&mca_oob_tcp_component.tcp_match_lock);
|
|
|
|
}
|
2004-09-30 19:09:29 +04:00
|
|
|
}
|
2005-05-19 20:16:19 +04:00
|
|
|
#endif
|
2004-09-30 19:09:29 +04:00
|
|
|
|
|
|
|
/* remove any matching posted receives */
|
2005-07-03 20:22:16 +04:00
|
|
|
for(item = opal_list_get_first(&mca_oob_tcp_component.tcp_msg_post);
|
|
|
|
item != opal_list_get_end(&mca_oob_tcp_component.tcp_msg_post);
|
2004-09-30 19:09:29 +04:00
|
|
|
item = next) {
|
|
|
|
mca_oob_tcp_msg_t* msg = (mca_oob_tcp_msg_t*)item;
|
2005-07-03 20:22:16 +04:00
|
|
|
next = opal_list_get_next(item);
|
2004-09-30 19:09:29 +04:00
|
|
|
|
Bring over the update to terminate orteds that are generated by a dynamic spawn such as comm_spawn. This introduces the concept of a job "family" - i.e., jobs that have a parent/child relationship. Comm_spawn'ed jobs have a parent (the one that spawned them). We track that relationship throughout the lineage - i.e., if a comm_spawned job in turn calls comm_spawn, then it has a parent (the one that spawned it) and a "root" job (the original job that started things).
Accordingly, there are new APIs to the name service to support the ability to get a job's parent, root, immediate children, and all its descendants. In addition, the terminate_job, terminate_orted, and signal_job APIs for the PLS have been modified to accept attributes that define the extent of their actions. For example, doing a "terminate_job" with an attribute of ORTE_NS_INCLUDE_DESCENDANTS will terminate the given jobid AND all jobs that descended from it.
I have tested this capability on a MacBook under rsh, Odin under SLURM, and LANL's Flash (bproc). It worked successfully on non-MPI jobs (both simple and including a spawn), and MPI jobs (again, both simple and with a spawn).
This commit was SVN r12597.
2006-11-14 22:34:59 +03:00
|
|
|
if (ORTE_EQUAL == orte_dss.compare(name, &msg->msg_peer, ORTE_NAME)) {
|
2005-03-14 23:57:21 +03:00
|
|
|
if (msg->msg_hdr.msg_tag == tag) {
|
2006-07-18 01:51:50 +04:00
|
|
|
opal_list_remove_item(&mca_oob_tcp_component.tcp_msg_post, &msg->super.super);
|
2004-09-30 19:09:29 +04:00
|
|
|
MCA_OOB_TCP_MSG_RETURN(msg);
|
|
|
|
matched++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2005-07-04 02:45:48 +04:00
|
|
|
OPAL_THREAD_UNLOCK(&mca_oob_tcp_component.tcp_match_lock);
|
2006-02-12 04:33:29 +03:00
|
|
|
return (matched > 0) ? ORTE_SUCCESS : ORTE_ERR_NOT_FOUND;
|
2004-09-30 19:09:29 +04:00
|
|
|
}
|
|
|
|
|