2004-08-26 07:56:45 +00:00
|
|
|
/*
|
2005-11-05 19:57:48 +00: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.
|
2006-02-07 03:32:36 +00:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2004-11-28 20:09:25 +00:00
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 12:43:37 +00:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 01:38:40 +00:00
|
|
|
* $COPYRIGHT$
|
2006-02-07 03:32:36 +00:00
|
|
|
*
|
2004-11-22 01:38:40 +00:00
|
|
|
* Additional copyrights may follow
|
2006-02-07 03:32:36 +00:00
|
|
|
*
|
2004-08-26 07:56:45 +00:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte_config.h"
|
|
|
|
#include "orte/orte_constants.h"
|
2005-03-14 20:57:21 +00:00
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte/mca/ns/ns_types.h"
|
2005-03-14 20:57:21 +00:00
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte/dss/dss.h"
|
|
|
|
#include "orte/mca/oob/oob.h"
|
|
|
|
#include "orte/mca/oob/base/base.h"
|
2004-10-22 16:06:05 +00:00
|
|
|
#ifdef HAVE_NETINET_IN_H
|
2004-07-01 14:49:54 +00:00
|
|
|
#include <netinet/in.h>
|
2004-10-22 16:06:05 +00:00
|
|
|
#endif
|
2004-07-01 14:49:54 +00:00
|
|
|
#include <string.h>
|
2004-08-11 21:07:16 +00:00
|
|
|
|
2004-07-01 14:49:54 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Similiar to unix recv(2)
|
|
|
|
*
|
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 19:34:59 +00:00
|
|
|
* @param peer (IN) Opaque name of peer process or ORTE_NAME_WILDCARD for wildcard receive.
|
2004-07-01 14:49:54 +00: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-02 21:24:00 +00:00
|
|
|
* @param tag (IN) User defined tag for matching send/recv.
|
2004-07-15 19:08:54 +00:00
|
|
|
* @param flags (IN) May be MCA_OOB_PEEK to return up to the number of bytes provided in the
|
2004-07-01 14:49:54 +00:00
|
|
|
* iovec array without removing the message from the queue.
|
|
|
|
* @return OMPI error code (<0) on error or number of bytes actually received.
|
|
|
|
*/
|
2005-03-14 20:57:21 +00:00
|
|
|
int mca_oob_recv(orte_process_name_t* peer, struct iovec *msg, int count, int tag, int flags)
|
2004-07-01 14:49:54 +00:00
|
|
|
{
|
2004-08-02 21:24:00 +00:00
|
|
|
return(mca_oob.oob_recv(peer, msg, count, tag, flags));
|
2004-07-01 14:49:54 +00:00
|
|
|
}
|
|
|
|
|
2004-08-11 21:07:16 +00:00
|
|
|
/*
|
|
|
|
* Similiar to unix recv(2)
|
|
|
|
*
|
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 19:34:59 +00:00
|
|
|
* @param peer (IN) Opaque name of peer process or ORTE_NAME_WILDCARD for wildcard receive.
|
2004-08-11 21:07:16 +00:00
|
|
|
* @param buffer (OUT) Buffer that the OOB creates to recv this message...
|
|
|
|
* @param tag (IN) User defined tag for matching send/recv.
|
|
|
|
* iovec array without removing the message from the queue.
|
|
|
|
* @return OMPI error code (<0) on error or number of bytes actually received.
|
|
|
|
*/
|
2005-03-14 20:57:21 +00:00
|
|
|
int mca_oob_recv_packed(orte_process_name_t* peer, orte_buffer_t *buf, int tag)
|
2004-08-11 21:07:16 +00:00
|
|
|
{
|
2004-08-12 22:41:42 +00:00
|
|
|
int rc;
|
|
|
|
struct iovec msg[1];
|
2004-08-13 04:16:33 +00:00
|
|
|
|
2006-02-07 03:32:36 +00:00
|
|
|
/* setup iov */
|
|
|
|
msg[0].iov_base = NULL;
|
|
|
|
msg[0].iov_len = 0;
|
2004-08-11 21:07:16 +00:00
|
|
|
|
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 03:59:06 +00:00
|
|
|
rc = mca_oob.oob_recv(peer, msg, 1, tag, MCA_OOB_ALLOC);
|
|
|
|
if(rc < 0)
|
|
|
|
return rc;
|
2004-08-11 21:07:16 +00:00
|
|
|
|
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 03:59:06 +00:00
|
|
|
/* initialize buffer */
|
2006-02-07 03:32:36 +00:00
|
|
|
return orte_dss.load(buf, msg[0].iov_base, msg[0].iov_len);
|
2004-08-11 21:07:16 +00:00
|
|
|
}
|
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 03:59:06 +00:00
|
|
|
|