Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2011-06-24 00:38:02 +04:00
|
|
|
* Copyright (c) 2004-2011 The University of Tennessee and The University
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2015-06-24 06:59:57 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
|
2009-01-11 05:30:00 +03:00
|
|
|
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
2013-02-13 05:53:12 +04:00
|
|
|
* Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights
|
2015-06-24 06:59:57 +03:00
|
|
|
* reserved.
|
2016-12-20 09:23:12 +03:00
|
|
|
* Copyright (c) 2014-2017 Research Organization for Information Science
|
2014-11-12 04:00:42 +03:00
|
|
|
* and Technology (RIST). All rights reserved.
|
2017-01-05 20:46:05 +03:00
|
|
|
* Copyright (c) 2016-2017 Intel, Inc. All rights reserved.
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
* $COPYRIGHT$
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
* Additional copyrights may follow
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
#include "orte_config.h"
|
2009-02-14 05:26:12 +03:00
|
|
|
#include "opal/util/output.h"
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
#include "orte/constants.h"
|
|
|
|
|
|
|
|
#include <errno.h>
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif /* HAVE_UNISTD_H */
|
|
|
|
#include <string.h>
|
|
|
|
|
2008-10-24 05:42:58 +04:00
|
|
|
#ifdef HAVE_FCNTL_H
|
|
|
|
#include <fcntl.h>
|
|
|
|
#else
|
|
|
|
#ifdef HAVE_SYS_FCNTL_H
|
|
|
|
#include <sys/fcntl.h>
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
Update libevent to the 2.0 series, currently at 2.0.7rc. We will update to their final release when it becomes available. Currently known errors exist in unused portions of the libevent code. This revision passes the IBM test suite on a Linux machine and on a standalone Mac.
This is a fairly intrusive change, but outside of the moving of opal/event to opal/mca/event, the only changes involved (a) changing all calls to opal_event functions to reflect the new framework instead, and (b) ensuring that all opal_event_t objects are properly constructed since they are now true opal_objects.
Note: Shiqing has just returned from vacation and has not yet had a chance to complete the Windows integration. Thus, this commit almost certainly breaks Windows support on the trunk. However, I want this to have a chance to soak for as long as possible before I become less available a week from today (going to be at a class for 5 days, and thus will only be sparingly available) so we can find and fix any problems.
Biggest change is moving the libevent code from opal/event to a new opal/mca/event framework. This was done to make it much easier to update libevent in the future. New versions can be inserted as a new component and tested in parallel with the current version until validated, then we can remove the earlier version if we so choose. This is a statically built framework ala installdirs, so only one component will build at a time. There is no selection logic - the sole compiled component simply loads its function pointers into the opal_event struct.
I have gone thru the code base and converted all the libevent calls I could find. However, I cannot compile nor test every environment. It is therefore quite likely that errors remain in the system. Please keep an eye open for two things:
1. compile-time errors: these will be obvious as calls to the old functions (e.g., opal_evtimer_new) must be replaced by the new framework APIs (e.g., opal_event.evtimer_new)
2. run-time errors: these will likely show up as segfaults due to missing constructors on opal_event_t objects. It appears that it became a typical practice for people to "init" an opal_event_t by simply using memset to zero it out. This will no longer work - you must either OBJ_NEW or OBJ_CONSTRUCT an opal_event_t. I tried to catch these cases, but may have missed some. Believe me, you'll know when you hit it.
There is also the issue of the new libevent "no recursion" behavior. As I described on a recent email, we will have to discuss this and figure out what, if anything, we need to do.
This commit was SVN r23925.
2010-10-24 22:35:54 +04:00
|
|
|
#include "opal/mca/event/event.h"
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
|
|
|
|
#include "orte/runtime/orte_globals.h"
|
|
|
|
#include "orte/mca/errmgr/errmgr.h"
|
2011-06-24 00:38:02 +04:00
|
|
|
#include "orte/mca/ess/ess.h"
|
2010-04-16 22:51:27 +04:00
|
|
|
#include "orte/mca/rml/rml.h"
|
2009-01-31 01:47:30 +03:00
|
|
|
#include "orte/util/name_fns.h"
|
2017-06-06 01:22:28 +03:00
|
|
|
#include "orte/util/threads.h"
|
2009-01-31 01:47:30 +03:00
|
|
|
#include "orte/mca/odls/odls_types.h"
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
|
|
|
|
#include "orte/mca/iof/base/base.h"
|
2016-02-16 07:00:57 +03:00
|
|
|
#include "orte/mca/iof/base/iof_base_setup.h"
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
#include "iof_hnp.h"
|
|
|
|
|
|
|
|
/* LOCAL FUNCTIONS */
|
|
|
|
static void stdin_write_handler(int fd, short event, void *cbdata);
|
|
|
|
|
|
|
|
/* API FUNCTIONS */
|
2010-04-16 22:51:27 +04:00
|
|
|
static int init(void);
|
|
|
|
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
static int hnp_push(const orte_process_name_t* dst_name, orte_iof_tag_t src_tag, int fd);
|
|
|
|
|
|
|
|
static int hnp_pull(const orte_process_name_t* src_name,
|
|
|
|
orte_iof_tag_t src_tag,
|
|
|
|
int fd);
|
|
|
|
|
|
|
|
static int hnp_close(const orte_process_name_t* peer,
|
|
|
|
orte_iof_tag_t source_tag);
|
|
|
|
|
2017-01-05 20:46:05 +03:00
|
|
|
static int hnp_output(const orte_process_name_t* peer,
|
|
|
|
orte_iof_tag_t source_tag,
|
|
|
|
const char *msg);
|
|
|
|
|
2017-01-13 06:54:18 +03:00
|
|
|
static void hnp_complete(const orte_job_t *jdata);
|
|
|
|
|
2010-04-16 22:51:27 +04:00
|
|
|
static int finalize(void);
|
|
|
|
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
static int hnp_ft_event(int state);
|
|
|
|
|
|
|
|
/* The API's in this module are solely used to support LOCAL
|
|
|
|
* procs - i.e., procs that are co-located to the HNP. Remote
|
|
|
|
* procs interact with the HNP's IOF via the HNP's receive function,
|
|
|
|
* which operates independently and is in the iof_hnp_receive.c file
|
|
|
|
*/
|
|
|
|
|
|
|
|
orte_iof_base_module_t orte_iof_hnp_module = {
|
2017-01-05 20:46:05 +03:00
|
|
|
.init = init,
|
|
|
|
.push = hnp_push,
|
|
|
|
.pull = hnp_pull,
|
|
|
|
.close = hnp_close,
|
|
|
|
.output = hnp_output,
|
2017-01-13 06:54:18 +03:00
|
|
|
.complete = hnp_complete,
|
2017-01-05 20:46:05 +03:00
|
|
|
.finalize = finalize,
|
|
|
|
.ft_event = hnp_ft_event
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
};
|
|
|
|
|
2010-04-16 22:51:27 +04:00
|
|
|
/* Initialize the module */
|
|
|
|
static int init(void)
|
|
|
|
{
|
|
|
|
/* post non-blocking recv to catch forwarded IO from
|
|
|
|
* the orteds
|
2015-06-24 06:59:57 +03:00
|
|
|
*/
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 20:37:40 +04:00
|
|
|
orte_rml.recv_buffer_nb(ORTE_NAME_WILDCARD,
|
|
|
|
ORTE_RML_TAG_IOF_HNP,
|
|
|
|
ORTE_RML_PERSISTENT,
|
|
|
|
orte_iof_hnp_recv,
|
|
|
|
NULL);
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2010-04-16 22:51:27 +04:00
|
|
|
OBJ_CONSTRUCT(&mca_iof_hnp_component.procs, opal_list_t);
|
|
|
|
mca_iof_hnp_component.stdinev = NULL;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2010-04-16 22:51:27 +04:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
|
|
|
|
/* Setup to read local data. If the tag is other than STDIN,
|
|
|
|
* then this is output being pushed from one of my child processes
|
|
|
|
* and I'll write the data out myself. If the tag is STDIN,
|
|
|
|
* then I need to setup to read from my stdin, and send anything
|
|
|
|
* I get to the specified dst_name. The dst_name in this case tells
|
|
|
|
* us which procs are to get stdin - only two options are supported:
|
|
|
|
*
|
|
|
|
* (a) a specific name, usually vpid=0; or
|
|
|
|
*
|
|
|
|
* (b) all procs, specified by vpid=ORTE_VPID_WILDCARD
|
|
|
|
*
|
|
|
|
* The orte_plm_base_launch_apps function calls iof.push after
|
|
|
|
* the procs are launched and tells us how to distribute stdin. This
|
|
|
|
* ensures that the procs are started -before- we begin reading stdin
|
|
|
|
* and attempting to send it to remote procs
|
|
|
|
*/
|
|
|
|
static int hnp_push(const orte_process_name_t* dst_name, orte_iof_tag_t src_tag, int fd)
|
|
|
|
{
|
|
|
|
orte_job_t *jdata;
|
2009-09-26 07:33:55 +04:00
|
|
|
orte_proc_t *proc;
|
2016-02-18 20:27:52 +03:00
|
|
|
orte_iof_proc_t *proct, *pptr;
|
2016-02-16 07:00:57 +03:00
|
|
|
int flags, rc;
|
|
|
|
orte_ns_cmp_bitmask_t mask = ORTE_NS_CMP_ALL;
|
2008-10-24 05:42:58 +04:00
|
|
|
|
2008-12-10 23:40:47 +03:00
|
|
|
/* don't do this if the dst vpid is invalid or the fd is negative! */
|
|
|
|
if (ORTE_VPID_INVALID == dst_name->vpid || fd < 0) {
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2013-03-28 01:14:43 +04:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_iof_base_framework.framework_output,
|
2008-12-10 23:40:47 +03:00
|
|
|
"%s iof:hnp pushing fd %d for process %s",
|
2009-03-06 00:50:47 +03:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
fd, ORTE_NAME_PRINT(dst_name)));
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2016-02-16 07:00:57 +03:00
|
|
|
/* do we already have this process in our list? */
|
|
|
|
OPAL_LIST_FOREACH(proct, &mca_iof_hnp_component.procs, orte_iof_proc_t) {
|
|
|
|
if (OPAL_EQUAL == orte_util_compare_name_fields(mask, &proct->name, dst_name)) {
|
|
|
|
/* found it */
|
|
|
|
goto SETUP;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* if we get here, then we don't yet have this proc in our list */
|
|
|
|
proct = OBJ_NEW(orte_iof_proc_t);
|
|
|
|
proct->name.jobid = dst_name->jobid;
|
|
|
|
proct->name.vpid = dst_name->vpid;
|
|
|
|
opal_list_append(&mca_iof_hnp_component.procs, &proct->super);
|
|
|
|
|
|
|
|
SETUP:
|
2008-10-23 23:11:05 +04:00
|
|
|
if (!(src_tag & ORTE_IOF_STDIN)) {
|
2008-10-24 05:42:58 +04:00
|
|
|
/* set the file descriptor to non-blocking - do this before we setup
|
|
|
|
* and activate the read event in case it fires right away
|
|
|
|
*/
|
|
|
|
if((flags = fcntl(fd, F_GETFL, 0)) < 0) {
|
2015-06-24 06:59:57 +03:00
|
|
|
opal_output(orte_iof_base_framework.framework_output, "[%s:%d]: fcntl(F_GETFL) failed with errno=%d\n",
|
2008-10-24 05:42:58 +04:00
|
|
|
__FILE__, __LINE__, errno);
|
|
|
|
} else {
|
|
|
|
flags |= O_NONBLOCK;
|
|
|
|
fcntl(fd, F_SETFL, flags);
|
|
|
|
}
|
2016-02-16 07:00:57 +03:00
|
|
|
/* get the local jobdata for this proc */
|
|
|
|
if (NULL == (jdata = orte_get_job_data_object(proct->name.jobid))) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
|
|
|
return ORTE_ERR_NOT_FOUND;
|
2008-12-10 23:40:47 +03:00
|
|
|
}
|
2008-10-24 05:42:58 +04:00
|
|
|
/* define a read event and activate it */
|
2008-12-10 23:40:47 +03:00
|
|
|
if (src_tag & ORTE_IOF_STDOUT) {
|
2016-02-16 07:00:57 +03:00
|
|
|
ORTE_IOF_READ_EVENT(&proct->revstdout, proct, fd, ORTE_IOF_STDOUT,
|
2009-01-31 01:47:30 +03:00
|
|
|
orte_iof_hnp_read_local_handler, false);
|
2008-12-10 23:40:47 +03:00
|
|
|
} else if (src_tag & ORTE_IOF_STDERR) {
|
2016-02-16 07:00:57 +03:00
|
|
|
ORTE_IOF_READ_EVENT(&proct->revstderr, proct, fd, ORTE_IOF_STDERR,
|
2009-01-31 01:47:30 +03:00
|
|
|
orte_iof_hnp_read_local_handler, false);
|
2008-12-10 23:40:47 +03:00
|
|
|
} else if (src_tag & ORTE_IOF_STDDIAG) {
|
2016-02-16 07:00:57 +03:00
|
|
|
ORTE_IOF_READ_EVENT(&proct->revstddiag, proct, fd, ORTE_IOF_STDDIAG,
|
2009-01-31 01:47:30 +03:00
|
|
|
orte_iof_hnp_read_local_handler, false);
|
|
|
|
}
|
2017-01-15 04:40:36 +03:00
|
|
|
/* setup any requested output files */
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_iof_base_setup_output_files(dst_name, jdata, proct))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2009-01-31 01:47:30 +03:00
|
|
|
/* if -all- of the readevents for this proc have been defined, then
|
|
|
|
* activate them. Otherwise, we can think that the proc is complete
|
|
|
|
* because one of the readevents fires -prior- to all of them having
|
|
|
|
* been defined!
|
|
|
|
*/
|
|
|
|
if (NULL != proct->revstdout && NULL != proct->revstderr && NULL != proct->revstddiag) {
|
2016-02-18 20:27:52 +03:00
|
|
|
if (proct->copy) {
|
|
|
|
/* see if there are any wildcard subscribers out there that
|
|
|
|
* apply to us */
|
|
|
|
OPAL_LIST_FOREACH(pptr, &mca_iof_hnp_component.procs, orte_iof_proc_t) {
|
|
|
|
if (dst_name->jobid == pptr->name.jobid &&
|
|
|
|
ORTE_VPID_WILDCARD == pptr->name.vpid &&
|
|
|
|
NULL != pptr->subscribers) {
|
|
|
|
OBJ_RETAIN(pptr->subscribers);
|
|
|
|
proct->subscribers = pptr->subscribers;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-01-31 01:47:30 +03:00
|
|
|
proct->revstdout->active = true;
|
2017-06-06 01:22:28 +03:00
|
|
|
ORTE_POST_OBJECT(proct->revstdout);
|
2012-04-06 18:23:13 +04:00
|
|
|
opal_event_add(proct->revstdout->ev, 0);
|
2009-01-31 01:47:30 +03:00
|
|
|
proct->revstderr->active = true;
|
2017-06-06 01:22:28 +03:00
|
|
|
ORTE_POST_OBJECT(proct->revstderr);
|
2012-04-06 18:23:13 +04:00
|
|
|
opal_event_add(proct->revstderr->ev, 0);
|
2009-01-31 01:47:30 +03:00
|
|
|
proct->revstddiag->active = true;
|
2017-06-06 01:22:28 +03:00
|
|
|
ORTE_POST_OBJECT(proct->revstddiag);
|
2012-04-06 18:23:13 +04:00
|
|
|
opal_event_add(proct->revstddiag->ev, 0);
|
2008-12-10 23:40:47 +03:00
|
|
|
}
|
2008-10-23 23:11:05 +04:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* if we are pushing stdin, this is happening only during launch - setup
|
|
|
|
* a target for this destination if it is going somewhere other than me
|
|
|
|
*/
|
|
|
|
if (ORTE_VPID_WILDCARD == dst_name->vpid) {
|
|
|
|
/* if wildcard, define a sink with that info so it gets sent out */
|
2016-02-19 21:10:08 +03:00
|
|
|
ORTE_IOF_SINK_DEFINE(&proct->stdinev, dst_name, -1, ORTE_IOF_STDIN,
|
2016-02-16 07:00:57 +03:00
|
|
|
stdin_write_handler);
|
2016-02-19 21:10:08 +03:00
|
|
|
proct->stdinev->daemon.jobid = ORTE_PROC_MY_NAME->jobid;
|
|
|
|
proct->stdinev->daemon.vpid = ORTE_VPID_WILDCARD;
|
2012-03-06 19:47:04 +04:00
|
|
|
} else {
|
2008-10-23 23:11:05 +04:00
|
|
|
/* no - lookup the proc's daemon and set that into sink */
|
|
|
|
if (NULL == (jdata = orte_get_job_data_object(dst_name->jobid))) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_BAD_PARAM);
|
|
|
|
return ORTE_ERR_BAD_PARAM;
|
|
|
|
}
|
2009-09-26 07:33:55 +04:00
|
|
|
if (NULL == (proc = (orte_proc_t*)opal_pointer_array_get_item(jdata->procs, dst_name->vpid))) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
|
|
|
return ORTE_ERR_NOT_FOUND;
|
|
|
|
}
|
2008-10-23 23:11:05 +04:00
|
|
|
/* if it is me, then don't set this up - we'll get it on the pull */
|
2009-09-26 07:33:55 +04:00
|
|
|
if (ORTE_PROC_MY_NAME->vpid != proc->node->daemon->name.vpid) {
|
2016-02-19 21:10:08 +03:00
|
|
|
ORTE_IOF_SINK_DEFINE(&proct->stdinev, dst_name, -1, ORTE_IOF_STDIN,
|
2016-02-16 07:00:57 +03:00
|
|
|
stdin_write_handler);
|
2016-02-19 21:10:08 +03:00
|
|
|
proct->stdinev->daemon.jobid = ORTE_PROC_MY_NAME->jobid;
|
|
|
|
proct->stdinev->daemon.vpid = proc->node->daemon->name.vpid;
|
2008-10-23 23:11:05 +04:00
|
|
|
}
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-10-23 23:11:05 +04:00
|
|
|
/* now setup the read - but check to only do this once */
|
|
|
|
if (NULL == mca_iof_hnp_component.stdinev) {
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
/* Since we are the HNP, we don't want to set nonblocking on our
|
2008-10-24 05:42:58 +04:00
|
|
|
* stdio stream. If we do so, we set the file descriptor to
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
* non-blocking for everyone that has that file descriptor, which
|
|
|
|
* includes everyone else in our shell pipeline chain. (See
|
|
|
|
* http://lists.freebsd.org/pipermail/freebsd-hackers/2005-January/009742.html).
|
|
|
|
* This causes things like "mpirun -np 1 big_app | cat" to lose
|
|
|
|
* output, because cat's stdout is then ALSO non-blocking and cat
|
|
|
|
* isn't built to deal with that case (same with almost all other
|
2015-06-24 06:59:57 +03:00
|
|
|
* unix text utils).
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
*/
|
2008-10-24 05:42:58 +04:00
|
|
|
if (0 != fd) {
|
|
|
|
if((flags = fcntl(fd, F_GETFL, 0)) < 0) {
|
2015-06-24 06:59:57 +03:00
|
|
|
opal_output(orte_iof_base_framework.framework_output, "[%s:%d]: fcntl(F_GETFL) failed with errno=%d\n",
|
2008-10-24 05:42:58 +04:00
|
|
|
__FILE__, __LINE__, errno);
|
|
|
|
} else {
|
|
|
|
flags |= O_NONBLOCK;
|
|
|
|
fcntl(fd, F_SETFL, flags);
|
2015-06-24 06:59:57 +03:00
|
|
|
}
|
2008-10-24 05:42:58 +04:00
|
|
|
}
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
if (isatty(fd)) {
|
|
|
|
/* We should avoid trying to read from stdin if we
|
|
|
|
* have a terminal, but are backgrounded. Catch the
|
|
|
|
* signals that are commonly used when we switch
|
|
|
|
* between being backgrounded and not. If the
|
|
|
|
* filedescriptor is not a tty, don't worry about it
|
|
|
|
* and always stay connected.
|
|
|
|
*/
|
2012-04-06 18:23:13 +04:00
|
|
|
opal_event_signal_set(orte_event_base, &mca_iof_hnp_component.stdinsig,
|
Update libevent to the 2.0 series, currently at 2.0.7rc. We will update to their final release when it becomes available. Currently known errors exist in unused portions of the libevent code. This revision passes the IBM test suite on a Linux machine and on a standalone Mac.
This is a fairly intrusive change, but outside of the moving of opal/event to opal/mca/event, the only changes involved (a) changing all calls to opal_event functions to reflect the new framework instead, and (b) ensuring that all opal_event_t objects are properly constructed since they are now true opal_objects.
Note: Shiqing has just returned from vacation and has not yet had a chance to complete the Windows integration. Thus, this commit almost certainly breaks Windows support on the trunk. However, I want this to have a chance to soak for as long as possible before I become less available a week from today (going to be at a class for 5 days, and thus will only be sparingly available) so we can find and fix any problems.
Biggest change is moving the libevent code from opal/event to a new opal/mca/event framework. This was done to make it much easier to update libevent in the future. New versions can be inserted as a new component and tested in parallel with the current version until validated, then we can remove the earlier version if we so choose. This is a statically built framework ala installdirs, so only one component will build at a time. There is no selection logic - the sole compiled component simply loads its function pointers into the opal_event struct.
I have gone thru the code base and converted all the libevent calls I could find. However, I cannot compile nor test every environment. It is therefore quite likely that errors remain in the system. Please keep an eye open for two things:
1. compile-time errors: these will be obvious as calls to the old functions (e.g., opal_evtimer_new) must be replaced by the new framework APIs (e.g., opal_event.evtimer_new)
2. run-time errors: these will likely show up as segfaults due to missing constructors on opal_event_t objects. It appears that it became a typical practice for people to "init" an opal_event_t by simply using memset to zero it out. This will no longer work - you must either OBJ_NEW or OBJ_CONSTRUCT an opal_event_t. I tried to catch these cases, but may have missed some. Believe me, you'll know when you hit it.
There is also the issue of the new libevent "no recursion" behavior. As I described on a recent email, we will have to discuss this and figure out what, if anything, we need to do.
This commit was SVN r23925.
2010-10-24 22:35:54 +04:00
|
|
|
SIGCONT, orte_iof_hnp_stdin_cb,
|
|
|
|
NULL);
|
2015-06-24 06:59:57 +03:00
|
|
|
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
/* setup a read event to read stdin, but don't activate it yet. The
|
|
|
|
* dst_name indicates who should receive the stdin. If that recipient
|
|
|
|
* doesn't do a corresponding pull, however, then the stdin will
|
|
|
|
* be dropped upon receipt at the local daemon
|
|
|
|
*/
|
2008-12-10 23:40:47 +03:00
|
|
|
ORTE_IOF_READ_EVENT(&mca_iof_hnp_component.stdinev,
|
2016-02-16 07:00:57 +03:00
|
|
|
proct, fd, ORTE_IOF_STDIN,
|
2008-12-10 23:40:47 +03:00
|
|
|
orte_iof_hnp_read_local_handler, false);
|
2015-06-24 06:59:57 +03:00
|
|
|
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
/* check to see if we want the stdin read event to be
|
|
|
|
* active - we will always at least define the event,
|
|
|
|
* but may delay its activation
|
|
|
|
*/
|
|
|
|
if (!(src_tag & ORTE_IOF_STDIN) || orte_iof_hnp_stdin_check(fd)) {
|
|
|
|
mca_iof_hnp_component.stdinev->active = true;
|
2017-06-06 01:22:28 +03:00
|
|
|
ORTE_POST_OBJECT(proct->revstdout);
|
2012-04-06 18:23:13 +04:00
|
|
|
opal_event_add(mca_iof_hnp_component.stdinev->ev, 0);
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
}
|
2008-12-10 23:40:47 +03:00
|
|
|
} else {
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
/* if we are not looking at a tty, just setup a read event
|
|
|
|
* and activate it
|
|
|
|
*/
|
2008-12-10 23:40:47 +03:00
|
|
|
ORTE_IOF_READ_EVENT(&mca_iof_hnp_component.stdinev,
|
2016-02-16 07:00:57 +03:00
|
|
|
proct, fd, ORTE_IOF_STDIN,
|
2008-12-10 23:40:47 +03:00
|
|
|
orte_iof_hnp_read_local_handler, true);
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Since we are the HNP, the only "pull" call comes from a local
|
|
|
|
* process so we can record the file descriptor for its stdin.
|
|
|
|
*/
|
|
|
|
|
|
|
|
static int hnp_pull(const orte_process_name_t* dst_name,
|
|
|
|
orte_iof_tag_t src_tag,
|
|
|
|
int fd)
|
|
|
|
{
|
2016-02-16 07:00:57 +03:00
|
|
|
orte_iof_proc_t *proct;
|
|
|
|
orte_ns_cmp_bitmask_t mask = ORTE_NS_CMP_ALL;
|
2008-10-24 05:42:58 +04:00
|
|
|
int flags;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
/* this is a local call - only stdin is supported */
|
|
|
|
if (ORTE_IOF_STDIN != src_tag) {
|
|
|
|
return ORTE_ERR_NOT_SUPPORTED;
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2013-03-28 01:14:43 +04:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_iof_base_framework.framework_output,
|
2008-12-10 23:40:47 +03:00
|
|
|
"%s iof:hnp pulling fd %d for process %s",
|
2009-03-06 00:50:47 +03:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
fd, ORTE_NAME_PRINT(dst_name)));
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-10-24 05:42:58 +04:00
|
|
|
/* set the file descriptor to non-blocking - do this before we setup
|
|
|
|
* the sink in case it fires right away
|
|
|
|
*/
|
|
|
|
if((flags = fcntl(fd, F_GETFL, 0)) < 0) {
|
2015-06-24 06:59:57 +03:00
|
|
|
opal_output(orte_iof_base_framework.framework_output, "[%s:%d]: fcntl(F_GETFL) failed with errno=%d\n",
|
2008-10-24 05:42:58 +04:00
|
|
|
__FILE__, __LINE__, errno);
|
|
|
|
} else {
|
|
|
|
flags |= O_NONBLOCK;
|
|
|
|
fcntl(fd, F_SETFL, flags);
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2016-02-16 07:00:57 +03:00
|
|
|
/* do we already have this process in our list? */
|
|
|
|
OPAL_LIST_FOREACH(proct, &mca_iof_hnp_component.procs, orte_iof_proc_t) {
|
|
|
|
if (OPAL_EQUAL == orte_util_compare_name_fields(mask, &proct->name, dst_name)) {
|
|
|
|
/* found it */
|
|
|
|
goto SETUP;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* if we get here, then we don't yet have this proc in our list */
|
|
|
|
proct = OBJ_NEW(orte_iof_proc_t);
|
|
|
|
proct->name.jobid = dst_name->jobid;
|
|
|
|
proct->name.vpid = dst_name->vpid;
|
|
|
|
opal_list_append(&mca_iof_hnp_component.procs, &proct->super);
|
|
|
|
|
|
|
|
SETUP:
|
2016-02-19 21:10:08 +03:00
|
|
|
ORTE_IOF_SINK_DEFINE(&proct->stdinev, dst_name, fd, ORTE_IOF_STDIN,
|
2016-02-16 07:00:57 +03:00
|
|
|
stdin_write_handler);
|
2016-02-19 21:10:08 +03:00
|
|
|
proct->stdinev->daemon.jobid = ORTE_PROC_MY_NAME->jobid;
|
|
|
|
proct->stdinev->daemon.vpid = ORTE_PROC_MY_NAME->vpid;
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* One of our local procs wants us to close the specifed
|
|
|
|
* stream(s), thus terminating any potential io to/from it.
|
|
|
|
*/
|
|
|
|
static int hnp_close(const orte_process_name_t* peer,
|
2008-10-31 21:05:28 +03:00
|
|
|
orte_iof_tag_t source_tag)
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
{
|
2016-02-16 07:00:57 +03:00
|
|
|
orte_iof_proc_t* proct;
|
|
|
|
orte_ns_cmp_bitmask_t mask = ORTE_NS_CMP_ALL;
|
|
|
|
int cnt = 0;
|
|
|
|
|
|
|
|
OPAL_LIST_FOREACH(proct, &mca_iof_hnp_component.procs, orte_iof_proc_t) {
|
|
|
|
if (OPAL_EQUAL == orte_util_compare_name_fields(mask, &proct->name, peer)) {
|
|
|
|
if (ORTE_IOF_STDIN & source_tag) {
|
2016-02-19 21:10:08 +03:00
|
|
|
if (NULL != proct->stdinev) {
|
|
|
|
OBJ_RELEASE(proct->stdinev);
|
2016-02-19 00:48:41 +03:00
|
|
|
}
|
2016-02-16 07:00:57 +03:00
|
|
|
++cnt;
|
|
|
|
}
|
|
|
|
if (ORTE_IOF_STDOUT & source_tag) {
|
2016-02-19 00:48:41 +03:00
|
|
|
if (NULL != proct->revstdout) {
|
2016-02-19 21:10:08 +03:00
|
|
|
orte_iof_base_static_dump_output(proct->revstdout);
|
2016-02-19 00:48:41 +03:00
|
|
|
OBJ_RELEASE(proct->revstdout);
|
|
|
|
}
|
2016-02-16 07:00:57 +03:00
|
|
|
++cnt;
|
|
|
|
}
|
|
|
|
if (ORTE_IOF_STDERR & source_tag) {
|
2016-02-19 00:48:41 +03:00
|
|
|
if (NULL != proct->revstderr) {
|
2016-02-19 21:10:08 +03:00
|
|
|
orte_iof_base_static_dump_output(proct->revstderr);
|
2016-02-19 00:48:41 +03:00
|
|
|
OBJ_RELEASE(proct->revstderr);
|
|
|
|
}
|
2016-02-16 07:00:57 +03:00
|
|
|
++cnt;
|
|
|
|
}
|
|
|
|
if (ORTE_IOF_STDDIAG & source_tag) {
|
2016-02-19 00:48:41 +03:00
|
|
|
if (NULL != proct->revstddiag) {
|
2016-02-19 21:10:08 +03:00
|
|
|
orte_iof_base_static_dump_output(proct->revstddiag);
|
2016-02-19 00:48:41 +03:00
|
|
|
OBJ_RELEASE(proct->revstddiag);
|
|
|
|
}
|
2016-02-16 07:00:57 +03:00
|
|
|
++cnt;
|
|
|
|
}
|
|
|
|
/* if we closed them all, then remove this proc */
|
|
|
|
if (4 == cnt) {
|
|
|
|
opal_list_remove_item(&mca_iof_hnp_component.procs, &proct->super);
|
|
|
|
OBJ_RELEASE(proct);
|
|
|
|
}
|
2008-12-10 23:40:47 +03:00
|
|
|
break;
|
2008-10-31 21:05:28 +03:00
|
|
|
}
|
|
|
|
}
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2017-01-13 06:54:18 +03:00
|
|
|
static void hnp_complete(const orte_job_t *jdata)
|
|
|
|
{
|
|
|
|
orte_iof_proc_t *proct, *next;
|
|
|
|
|
|
|
|
/* cleanout any lingering sinks */
|
|
|
|
OPAL_LIST_FOREACH_SAFE(proct, next, &mca_iof_hnp_component.procs, orte_iof_proc_t) {
|
|
|
|
if (jdata->jobid == proct->name.jobid) {
|
|
|
|
opal_list_remove_item(&mca_iof_hnp_component.procs, &proct->super);
|
|
|
|
OBJ_RELEASE(proct);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-04-16 22:51:27 +04:00
|
|
|
static int finalize(void)
|
|
|
|
{
|
|
|
|
orte_iof_write_event_t *wev;
|
2016-02-19 21:10:08 +03:00
|
|
|
orte_iof_proc_t *proct;
|
2010-04-16 22:51:27 +04:00
|
|
|
bool dump;
|
2016-02-19 21:10:08 +03:00
|
|
|
orte_iof_write_output_t *output;
|
|
|
|
int num_written;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2010-04-16 22:51:27 +04:00
|
|
|
/* check if anything is still trying to be written out */
|
|
|
|
wev = orte_iof_base.iof_write_stdout->wev;
|
|
|
|
if (!opal_list_is_empty(&wev->outputs)) {
|
|
|
|
dump = false;
|
|
|
|
/* make one last attempt to write this out */
|
2016-02-19 21:10:08 +03:00
|
|
|
while (NULL != (output = (orte_iof_write_output_t*)opal_list_remove_first(&wev->outputs))) {
|
2010-04-16 22:51:27 +04:00
|
|
|
if (!dump) {
|
|
|
|
num_written = write(wev->fd, output->data, output->numbytes);
|
|
|
|
if (num_written < output->numbytes) {
|
|
|
|
/* don't retry - just cleanout the list and dump it */
|
|
|
|
dump = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
OBJ_RELEASE(output);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!orte_xml_output) {
|
|
|
|
/* we only opened stderr channel if we are NOT doing xml output */
|
|
|
|
wev = orte_iof_base.iof_write_stderr->wev;
|
|
|
|
if (!opal_list_is_empty(&wev->outputs)) {
|
|
|
|
dump = false;
|
|
|
|
/* make one last attempt to write this out */
|
2016-02-19 21:10:08 +03:00
|
|
|
while (NULL != (output = (orte_iof_write_output_t*)opal_list_remove_first(&wev->outputs))) {
|
2010-04-16 22:51:27 +04:00
|
|
|
if (!dump) {
|
|
|
|
num_written = write(wev->fd, output->data, output->numbytes);
|
|
|
|
if (num_written < output->numbytes) {
|
|
|
|
/* don't retry - just cleanout the list and dump it */
|
|
|
|
dump = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
OBJ_RELEASE(output);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2016-02-19 21:10:08 +03:00
|
|
|
/* cycle thru the procs and ensure all their output was delivered
|
|
|
|
* if they were writing to files */
|
|
|
|
while (NULL != (proct = (orte_iof_proc_t*)opal_list_remove_first(&mca_iof_hnp_component.procs))) {
|
|
|
|
if (NULL != proct->revstdout) {
|
|
|
|
orte_iof_base_static_dump_output(proct->revstdout);
|
|
|
|
}
|
|
|
|
if (NULL != proct->revstderr) {
|
|
|
|
orte_iof_base_static_dump_output(proct->revstderr);
|
|
|
|
}
|
|
|
|
if (NULL != proct->revstddiag) {
|
|
|
|
orte_iof_base_static_dump_output(proct->revstddiag);
|
|
|
|
}
|
|
|
|
OBJ_RELEASE(proct);
|
|
|
|
}
|
|
|
|
OBJ_DESTRUCT(&mca_iof_hnp_component.procs);
|
Update libevent to the 2.0 series, currently at 2.0.7rc. We will update to their final release when it becomes available. Currently known errors exist in unused portions of the libevent code. This revision passes the IBM test suite on a Linux machine and on a standalone Mac.
This is a fairly intrusive change, but outside of the moving of opal/event to opal/mca/event, the only changes involved (a) changing all calls to opal_event functions to reflect the new framework instead, and (b) ensuring that all opal_event_t objects are properly constructed since they are now true opal_objects.
Note: Shiqing has just returned from vacation and has not yet had a chance to complete the Windows integration. Thus, this commit almost certainly breaks Windows support on the trunk. However, I want this to have a chance to soak for as long as possible before I become less available a week from today (going to be at a class for 5 days, and thus will only be sparingly available) so we can find and fix any problems.
Biggest change is moving the libevent code from opal/event to a new opal/mca/event framework. This was done to make it much easier to update libevent in the future. New versions can be inserted as a new component and tested in parallel with the current version until validated, then we can remove the earlier version if we so choose. This is a statically built framework ala installdirs, so only one component will build at a time. There is no selection logic - the sole compiled component simply loads its function pointers into the opal_event struct.
I have gone thru the code base and converted all the libevent calls I could find. However, I cannot compile nor test every environment. It is therefore quite likely that errors remain in the system. Please keep an eye open for two things:
1. compile-time errors: these will be obvious as calls to the old functions (e.g., opal_evtimer_new) must be replaced by the new framework APIs (e.g., opal_event.evtimer_new)
2. run-time errors: these will likely show up as segfaults due to missing constructors on opal_event_t objects. It appears that it became a typical practice for people to "init" an opal_event_t by simply using memset to zero it out. This will no longer work - you must either OBJ_NEW or OBJ_CONSTRUCT an opal_event_t. I tried to catch these cases, but may have missed some. Believe me, you'll know when you hit it.
There is also the issue of the new libevent "no recursion" behavior. As I described on a recent email, we will have to discuss this and figure out what, if anything, we need to do.
This commit was SVN r23925.
2010-10-24 22:35:54 +04:00
|
|
|
|
2010-04-16 22:51:27 +04:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
int hnp_ft_event(int state) {
|
|
|
|
/*
|
|
|
|
* Replica doesn't need to do anything for a checkpoint
|
|
|
|
*/
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-02-13 05:53:12 +04:00
|
|
|
/* this function is called by the event library and thus
|
|
|
|
* can access information global to the state machine
|
|
|
|
*/
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
static void stdin_write_handler(int fd, short event, void *cbdata)
|
|
|
|
{
|
2008-12-10 23:40:47 +03:00
|
|
|
orte_iof_sink_t *sink = (orte_iof_sink_t*)cbdata;
|
|
|
|
orte_iof_write_event_t *wev = sink->wev;
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
opal_list_item_t *item;
|
|
|
|
orte_iof_write_output_t *output;
|
|
|
|
int num_written;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2017-06-06 01:22:28 +03:00
|
|
|
ORTE_ACQUIRE_OBJECT(sink);
|
|
|
|
|
2013-03-28 01:14:43 +04:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_iof_base_framework.framework_output,
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
"%s hnp:stdin:write:handler writing data to %d",
|
2009-03-06 00:50:47 +03:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
wev->fd));
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-12-10 23:40:47 +03:00
|
|
|
wev->pending = false;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
while (NULL != (item = opal_list_remove_first(&wev->outputs))) {
|
|
|
|
output = (orte_iof_write_output_t*)item;
|
2009-02-27 12:31:34 +03:00
|
|
|
/* if an abnormal termination has occurred, just dump
|
|
|
|
* this data as we are aborting
|
|
|
|
*/
|
|
|
|
if (orte_abnormal_term_ordered) {
|
|
|
|
OBJ_RELEASE(output);
|
|
|
|
continue;
|
|
|
|
}
|
2008-10-23 23:11:05 +04:00
|
|
|
if (0 == output->numbytes) {
|
|
|
|
/* this indicates we are to close the fd - there is
|
|
|
|
* nothing to write
|
|
|
|
*/
|
2013-03-28 01:14:43 +04:00
|
|
|
OPAL_OUTPUT_VERBOSE((20, orte_iof_base_framework.framework_output,
|
2008-12-10 23:40:47 +03:00
|
|
|
"%s iof:hnp closing fd %d on write event due to zero bytes output",
|
2009-03-06 00:50:47 +03:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), wev->fd));
|
2008-12-10 23:40:47 +03:00
|
|
|
OBJ_RELEASE(wev);
|
|
|
|
sink->wev = NULL;
|
2008-10-23 23:11:05 +04:00
|
|
|
/* just leave - we don't want to restart the
|
|
|
|
* read event!
|
|
|
|
*/
|
2013-02-13 05:53:12 +04:00
|
|
|
return;
|
2008-10-23 23:11:05 +04:00
|
|
|
}
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
num_written = write(wev->fd, output->data, output->numbytes);
|
2013-03-28 01:14:43 +04:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_iof_base_framework.framework_output,
|
2008-12-10 23:40:47 +03:00
|
|
|
"%s hnp:stdin:write:handler wrote %d bytes",
|
2009-03-06 00:50:47 +03:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
2008-12-10 23:40:47 +03:00
|
|
|
num_written));
|
2008-10-24 05:42:58 +04:00
|
|
|
if (num_written < 0) {
|
|
|
|
if (EAGAIN == errno || EINTR == errno) {
|
|
|
|
/* push this item back on the front of the list */
|
|
|
|
opal_list_prepend(&wev->outputs, item);
|
|
|
|
/* leave the write event running so it will call us again
|
|
|
|
* when the fd is ready.
|
|
|
|
*/
|
2008-12-10 23:40:47 +03:00
|
|
|
wev->pending = true;
|
2017-06-06 01:22:28 +03:00
|
|
|
ORTE_POST_OBJECT(wev);
|
2012-04-06 18:23:13 +04:00
|
|
|
opal_event_add(wev->ev, 0);
|
2008-10-24 05:42:58 +04:00
|
|
|
goto CHECK;
|
2015-06-24 06:59:57 +03:00
|
|
|
}
|
2008-12-10 23:40:47 +03:00
|
|
|
/* otherwise, something bad happened so all we can do is declare an
|
|
|
|
* error and abort
|
2008-10-24 05:42:58 +04:00
|
|
|
*/
|
|
|
|
OBJ_RELEASE(output);
|
2013-03-28 01:14:43 +04:00
|
|
|
OPAL_OUTPUT_VERBOSE((20, orte_iof_base_framework.framework_output,
|
2008-12-10 23:40:47 +03:00
|
|
|
"%s iof:hnp closing fd %d on write event due to negative bytes written",
|
2009-03-06 00:50:47 +03:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), wev->fd));
|
2008-12-10 23:40:47 +03:00
|
|
|
OBJ_RELEASE(wev);
|
|
|
|
sink->wev = NULL;
|
2013-02-13 05:53:12 +04:00
|
|
|
return;
|
2008-10-24 05:42:58 +04:00
|
|
|
} else if (num_written < output->numbytes) {
|
2013-03-28 01:14:43 +04:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_iof_base_framework.framework_output,
|
2008-12-10 23:40:47 +03:00
|
|
|
"%s hnp:stdin:write:handler incomplete write %d - adjusting data",
|
2009-03-06 00:50:47 +03:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), num_written));
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
/* incomplete write - adjust data to avoid duplicate output */
|
|
|
|
memmove(output->data, &output->data[num_written], output->numbytes - num_written);
|
|
|
|
/* push this item back on the front of the list */
|
|
|
|
opal_list_prepend(&wev->outputs, item);
|
|
|
|
/* leave the write event running so it will call us again
|
2015-06-24 06:59:57 +03:00
|
|
|
* when the fd is ready.
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
*/
|
2008-12-10 23:40:47 +03:00
|
|
|
wev->pending = true;
|
2017-06-06 01:22:28 +03:00
|
|
|
ORTE_POST_OBJECT(wev);
|
2012-04-06 18:23:13 +04:00
|
|
|
opal_event_add(wev->ev, 0);
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
goto CHECK;
|
|
|
|
}
|
|
|
|
OBJ_RELEASE(output);
|
|
|
|
}
|
2008-12-10 23:40:47 +03:00
|
|
|
|
2017-06-06 01:22:28 +03:00
|
|
|
CHECK:
|
2008-12-10 23:40:47 +03:00
|
|
|
if (NULL != mca_iof_hnp_component.stdinev &&
|
2009-02-27 12:31:34 +03:00
|
|
|
!orte_abnormal_term_ordered &&
|
2008-12-10 23:40:47 +03:00
|
|
|
!mca_iof_hnp_component.stdinev->active) {
|
2013-03-28 01:14:43 +04:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_iof_base_framework.framework_output,
|
2008-10-23 23:11:05 +04:00
|
|
|
"read event is off - checking if okay to restart"));
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
/* if we have turned off the read event, check to
|
|
|
|
* see if the output list has shrunk enough to
|
|
|
|
* turn it back on
|
|
|
|
*
|
|
|
|
* RHC: Note that when multiple procs want stdin, we
|
|
|
|
* can get into a fight between a proc turnin stdin
|
|
|
|
* back "on" and other procs turning it "off". There
|
|
|
|
* is no clear way to resolve this as different procs
|
|
|
|
* may take input at different rates.
|
|
|
|
*/
|
|
|
|
if (opal_list_get_size(&wev->outputs) < ORTE_IOF_MAX_INPUT_BUFFERS) {
|
|
|
|
/* restart the read */
|
2013-03-28 01:14:43 +04:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_iof_base_framework.framework_output,
|
2008-10-23 23:11:05 +04:00
|
|
|
"restarting read event"));
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
mca_iof_hnp_component.stdinev->active = true;
|
2017-06-06 01:22:28 +03:00
|
|
|
ORTE_POST_OBJECT(mca_iof_hnp_component.stdinev);
|
2012-04-06 18:23:13 +04:00
|
|
|
opal_event_add(mca_iof_hnp_component.stdinev->ev, 0);
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 04:00:49 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-01-05 20:46:05 +03:00
|
|
|
|
|
|
|
static int hnp_output(const orte_process_name_t* peer,
|
|
|
|
orte_iof_tag_t source_tag,
|
|
|
|
const char *msg)
|
|
|
|
{
|
|
|
|
/* output this to our local output */
|
|
|
|
if (ORTE_IOF_STDOUT & source_tag || orte_xml_output) {
|
|
|
|
orte_iof_base_write_output(peer, source_tag, (const unsigned char*)msg, strlen(msg), orte_iof_base.iof_write_stdout->wev);
|
|
|
|
} else {
|
|
|
|
orte_iof_base_write_output(peer, source_tag, (const unsigned char*)msg, strlen(msg), orte_iof_base.iof_write_stderr->wev);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|