2006-08-23 03:32:36 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2007-06-08 22:59:31 +00:00
|
|
|
* Copyright (c) 2007 Cisco, Inc. All rights reserved.
|
2006-08-23 03:32:36 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte_config.h"
|
2008-02-28 01:57:57 +00:00
|
|
|
|
This commit represents a bunch of work on a Mercurial side branch. As
such, the commit message back to the master SVN repository is fairly
long.
= ORTE Job-Level Output Messages =
Add two new interfaces that should be used for all new code throughout
the ORTE and OMPI layers (we already make the search-and-replace on
the existing ORTE / OMPI layers):
* orte_output(): (and corresponding friends ORTE_OUTPUT,
orte_output_verbose, etc.) This function sends the output directly
to the HNP for processing as part of a job-specific output
channel. It supports all the same outputs as opal_output()
(syslog, file, stdout, stderr), but for stdout/stderr, the output
is sent to the HNP for processing and output. More on this below.
* orte_show_help(): This function is a drop-in-replacement for
opal_show_help(), with two differences in functionality:
1. the rendered text help message output is sent to the HNP for
display (rather than outputting directly into the process' stderr
stream)
1. the HNP detects duplicate help messages and does not display them
(so that you don't see the same error message N times, once from
each of your N MPI processes); instead, it counts "new" instances
of the help message and displays a message every ~5 seconds when
there are new ones ("I got X new copies of the help message...")
opal_show_help and opal_output still exist, but they only output in
the current process. The intent for the new orte_* functions is that
they can apply job-level intelligence to the output. As such, we
recommend that all new ORTE and OMPI code use the new orte_*
functions, not thei opal_* functions.
=== New code ===
For ORTE and OMPI programmers, here's what you need to do differently
in new code:
* Do not include opal/util/show_help.h or opal/util/output.h.
Instead, include orte/util/output.h (this one header file has
declarations for both the orte_output() series of functions and
orte_show_help()).
* Effectively s/opal_output/orte_output/gi throughout your code.
Note that orte_output_open() takes a slightly different argument
list (as a way to pass data to the filtering stream -- see below),
so you if explicitly call opal_output_open(), you'll need to
slightly adapt to the new signature of orte_output_open().
* Literally s/opal_show_help/orte_show_help/. The function signature
is identical.
=== Notes ===
* orte_output'ing to stream 0 will do similar to what
opal_output'ing did, so leaving a hard-coded "0" as the first
argument is safe.
* For systems that do not use ORTE's RML or the HNP, the effect of
orte_output_* and orte_show_help will be identical to their opal
counterparts (the additional information passed to
orte_output_open() will be lost!). Indeed, the orte_* functions
simply become trivial wrappers to their opal_* counterparts. Note
that we have not tested this; the code is simple but it is quite
possible that we mucked something up.
= Filter Framework =
Messages sent view the new orte_* functions described above and
messages output via the IOF on the HNP will now optionally be passed
through a new "filter" framework before being output to
stdout/stderr. The "filter" OPAL MCA framework is intended to allow
preprocessing to messages before they are sent to their final
destinations. The first component that was written in the filter
framework was to create an XML stream, segregating all the messages
into different XML tags, etc. This will allow 3rd party tools to read
the stdout/stderr from the HNP and be able to know exactly what each
text message is (e.g., a help message, another OMPI infrastructure
message, stdout from the user process, stderr from the user process,
etc.).
Filtering is not active by default. Filter components must be
specifically requested, such as:
{{{
$ mpirun --mca filter xml ...
}}}
There can only be one filter component active.
= New MCA Parameters =
The new functionality described above introduces two new MCA
parameters:
* '''orte_base_help_aggregate''': Defaults to 1 (true), meaning that
help messages will be aggregated, as described above. If set to 0,
all help messages will be displayed, even if they are duplicates
(i.e., the original behavior).
* '''orte_base_show_output_recursions''': An MCA parameter to help
debug one of the known issues, described below. It is likely that
this MCA parameter will disappear before v1.3 final.
= Known Issues =
* The XML filter component is not complete. The current output from
this component is preliminary and not real XML. A bit more work
needs to be done to configure.m4 search for an appropriate XML
library/link it in/use it at run time.
* There are possible recursion loops in the orte_output() and
orte_show_help() functions -- e.g., if RML send calls orte_output()
or orte_show_help(). We have some ideas how to fix these, but
figured that it was ok to commit before feature freeze with known
issues. The code currently contains sub-optimal workarounds so
that this will not be a problem, but it would be good to actually
solve the problem rather than have hackish workarounds before v1.3 final.
This commit was SVN r18434.
2008-05-13 20:00:55 +00:00
|
|
|
#include "orte/util/output.h"
|
2008-02-28 01:57:57 +00:00
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte/mca/rml/rml.h"
|
2008-02-28 01:57:57 +00:00
|
|
|
#include "orte/runtime/orte_globals.h"
|
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte/mca/iof/base/base.h"
|
|
|
|
#include "orte/mca/iof/base/iof_base_header.h"
|
|
|
|
#include "orte/mca/iof/base/iof_base_endpoint.h"
|
|
|
|
#include "orte/mca/errmgr/errmgr.h"
|
2005-01-12 20:51:34 +00:00
|
|
|
#include "iof_proxy.h"
|
|
|
|
#include "iof_proxy_svc.h"
|
|
|
|
|
|
|
|
|
2005-01-13 15:27:28 +00:00
|
|
|
/*
|
|
|
|
* Local function prototypes.
|
2005-01-12 20:51:34 +00:00
|
|
|
*/
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
static void orte_iof_proxy_svc_msg(
|
2007-06-08 22:59:31 +00:00
|
|
|
const orte_process_name_t* origin,
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_iof_base_msg_header_t* msg,
|
2005-01-12 20:51:34 +00:00
|
|
|
unsigned char* data);
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
static void orte_iof_proxy_svc_ack(
|
2007-06-08 22:59:31 +00:00
|
|
|
const orte_process_name_t* origin,
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_iof_base_msg_header_t* msg);
|
2005-01-12 20:51:34 +00:00
|
|
|
|
|
|
|
|
2005-01-13 15:27:28 +00:00
|
|
|
/*
|
2007-06-08 22:59:31 +00:00
|
|
|
* Send a "publish" request to the svc component
|
2005-01-12 20:51:34 +00:00
|
|
|
*/
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_iof_proxy_svc_publish(
|
|
|
|
const orte_process_name_t* name,
|
2005-01-12 20:51:34 +00:00
|
|
|
int tag)
|
|
|
|
{
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_iof_base_header_t hdr;
|
2005-01-12 20:51:34 +00:00
|
|
|
struct iovec iov;
|
|
|
|
int rc;
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
hdr.hdr_common.hdr_type = ORTE_IOF_BASE_HDR_PUB;
|
2005-01-12 20:51:34 +00:00
|
|
|
hdr.hdr_common.hdr_status = 0;
|
|
|
|
hdr.hdr_pub.pub_name = *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 19:34:59 +00:00
|
|
|
hdr.hdr_pub.pub_proxy = *ORTE_PROC_MY_NAME;
|
2005-03-14 20:57:21 +00:00
|
|
|
hdr.hdr_pub.pub_mask = ORTE_NS_CMP_ALL;
|
2005-01-12 20:51:34 +00:00
|
|
|
hdr.hdr_pub.pub_tag = tag;
|
2007-06-08 22:59:31 +00:00
|
|
|
ORTE_IOF_BASE_HDR_PUB_HTON(hdr.hdr_pub);
|
2005-01-12 20:51:34 +00:00
|
|
|
|
2006-08-23 03:32:36 +00:00
|
|
|
iov.iov_base = (IOVBASE_TYPE*)&hdr;
|
2005-01-12 20:51:34 +00:00
|
|
|
iov.iov_len = sizeof(hdr);
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
rc = orte_rml.send(
|
2008-02-28 01:57:57 +00:00
|
|
|
&orte_iof_base.iof_service,
|
2005-01-12 20:51:34 +00:00
|
|
|
&iov,
|
|
|
|
1,
|
2005-03-14 20:57:21 +00:00
|
|
|
ORTE_RML_TAG_IOF_SVC,
|
2005-01-12 20:51:34 +00:00
|
|
|
0);
|
|
|
|
if(rc < 0) {
|
2005-03-29 19:40:38 +00:00
|
|
|
ORTE_ERROR_LOG(rc);
|
2005-01-12 20:51:34 +00:00
|
|
|
return rc;
|
|
|
|
}
|
2006-02-12 01:33:29 +00:00
|
|
|
return ORTE_SUCCESS;
|
2005-01-12 20:51:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-01-13 15:27:28 +00:00
|
|
|
/*
|
2007-06-08 22:59:31 +00:00
|
|
|
* Send an "unpublish" request to the svc component
|
2005-01-12 20:51:34 +00:00
|
|
|
*/
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_iof_proxy_svc_unpublish(
|
|
|
|
const orte_process_name_t* name,
|
|
|
|
orte_ns_cmp_bitmask_t mask,
|
2005-01-12 20:51:34 +00:00
|
|
|
int tag)
|
|
|
|
{
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_iof_base_header_t hdr;
|
2005-01-12 20:51:34 +00:00
|
|
|
struct iovec iov;
|
|
|
|
int rc;
|
|
|
|
|
2007-06-08 22:59:31 +00:00
|
|
|
hdr.hdr_common.hdr_type = ORTE_IOF_BASE_HDR_UNPUB;
|
2005-01-12 20:51:34 +00:00
|
|
|
hdr.hdr_common.hdr_status = 0;
|
|
|
|
hdr.hdr_pub.pub_name = *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 19:34:59 +00:00
|
|
|
hdr.hdr_pub.pub_proxy = *ORTE_PROC_MY_NAME;
|
2005-01-12 20:51:34 +00:00
|
|
|
hdr.hdr_pub.pub_mask = mask;
|
|
|
|
hdr.hdr_pub.pub_tag = tag;
|
2007-06-08 22:59:31 +00:00
|
|
|
ORTE_IOF_BASE_HDR_PUB_HTON(hdr.hdr_pub);
|
2005-01-12 20:51:34 +00:00
|
|
|
|
2006-08-23 03:32:36 +00:00
|
|
|
iov.iov_base = (IOVBASE_TYPE*)&hdr;
|
2005-01-12 20:51:34 +00:00
|
|
|
iov.iov_len = sizeof(hdr);
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
rc = orte_rml.send(
|
2008-02-28 01:57:57 +00:00
|
|
|
&orte_iof_base.iof_service,
|
2005-01-12 20:51:34 +00:00
|
|
|
&iov,
|
|
|
|
1,
|
2005-03-14 20:57:21 +00:00
|
|
|
ORTE_RML_TAG_IOF_SVC,
|
2005-01-12 20:51:34 +00:00
|
|
|
0);
|
|
|
|
if(rc < 0) {
|
2005-03-29 19:40:38 +00:00
|
|
|
ORTE_ERROR_LOG(rc);
|
2005-01-12 20:51:34 +00:00
|
|
|
return rc;
|
|
|
|
}
|
2006-02-12 01:33:29 +00:00
|
|
|
return ORTE_SUCCESS;
|
2005-01-12 20:51:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-01-13 15:27:28 +00:00
|
|
|
/*
|
2007-06-08 22:59:31 +00:00
|
|
|
* Send a "subscribe" request to the svc component
|
2005-01-12 20:51:34 +00:00
|
|
|
*/
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_iof_proxy_svc_subscribe(
|
2007-06-08 22:59:31 +00:00
|
|
|
const orte_process_name_t* origin_name,
|
|
|
|
orte_ns_cmp_bitmask_t origin_mask,
|
|
|
|
int origin_tag,
|
|
|
|
const orte_process_name_t* target_name,
|
|
|
|
orte_ns_cmp_bitmask_t target_mask,
|
|
|
|
int target_tag
|
2005-01-12 20:51:34 +00:00
|
|
|
)
|
|
|
|
{
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_iof_base_header_t hdr;
|
2005-01-12 20:51:34 +00:00
|
|
|
struct iovec iov;
|
|
|
|
int rc;
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
hdr.hdr_common.hdr_type = ORTE_IOF_BASE_HDR_SUB;
|
2005-01-12 20:51:34 +00:00
|
|
|
hdr.hdr_common.hdr_status = 0;
|
2007-06-08 22:59:31 +00:00
|
|
|
hdr.hdr_sub.origin_name = *origin_name;
|
|
|
|
hdr.hdr_sub.origin_mask = origin_mask;
|
|
|
|
hdr.hdr_sub.origin_tag = origin_tag;
|
|
|
|
hdr.hdr_sub.target_name = *target_name;
|
|
|
|
hdr.hdr_sub.target_mask = target_mask;
|
|
|
|
hdr.hdr_sub.target_tag = target_tag;
|
|
|
|
ORTE_IOF_BASE_HDR_SUB_HTON(hdr.hdr_sub);
|
2005-01-12 20:51:34 +00:00
|
|
|
|
2006-08-23 03:32:36 +00:00
|
|
|
iov.iov_base = (IOVBASE_TYPE*)&hdr;
|
2005-01-12 20:51:34 +00:00
|
|
|
iov.iov_len = sizeof(hdr);
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
rc = orte_rml.send(
|
2008-02-28 01:57:57 +00:00
|
|
|
&orte_iof_base.iof_service,
|
2005-01-12 20:51:34 +00:00
|
|
|
&iov,
|
|
|
|
1,
|
2005-03-14 20:57:21 +00:00
|
|
|
ORTE_RML_TAG_IOF_SVC,
|
2005-01-12 20:51:34 +00:00
|
|
|
0);
|
|
|
|
if(rc < 0) {
|
2005-03-29 19:40:38 +00:00
|
|
|
ORTE_ERROR_LOG(rc);
|
2005-01-12 20:51:34 +00:00
|
|
|
return rc;
|
|
|
|
}
|
2006-02-12 01:33:29 +00:00
|
|
|
return ORTE_SUCCESS;
|
2005-01-12 20:51:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-01-13 15:27:28 +00:00
|
|
|
/*
|
2007-06-08 22:59:31 +00:00
|
|
|
* Send an "unsubscribe" request to the svc component
|
2005-01-13 15:27:28 +00:00
|
|
|
*/
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_iof_proxy_svc_unsubscribe(
|
2007-06-08 22:59:31 +00:00
|
|
|
const orte_process_name_t* origin_name,
|
|
|
|
orte_ns_cmp_bitmask_t origin_mask,
|
|
|
|
int origin_tag,
|
|
|
|
const orte_process_name_t* target_name,
|
|
|
|
orte_ns_cmp_bitmask_t target_mask,
|
|
|
|
int target_tag
|
2005-01-12 20:51:34 +00:00
|
|
|
)
|
|
|
|
{
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_iof_base_header_t hdr;
|
2005-01-12 20:51:34 +00:00
|
|
|
struct iovec iov;
|
|
|
|
int rc;
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
hdr.hdr_common.hdr_type = ORTE_IOF_BASE_HDR_UNSUB;
|
2006-08-23 03:32:36 +00:00
|
|
|
hdr.hdr_common.hdr_reserve = (uint8_t)0;
|
|
|
|
hdr.hdr_common.hdr_status = (int16_t)0;
|
2007-06-08 22:59:31 +00:00
|
|
|
hdr.hdr_sub.origin_name = *origin_name;
|
|
|
|
hdr.hdr_sub.origin_mask = origin_mask;
|
|
|
|
hdr.hdr_sub.origin_tag = origin_tag;
|
|
|
|
hdr.hdr_sub.target_name = *target_name;
|
|
|
|
hdr.hdr_sub.target_mask = target_mask;
|
|
|
|
hdr.hdr_sub.target_tag = target_tag;
|
|
|
|
ORTE_IOF_BASE_HDR_SUB_HTON(hdr.hdr_sub);
|
2005-01-12 20:51:34 +00:00
|
|
|
|
2006-08-23 03:32:36 +00:00
|
|
|
iov.iov_base = (IOVBASE_TYPE*)&hdr;
|
2005-01-12 20:51:34 +00:00
|
|
|
iov.iov_len = sizeof(hdr);
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
rc = orte_rml.send(
|
2008-02-28 01:57:57 +00:00
|
|
|
&orte_iof_base.iof_service,
|
2005-01-12 20:51:34 +00:00
|
|
|
&iov,
|
|
|
|
1,
|
2005-03-14 20:57:21 +00:00
|
|
|
ORTE_RML_TAG_IOF_SVC,
|
2005-01-12 20:51:34 +00:00
|
|
|
0);
|
|
|
|
if(rc < 0) {
|
2005-03-29 19:40:38 +00:00
|
|
|
ORTE_ERROR_LOG(rc);
|
2005-01-12 20:51:34 +00:00
|
|
|
return rc;
|
|
|
|
}
|
2006-02-12 01:33:29 +00:00
|
|
|
return ORTE_SUCCESS;
|
2005-01-12 20:51:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-01-13 15:27:28 +00:00
|
|
|
/*
|
2007-06-08 22:59:31 +00:00
|
|
|
* Receive messages via the RML from the svc component.
|
2005-01-13 15:27:28 +00:00
|
|
|
*/
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
void orte_iof_proxy_svc_recv(
|
2005-01-12 20:51:34 +00:00
|
|
|
int status,
|
2007-06-08 22:59:31 +00:00
|
|
|
orte_process_name_t* origin,
|
2005-01-12 20:51:34 +00:00
|
|
|
struct iovec* msg,
|
|
|
|
int count,
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_rml_tag_t tag,
|
2005-01-12 20:51:34 +00:00
|
|
|
void* cbdata)
|
|
|
|
{
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_iof_base_header_t* hdr = (orte_iof_base_header_t*)msg->iov_base;
|
2005-03-29 19:40:38 +00:00
|
|
|
if(NULL == msg->iov_base) {
|
This commit represents a bunch of work on a Mercurial side branch. As
such, the commit message back to the master SVN repository is fairly
long.
= ORTE Job-Level Output Messages =
Add two new interfaces that should be used for all new code throughout
the ORTE and OMPI layers (we already make the search-and-replace on
the existing ORTE / OMPI layers):
* orte_output(): (and corresponding friends ORTE_OUTPUT,
orte_output_verbose, etc.) This function sends the output directly
to the HNP for processing as part of a job-specific output
channel. It supports all the same outputs as opal_output()
(syslog, file, stdout, stderr), but for stdout/stderr, the output
is sent to the HNP for processing and output. More on this below.
* orte_show_help(): This function is a drop-in-replacement for
opal_show_help(), with two differences in functionality:
1. the rendered text help message output is sent to the HNP for
display (rather than outputting directly into the process' stderr
stream)
1. the HNP detects duplicate help messages and does not display them
(so that you don't see the same error message N times, once from
each of your N MPI processes); instead, it counts "new" instances
of the help message and displays a message every ~5 seconds when
there are new ones ("I got X new copies of the help message...")
opal_show_help and opal_output still exist, but they only output in
the current process. The intent for the new orte_* functions is that
they can apply job-level intelligence to the output. As such, we
recommend that all new ORTE and OMPI code use the new orte_*
functions, not thei opal_* functions.
=== New code ===
For ORTE and OMPI programmers, here's what you need to do differently
in new code:
* Do not include opal/util/show_help.h or opal/util/output.h.
Instead, include orte/util/output.h (this one header file has
declarations for both the orte_output() series of functions and
orte_show_help()).
* Effectively s/opal_output/orte_output/gi throughout your code.
Note that orte_output_open() takes a slightly different argument
list (as a way to pass data to the filtering stream -- see below),
so you if explicitly call opal_output_open(), you'll need to
slightly adapt to the new signature of orte_output_open().
* Literally s/opal_show_help/orte_show_help/. The function signature
is identical.
=== Notes ===
* orte_output'ing to stream 0 will do similar to what
opal_output'ing did, so leaving a hard-coded "0" as the first
argument is safe.
* For systems that do not use ORTE's RML or the HNP, the effect of
orte_output_* and orte_show_help will be identical to their opal
counterparts (the additional information passed to
orte_output_open() will be lost!). Indeed, the orte_* functions
simply become trivial wrappers to their opal_* counterparts. Note
that we have not tested this; the code is simple but it is quite
possible that we mucked something up.
= Filter Framework =
Messages sent view the new orte_* functions described above and
messages output via the IOF on the HNP will now optionally be passed
through a new "filter" framework before being output to
stdout/stderr. The "filter" OPAL MCA framework is intended to allow
preprocessing to messages before they are sent to their final
destinations. The first component that was written in the filter
framework was to create an XML stream, segregating all the messages
into different XML tags, etc. This will allow 3rd party tools to read
the stdout/stderr from the HNP and be able to know exactly what each
text message is (e.g., a help message, another OMPI infrastructure
message, stdout from the user process, stderr from the user process,
etc.).
Filtering is not active by default. Filter components must be
specifically requested, such as:
{{{
$ mpirun --mca filter xml ...
}}}
There can only be one filter component active.
= New MCA Parameters =
The new functionality described above introduces two new MCA
parameters:
* '''orte_base_help_aggregate''': Defaults to 1 (true), meaning that
help messages will be aggregated, as described above. If set to 0,
all help messages will be displayed, even if they are duplicates
(i.e., the original behavior).
* '''orte_base_show_output_recursions''': An MCA parameter to help
debug one of the known issues, described below. It is likely that
this MCA parameter will disappear before v1.3 final.
= Known Issues =
* The XML filter component is not complete. The current output from
this component is preliminary and not real XML. A bit more work
needs to be done to configure.m4 search for an appropriate XML
library/link it in/use it at run time.
* There are possible recursion loops in the orte_output() and
orte_show_help() functions -- e.g., if RML send calls orte_output()
or orte_show_help(). We have some ideas how to fix these, but
figured that it was ok to commit before feature freeze with known
issues. The code currently contains sub-optimal workarounds so
that this will not be a problem, but it would be good to actually
solve the problem rather than have hackish workarounds before v1.3 final.
This commit was SVN r18434.
2008-05-13 20:00:55 +00:00
|
|
|
orte_output(orte_iof_base.iof_output,
|
2007-06-08 22:59:31 +00:00
|
|
|
"orte_iof_proxy_svc_recv: invalid message\n");
|
2005-03-29 19:40:38 +00:00
|
|
|
return;
|
|
|
|
}
|
2005-01-12 20:51:34 +00:00
|
|
|
|
2007-06-08 22:59:31 +00:00
|
|
|
/* We only receive 2 types of messages from the svc component:
|
|
|
|
|
|
|
|
- Messages: containing forwarded data intended to be consumed
|
|
|
|
by endpoints in this process either representing local fd's
|
|
|
|
or pipes to proxied processes (e.g., orted's fronting ORTE
|
|
|
|
processes)
|
|
|
|
|
|
|
|
- ACKs: acknowledging data sent from this process to the svc
|
|
|
|
component (which may have been forwarded on to other
|
|
|
|
processes).
|
|
|
|
*/
|
|
|
|
|
2005-01-12 20:51:34 +00:00
|
|
|
switch(hdr->hdr_common.hdr_type) {
|
2005-03-14 20:57:21 +00:00
|
|
|
case ORTE_IOF_BASE_HDR_MSG:
|
|
|
|
ORTE_IOF_BASE_HDR_MSG_NTOH(hdr->hdr_msg);
|
2007-06-08 22:59:31 +00:00
|
|
|
orte_iof_proxy_svc_msg(origin,&hdr->hdr_msg,(unsigned char*)(hdr+1));
|
2005-01-12 20:51:34 +00:00
|
|
|
break;
|
2005-03-14 20:57:21 +00:00
|
|
|
case ORTE_IOF_BASE_HDR_ACK:
|
|
|
|
ORTE_IOF_BASE_HDR_MSG_NTOH(hdr->hdr_msg);
|
2007-06-08 22:59:31 +00:00
|
|
|
orte_iof_proxy_svc_ack(origin,&hdr->hdr_msg);
|
2005-01-12 20:51:34 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
free(hdr);
|
2007-06-08 22:59:31 +00:00
|
|
|
|
|
|
|
/* reset the data in the RML receive */
|
2005-01-12 20:51:34 +00:00
|
|
|
mca_iof_proxy_component.proxy_iov[0].iov_base = NULL;
|
|
|
|
mca_iof_proxy_component.proxy_iov[0].iov_len = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-01-13 15:27:28 +00:00
|
|
|
/*
|
2007-06-08 22:59:31 +00:00
|
|
|
* The svc component has sent data to us that matches a tag that we
|
|
|
|
* must have previously published. Forward the data to the
|
|
|
|
* corresponding endpoint.
|
2005-01-13 15:27:28 +00:00
|
|
|
*/
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
static void orte_iof_proxy_svc_msg(
|
2007-06-08 22:59:31 +00:00
|
|
|
const orte_process_name_t* origin,
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_iof_base_msg_header_t* msg,
|
2005-01-12 20:51:34 +00:00
|
|
|
unsigned char* data)
|
|
|
|
{
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_iof_base_endpoint_t* endpoint;
|
2007-06-08 22:59:31 +00:00
|
|
|
|
|
|
|
/* Look for the endpoint corresponding to the tag in the message.
|
|
|
|
If we don't find the endpoint, this means that we have already
|
|
|
|
unpublished the endpoint and this message must have already
|
|
|
|
been enroute to us when we unpublished. So just discard it. */
|
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
|
|
|
endpoint = orte_iof_base_endpoint_match(ORTE_NAME_WILDCARD, ORTE_NS_CMP_NONE, msg->msg_tag);
|
2007-06-08 22:59:31 +00:00
|
|
|
if (NULL != endpoint) {
|
|
|
|
orte_iof_base_endpoint_forward(endpoint,origin,msg,data);
|
|
|
|
/* RELEASE the endpoint because endpoint_match() RETAINed it */
|
2005-01-12 20:51:34 +00:00
|
|
|
OBJ_RELEASE(endpoint);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-06-08 22:59:31 +00:00
|
|
|
/*
|
|
|
|
* The svc component has sent an ACK to us that matches a tag that we
|
|
|
|
* must have previously published. Forward the ACK to the
|
|
|
|
* corresponding endpoint.
|
2005-01-12 20:51:34 +00:00
|
|
|
*/
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
static void orte_iof_proxy_svc_ack(
|
2007-06-08 22:59:31 +00:00
|
|
|
const orte_process_name_t* origin,
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_iof_base_msg_header_t* msg)
|
2005-01-12 20:51:34 +00:00
|
|
|
{
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_iof_base_endpoint_t* endpoint;
|
2007-06-08 22:59:31 +00:00
|
|
|
/* Look for the endpoint corresponding to the tag in the ACK. If
|
|
|
|
we don't find the endpoint, this means that we have already
|
|
|
|
unpublished the endpoint and this ACK must have already been
|
|
|
|
enroute to us when we unpublished. So just discard it. */
|
|
|
|
endpoint = orte_iof_base_endpoint_match(&msg->msg_origin, ORTE_NS_CMP_ALL, msg->msg_tag);
|
2005-01-12 20:51:34 +00:00
|
|
|
if(endpoint != NULL) {
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_iof_base_endpoint_ack(endpoint,msg->msg_seq + msg->msg_len);
|
2007-06-08 22:59:31 +00:00
|
|
|
/* RELEASE the endpoint because endpoint_match() RETAINed it */
|
2005-01-12 20:51:34 +00:00
|
|
|
OBJ_RELEASE(endpoint);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|