2008-02-28 04:57:57 +03:00
|
|
|
/*
|
2010-03-13 02:57:50 +03:00
|
|
|
* Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
|
2008-02-28 04:57:57 +03:00
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2009-06-24 00:43:45 +04:00
|
|
|
* Copyright (c) 2004-2009 The University of Tennessee and The University
|
2008-02-28 04:57:57 +03:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "orte_config.h"
|
|
|
|
#include "orte/constants.h"
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#ifdef HAVE_FCNTL_H
|
|
|
|
#include <fcntl.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
|
|
|
|
2010-03-23 23:47:41 +03:00
|
|
|
#include "opal/class/opal_list.h"
|
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"
|
2008-02-28 04:57:57 +03:00
|
|
|
#include "opal/runtime/opal.h"
|
|
|
|
#include "opal/runtime/opal_cr.h"
|
|
|
|
|
2010-03-23 23:47:41 +03:00
|
|
|
#include "opal/util/if.h"
|
2008-02-28 04:57:57 +03:00
|
|
|
#include "opal/util/os_path.h"
|
2009-02-14 05:26:12 +03:00
|
|
|
#include "opal/util/output.h"
|
2008-02-28 04:57:57 +03:00
|
|
|
#include "opal/util/malloc.h"
|
2008-08-12 03:48:39 +04:00
|
|
|
#include "opal/util/basename.h"
|
2008-12-22 23:23:05 +03:00
|
|
|
#include "opal/mca/pstat/base/base.h"
|
2009-09-22 19:41:03 +04:00
|
|
|
#include "opal/mca/paffinity/base/base.h"
|
2009-12-01 02:11:25 +03:00
|
|
|
#include "opal/mca/sysinfo/base/base.h"
|
2008-02-28 04:57:57 +03:00
|
|
|
|
|
|
|
#include "orte/mca/rml/base/base.h"
|
2009-02-14 05:26:12 +03:00
|
|
|
#include "orte/mca/rml/rml_types.h"
|
2008-02-28 04:57:57 +03:00
|
|
|
#include "orte/mca/routed/base/base.h"
|
|
|
|
#include "orte/mca/routed/routed.h"
|
|
|
|
#include "orte/mca/errmgr/base/base.h"
|
|
|
|
#include "orte/mca/grpcomm/base/base.h"
|
|
|
|
#include "orte/mca/iof/base/base.h"
|
|
|
|
#include "orte/mca/ras/base/base.h"
|
|
|
|
#include "orte/mca/plm/base/base.h"
|
2010-07-18 01:03:27 +04:00
|
|
|
#include "orte/mca/plm/plm.h"
|
2008-02-28 04:57:57 +03:00
|
|
|
#include "orte/mca/odls/base/base.h"
|
2008-08-07 01:59:21 +04:00
|
|
|
#include "orte/mca/notifier/base/base.h"
|
2009-09-22 04:58:29 +04:00
|
|
|
#include "orte/mca/rmcast/base/base.h"
|
2010-05-03 08:11:03 +04:00
|
|
|
#include "orte/mca/db/base/base.h"
|
2010-04-27 02:15:57 +04:00
|
|
|
#include "orte/mca/sensor/base/base.h"
|
2010-05-05 04:48:43 +04:00
|
|
|
#include "orte/mca/sensor/sensor.h"
|
2010-07-07 03:35:42 +04:00
|
|
|
#include "orte/mca/debugger/base/base.h"
|
2010-07-18 01:03:27 +04:00
|
|
|
#include "orte/mca/debugger/debugger.h"
|
2008-02-28 04:57:57 +03:00
|
|
|
#include "orte/mca/rmaps/base/base.h"
|
2010-03-13 02:57:50 +03:00
|
|
|
#if OPAL_ENABLE_FT_CR == 1
|
2008-02-28 04:57:57 +03:00
|
|
|
#include "orte/mca/snapc/base/base.h"
|
|
|
|
#endif
|
|
|
|
#include "orte/mca/filem/base/base.h"
|
2010-07-18 01:03:27 +04:00
|
|
|
|
|
|
|
#include "orte/util/show_help.h"
|
2008-02-28 04:57:57 +03:00
|
|
|
#include "orte/util/proc_info.h"
|
|
|
|
#include "orte/util/session_dir.h"
|
|
|
|
#include "orte/util/hnp_contact.h"
|
|
|
|
#include "orte/util/name_fns.h"
|
2008-06-09 18:53:58 +04:00
|
|
|
#include "orte/util/show_help.h"
|
2009-09-10 01:00:27 +04:00
|
|
|
#include "orte/util/comm/comm.h"
|
2008-02-28 04:57:57 +03:00
|
|
|
|
|
|
|
#include "orte/runtime/runtime.h"
|
|
|
|
#include "orte/runtime/orte_wait.h"
|
|
|
|
#include "orte/runtime/orte_globals.h"
|
2010-07-18 01:03:27 +04:00
|
|
|
#include "orte/runtime/orte_quit.h"
|
2008-02-28 04:57:57 +03:00
|
|
|
#include "orte/runtime/orte_cr.h"
|
2010-07-18 01:03:27 +04:00
|
|
|
#include "orte/runtime/orte_locks.h"
|
|
|
|
#include "orte/runtime/orte_data_server.h"
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
#include "orte/mca/ess/ess.h"
|
|
|
|
#include "orte/mca/ess/base/base.h"
|
|
|
|
#include "orte/mca/ess/hnp/ess_hnp.h"
|
|
|
|
|
2009-05-04 15:07:40 +04:00
|
|
|
static int rte_init(void);
|
2008-02-28 04:57:57 +03:00
|
|
|
static int rte_finalize(void);
|
|
|
|
static void rte_abort(int status, bool report) __opal_attribute_noreturn__;
|
Per the RFC, extend the current use of the ompi_proc_t flags field (without changing the field itself).
The prior ompi_proc_t structure had a uint8_t flag field in it, where only one
bit was used to flag that a proc was "local". In that context, "local" was
constrained to mean "local to this node".
This commit provides a greater degree of granularity on the term "local", to include tests
to see if the proc is on the same socket, PC board, node, switch, CU (computing
unit), and cluster.
Add #define's to designate which bits stand for which local condition. This
was added to the OPAL layer to avoid conflicting with the proposed movement of
the BTLs. To make it easier to use, a set of macros have been defined - e.g.,
OPAL_PROC_ON_LOCAL_SOCKET - that test the specific bit. These can be used in
the code base to clearly indicate which sense of locality is being considered.
All locations in the code base that looked at the current proc_t field have
been changed to use the new macros.
Also modify the orte_ess modules so that each returns a uint8_t (to match the
ompi_proc_t field) that contains a complete description of the locality of this
proc. Obviously, not all environments will be capable of providing such detailed
info. Thus, getting a "false" from a test for "on_local_socket" may simply
indicate a lack of knowledge.
This commit was SVN r20496.
2009-02-10 05:20:16 +03:00
|
|
|
static uint8_t proc_get_locality(orte_process_name_t *proc);
|
2008-11-01 00:10:00 +03:00
|
|
|
static orte_vpid_t proc_get_daemon(orte_process_name_t *proc);
|
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 char* proc_get_hostname(orte_process_name_t *proc);
|
|
|
|
static orte_local_rank_t proc_get_local_rank(orte_process_name_t *proc);
|
|
|
|
static orte_node_rank_t proc_get_node_rank(orte_process_name_t *proc);
|
2008-11-18 18:35:50 +03:00
|
|
|
static int update_pidmap(opal_byte_object_t *bo);
|
2008-11-01 00:10:00 +03:00
|
|
|
static int update_nidmap(opal_byte_object_t *bo);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
|
|
|
orte_ess_base_module_t orte_ess_hnp_module = {
|
|
|
|
rte_init,
|
|
|
|
rte_finalize,
|
2008-03-05 07:57:23 +03:00
|
|
|
rte_abort,
|
Per the RFC, extend the current use of the ompi_proc_t flags field (without changing the field itself).
The prior ompi_proc_t structure had a uint8_t flag field in it, where only one
bit was used to flag that a proc was "local". In that context, "local" was
constrained to mean "local to this node".
This commit provides a greater degree of granularity on the term "local", to include tests
to see if the proc is on the same socket, PC board, node, switch, CU (computing
unit), and cluster.
Add #define's to designate which bits stand for which local condition. This
was added to the OPAL layer to avoid conflicting with the proposed movement of
the BTLs. To make it easier to use, a set of macros have been defined - e.g.,
OPAL_PROC_ON_LOCAL_SOCKET - that test the specific bit. These can be used in
the code base to clearly indicate which sense of locality is being considered.
All locations in the code base that looked at the current proc_t field have
been changed to use the new macros.
Also modify the orte_ess modules so that each returns a uint8_t (to match the
ompi_proc_t field) that contains a complete description of the locality of this
proc. Obviously, not all environments will be capable of providing such detailed
info. Thus, getting a "false" from a test for "on_local_socket" may simply
indicate a lack of knowledge.
This commit was SVN r20496.
2009-02-10 05:20:16 +03:00
|
|
|
proc_get_locality,
|
2008-11-01 00:10:00 +03:00
|
|
|
proc_get_daemon,
|
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
|
|
|
proc_get_hostname,
|
|
|
|
proc_get_local_rank,
|
|
|
|
proc_get_node_rank,
|
2008-11-18 18:35:50 +03:00
|
|
|
update_pidmap,
|
2008-11-01 00:10:00 +03:00
|
|
|
update_nidmap,
|
2010-03-23 23:47:41 +03:00
|
|
|
orte_ess_base_query_sys_info,
|
2008-03-05 07:57:23 +03:00
|
|
|
NULL /* ft_event */
|
2008-02-28 04:57:57 +03:00
|
|
|
};
|
|
|
|
|
2010-07-18 01:03:27 +04:00
|
|
|
/* local globals */
|
|
|
|
static bool signals_set=false;
|
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
|
|
|
static opal_event_t term_handler;
|
|
|
|
static opal_event_t int_handler;
|
|
|
|
static opal_event_t epipe_handler;
|
2010-07-18 01:03:27 +04:00
|
|
|
#ifndef __WINDOWS__
|
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
|
|
|
static opal_event_t sigusr1_handler;
|
|
|
|
static opal_event_t sigusr2_handler;
|
|
|
|
static opal_event_t sigtstp_handler;
|
|
|
|
static opal_event_t sigcont_handler;
|
2010-07-18 01:03:27 +04:00
|
|
|
#endif /* __WINDOWS__ */
|
|
|
|
|
|
|
|
static void abort_signal_callback(int fd, short flags, void *arg);
|
|
|
|
static void abort_exit_callback(int fd, short event, void *arg);
|
|
|
|
static void epipe_signal_callback(int fd, short flags, void *arg);
|
|
|
|
static void signal_forward_callback(int fd, short event, void *arg);
|
|
|
|
|
2009-05-04 15:07:40 +04:00
|
|
|
static int rte_init(void)
|
2008-02-28 04:57:57 +03:00
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
char *error = NULL;
|
2008-08-12 03:48:39 +04:00
|
|
|
char *contact_path, *jobfam_dir;
|
2008-02-28 04:57:57 +03:00
|
|
|
orte_job_t *jdata;
|
|
|
|
orte_node_t *node;
|
|
|
|
orte_proc_t *proc;
|
2009-09-22 19:41:03 +04:00
|
|
|
int value;
|
2010-01-26 01:25:13 +03:00
|
|
|
|
2008-06-18 07:15:56 +04:00
|
|
|
/* run the prolog */
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_ess_base_std_prolog())) {
|
|
|
|
error = "orte_ess_base_std_prolog";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
2010-07-18 01:03:27 +04:00
|
|
|
#ifndef __WINDOWS__
|
|
|
|
/* setup callback for SIGPIPE */
|
2010-10-28 19:22:46 +04:00
|
|
|
opal_event_signal_set(opal_event_base, &epipe_handler, SIGPIPE,
|
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
|
|
|
epipe_signal_callback, &epipe_handler);
|
2010-10-28 19:22:46 +04:00
|
|
|
opal_event_signal_add(&epipe_handler, NULL);
|
2010-07-18 01:03:27 +04:00
|
|
|
/** setup callbacks for abort signals - from this point
|
|
|
|
* forward, we need to abort in a manner that allows us
|
|
|
|
* to cleanup
|
|
|
|
*/
|
2010-10-28 19:22:46 +04:00
|
|
|
opal_event_signal_set(opal_event_base, &term_handler, SIGTERM,
|
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
|
|
|
abort_signal_callback, &term_handler);
|
2010-10-28 19:22:46 +04:00
|
|
|
opal_event_signal_add(&term_handler, NULL);
|
|
|
|
opal_event_signal_set(opal_event_base, &int_handler, SIGINT,
|
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
|
|
|
abort_signal_callback, &int_handler);
|
2010-10-28 19:22:46 +04:00
|
|
|
opal_event_signal_add(&int_handler, NULL);
|
2010-07-18 01:03:27 +04:00
|
|
|
|
|
|
|
/** setup callbacks for signals we should foward */
|
2010-10-28 19:22:46 +04:00
|
|
|
opal_event_signal_set(opal_event_base, &sigusr1_handler, SIGUSR1,
|
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
|
|
|
signal_forward_callback, &sigusr1_handler);
|
2010-10-28 19:22:46 +04:00
|
|
|
opal_event_signal_add(&sigusr1_handler, NULL);
|
|
|
|
opal_event_signal_set(opal_event_base, &sigusr2_handler, SIGUSR2,
|
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
|
|
|
signal_forward_callback, &sigusr2_handler);
|
2010-10-28 19:22:46 +04:00
|
|
|
opal_event_signal_add(&sigusr2_handler, NULL);
|
2010-07-18 01:03:27 +04:00
|
|
|
if (orte_forward_job_control) {
|
2010-10-28 19:22:46 +04:00
|
|
|
opal_event_signal_set(opal_event_base, &sigtstp_handler, SIGTSTP,
|
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
|
|
|
signal_forward_callback, &sigtstp_handler);
|
2010-10-28 19:22:46 +04:00
|
|
|
opal_event_signal_add(&sigtstp_handler, NULL);
|
|
|
|
opal_event_signal_set(opal_event_base, &sigcont_handler, SIGCONT,
|
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
|
|
|
signal_forward_callback, &sigcont_handler);
|
2010-10-28 19:22:46 +04:00
|
|
|
opal_event_signal_add(&sigcont_handler, NULL);
|
2010-07-18 01:03:27 +04:00
|
|
|
}
|
|
|
|
#endif /* __WINDOWS__ */
|
|
|
|
|
|
|
|
signals_set = true;
|
|
|
|
|
2009-09-22 19:41:03 +04:00
|
|
|
/* determine the topology info */
|
|
|
|
if (0 == orte_default_num_sockets_per_board) {
|
|
|
|
/* we weren't given a number, so try to determine it */
|
|
|
|
if (OPAL_SUCCESS != opal_paffinity_base_get_socket_info(&value)) {
|
|
|
|
/* can't get any info - default to 1 */
|
|
|
|
value = 1;
|
|
|
|
}
|
|
|
|
orte_default_num_sockets_per_board = (uint8_t)value;
|
|
|
|
}
|
|
|
|
if (0 == orte_default_num_cores_per_socket) {
|
|
|
|
/* we weren't given a number, so try to determine it */
|
|
|
|
if (OPAL_SUCCESS != (ret = opal_paffinity_base_get_core_info(0, &value))) {
|
|
|
|
/* don't have topo info - can we at least get #processors? */
|
|
|
|
if (OPAL_SUCCESS != opal_paffinity_base_get_processor_info(&value)) {
|
|
|
|
/* can't get any info - default to 1 */
|
|
|
|
value = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
orte_default_num_cores_per_socket = (uint8_t)value;
|
|
|
|
}
|
|
|
|
|
2009-09-02 22:03:10 +04:00
|
|
|
/* if we are using xml for output, put an mpirun start tag */
|
|
|
|
if (orte_xml_output) {
|
|
|
|
fprintf(orte_xml_fp, "<mpirun>\n");
|
|
|
|
fflush(orte_xml_fp);
|
|
|
|
}
|
|
|
|
|
2008-12-22 23:23:05 +03:00
|
|
|
/* open and setup the opal_pstat framework so we can provide
|
|
|
|
* process stats if requested
|
|
|
|
*/
|
|
|
|
if (ORTE_SUCCESS != (ret = opal_pstat_base_open())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "opal_pstat_base_open";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
if (ORTE_SUCCESS != (ret = opal_pstat_base_select())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_pstat_base_select";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
2009-12-01 02:11:25 +03:00
|
|
|
/* open and setup the local resource discovery framework */
|
|
|
|
if (ORTE_SUCCESS != (ret = opal_sysinfo_base_open())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "opal_sysinfo_base_open";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
if (ORTE_SUCCESS != (ret = opal_sysinfo_base_select())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "opal_sysinfo_base_select";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* Since we are the HNP, then responsibility for
|
|
|
|
* defining the name falls to the PLM component for our
|
|
|
|
* respective environment - hence, we have to open the PLM
|
2009-07-19 21:56:19 +04:00
|
|
|
* first and select that component.
|
2008-02-28 04:57:57 +03:00
|
|
|
*/
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_plm_base_open())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_plm_base_open";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_plm_base_select())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_plm_base_select";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_plm.set_hnp_name())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_plm_set_hnp_name";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Setup the communication infrastructure */
|
2009-09-22 04:58:29 +04:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/*
|
|
|
|
* Runtime Messaging Layer
|
|
|
|
*/
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_rml_base_open())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_rml_base_open";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_rml_base_select())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_rml_base_select";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
* Routed system
|
|
|
|
*/
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_routed_base_open())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_routed_base_open";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_routed_base_select())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_routed_base_select";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
2009-12-15 04:18:27 +03:00
|
|
|
/* multicast */
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_rmcast_base_open())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_rmcast_base_open";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_rmcast_base_select())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_rmcast_base_select";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
2010-02-25 04:11:29 +03:00
|
|
|
/*
|
|
|
|
* Group communications
|
|
|
|
*/
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_grpcomm_base_open())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_grpcomm_base_open";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_grpcomm_base_select())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_grpcomm_base_select";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* Now provide a chance for the PLM
|
|
|
|
* to perform any module-specific init functions. This
|
|
|
|
* needs to occur AFTER the communications are setup
|
|
|
|
* as it may involve starting a non-blocking recv
|
|
|
|
*/
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_plm.init())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_plm_init";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Setup the remaining resource
|
|
|
|
* management and errmgr frameworks - application procs
|
|
|
|
* and daemons do not open these frameworks as they only use
|
|
|
|
* the hnp proxy support in the PLM framework.
|
|
|
|
*/
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_ras_base_open())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_ras_base_open";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_ras_base_select())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_ras_base_find_available";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_rmaps_base_open())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_rmaps_base_open";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_rmaps_base_select())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_rmaps_base_find_available";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_errmgr_base_open())) {
|
|
|
|
error = "orte_errmgr_base_open";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_errmgr_base_select())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_errmgr_base_select";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Open/select the odls */
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_odls_base_open())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_odls_base_open";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_odls_base_select())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_odls_base_select";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* enable communication with the rml */
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_rml.enable_comm())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_rml.enable_comm";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
2010-04-23 08:44:41 +04:00
|
|
|
/* set the communication function */
|
|
|
|
orte_comm = orte_global_comm;
|
|
|
|
|
2009-06-25 07:00:53 +04:00
|
|
|
/* we are an hnp, so update the contact info field for later use */
|
|
|
|
orte_process_info.my_hnp_uri = orte_rml.get_contact_info();
|
|
|
|
|
|
|
|
/* we are also officially a daemon, so better update that field too */
|
|
|
|
orte_process_info.my_daemon_uri = orte_rml.get_contact_info();
|
|
|
|
|
2008-06-18 07:15:56 +04:00
|
|
|
#if !ORTE_DISABLE_FULL_SUPPORT
|
2008-06-09 18:53:58 +04:00
|
|
|
/* setup the orte_show_help system to recv remote output */
|
|
|
|
ret = orte_rml.recv_buffer_nb(ORTE_NAME_WILDCARD, ORTE_RML_TAG_SHOW_HELP,
|
|
|
|
ORTE_RML_NON_PERSISTENT, orte_show_help_recv, NULL);
|
2010-05-18 03:08:56 +04:00
|
|
|
if (ret != ORTE_SUCCESS && OPAL_SOS_GET_ERROR_CODE(ret) != ORTE_ERR_NOT_IMPLEMENTED) {
|
This commit represents a bunch of work on a Mercurial side branch. As
such, the commit message back to the master SVN repository is fairly
long.
= ORTE Job-Level Output Messages =
Add two new interfaces that should be used for all new code throughout
the ORTE and OMPI layers (we already make the search-and-replace on
the existing ORTE / OMPI layers):
* orte_output(): (and corresponding friends ORTE_OUTPUT,
orte_output_verbose, etc.) This function sends the output directly
to the HNP for processing as part of a job-specific output
channel. It supports all the same outputs as opal_output()
(syslog, file, stdout, stderr), but for stdout/stderr, the output
is sent to the HNP for processing and output. More on this below.
* orte_show_help(): This function is a drop-in-replacement for
opal_show_help(), with two differences in functionality:
1. the rendered text help message output is sent to the HNP for
display (rather than outputting directly into the process' stderr
stream)
1. the HNP detects duplicate help messages and does not display them
(so that you don't see the same error message N times, once from
each of your N MPI processes); instead, it counts "new" instances
of the help message and displays a message every ~5 seconds when
there are new ones ("I got X new copies of the help message...")
opal_show_help and opal_output still exist, but they only output in
the current process. The intent for the new orte_* functions is that
they can apply job-level intelligence to the output. As such, we
recommend that all new ORTE and OMPI code use the new orte_*
functions, not thei opal_* functions.
=== New code ===
For ORTE and OMPI programmers, here's what you need to do differently
in new code:
* Do not include opal/util/show_help.h or opal/util/output.h.
Instead, include orte/util/output.h (this one header file has
declarations for both the orte_output() series of functions and
orte_show_help()).
* Effectively s/opal_output/orte_output/gi throughout your code.
Note that orte_output_open() takes a slightly different argument
list (as a way to pass data to the filtering stream -- see below),
so you if explicitly call opal_output_open(), you'll need to
slightly adapt to the new signature of orte_output_open().
* Literally s/opal_show_help/orte_show_help/. The function signature
is identical.
=== Notes ===
* orte_output'ing to stream 0 will do similar to what
opal_output'ing did, so leaving a hard-coded "0" as the first
argument is safe.
* For systems that do not use ORTE's RML or the HNP, the effect of
orte_output_* and orte_show_help will be identical to their opal
counterparts (the additional information passed to
orte_output_open() will be lost!). Indeed, the orte_* functions
simply become trivial wrappers to their opal_* counterparts. Note
that we have not tested this; the code is simple but it is quite
possible that we mucked something up.
= Filter Framework =
Messages sent view the new orte_* functions described above and
messages output via the IOF on the HNP will now optionally be passed
through a new "filter" framework before being output to
stdout/stderr. The "filter" OPAL MCA framework is intended to allow
preprocessing to messages before they are sent to their final
destinations. The first component that was written in the filter
framework was to create an XML stream, segregating all the messages
into different XML tags, etc. This will allow 3rd party tools to read
the stdout/stderr from the HNP and be able to know exactly what each
text message is (e.g., a help message, another OMPI infrastructure
message, stdout from the user process, stderr from the user process,
etc.).
Filtering is not active by default. Filter components must be
specifically requested, such as:
{{{
$ mpirun --mca filter xml ...
}}}
There can only be one filter component active.
= New MCA Parameters =
The new functionality described above introduces two new MCA
parameters:
* '''orte_base_help_aggregate''': Defaults to 1 (true), meaning that
help messages will be aggregated, as described above. If set to 0,
all help messages will be displayed, even if they are duplicates
(i.e., the original behavior).
* '''orte_base_show_output_recursions''': An MCA parameter to help
debug one of the known issues, described below. It is likely that
this MCA parameter will disappear before v1.3 final.
= Known Issues =
* The XML filter component is not complete. The current output from
this component is preliminary and not real XML. A bit more work
needs to be done to configure.m4 search for an appropriate XML
library/link it in/use it at run time.
* There are possible recursion loops in the orte_output() and
orte_show_help() functions -- e.g., if RML send calls orte_output()
or orte_show_help(). We have some ideas how to fix these, but
figured that it was ok to commit before feature freeze with known
issues. The code currently contains sub-optimal workarounds so
that this will not be a problem, but it would be good to actually
solve the problem rather than have hackish workarounds before v1.3 final.
This commit was SVN r18434.
2008-05-14 00:00:55 +04:00
|
|
|
ORTE_ERROR_LOG(ret);
|
2008-06-09 18:53:58 +04:00
|
|
|
error = "setup receive for orte_show_help";
|
This commit represents a bunch of work on a Mercurial side branch. As
such, the commit message back to the master SVN repository is fairly
long.
= ORTE Job-Level Output Messages =
Add two new interfaces that should be used for all new code throughout
the ORTE and OMPI layers (we already make the search-and-replace on
the existing ORTE / OMPI layers):
* orte_output(): (and corresponding friends ORTE_OUTPUT,
orte_output_verbose, etc.) This function sends the output directly
to the HNP for processing as part of a job-specific output
channel. It supports all the same outputs as opal_output()
(syslog, file, stdout, stderr), but for stdout/stderr, the output
is sent to the HNP for processing and output. More on this below.
* orte_show_help(): This function is a drop-in-replacement for
opal_show_help(), with two differences in functionality:
1. the rendered text help message output is sent to the HNP for
display (rather than outputting directly into the process' stderr
stream)
1. the HNP detects duplicate help messages and does not display them
(so that you don't see the same error message N times, once from
each of your N MPI processes); instead, it counts "new" instances
of the help message and displays a message every ~5 seconds when
there are new ones ("I got X new copies of the help message...")
opal_show_help and opal_output still exist, but they only output in
the current process. The intent for the new orte_* functions is that
they can apply job-level intelligence to the output. As such, we
recommend that all new ORTE and OMPI code use the new orte_*
functions, not thei opal_* functions.
=== New code ===
For ORTE and OMPI programmers, here's what you need to do differently
in new code:
* Do not include opal/util/show_help.h or opal/util/output.h.
Instead, include orte/util/output.h (this one header file has
declarations for both the orte_output() series of functions and
orte_show_help()).
* Effectively s/opal_output/orte_output/gi throughout your code.
Note that orte_output_open() takes a slightly different argument
list (as a way to pass data to the filtering stream -- see below),
so you if explicitly call opal_output_open(), you'll need to
slightly adapt to the new signature of orte_output_open().
* Literally s/opal_show_help/orte_show_help/. The function signature
is identical.
=== Notes ===
* orte_output'ing to stream 0 will do similar to what
opal_output'ing did, so leaving a hard-coded "0" as the first
argument is safe.
* For systems that do not use ORTE's RML or the HNP, the effect of
orte_output_* and orte_show_help will be identical to their opal
counterparts (the additional information passed to
orte_output_open() will be lost!). Indeed, the orte_* functions
simply become trivial wrappers to their opal_* counterparts. Note
that we have not tested this; the code is simple but it is quite
possible that we mucked something up.
= Filter Framework =
Messages sent view the new orte_* functions described above and
messages output via the IOF on the HNP will now optionally be passed
through a new "filter" framework before being output to
stdout/stderr. The "filter" OPAL MCA framework is intended to allow
preprocessing to messages before they are sent to their final
destinations. The first component that was written in the filter
framework was to create an XML stream, segregating all the messages
into different XML tags, etc. This will allow 3rd party tools to read
the stdout/stderr from the HNP and be able to know exactly what each
text message is (e.g., a help message, another OMPI infrastructure
message, stdout from the user process, stderr from the user process,
etc.).
Filtering is not active by default. Filter components must be
specifically requested, such as:
{{{
$ mpirun --mca filter xml ...
}}}
There can only be one filter component active.
= New MCA Parameters =
The new functionality described above introduces two new MCA
parameters:
* '''orte_base_help_aggregate''': Defaults to 1 (true), meaning that
help messages will be aggregated, as described above. If set to 0,
all help messages will be displayed, even if they are duplicates
(i.e., the original behavior).
* '''orte_base_show_output_recursions''': An MCA parameter to help
debug one of the known issues, described below. It is likely that
this MCA parameter will disappear before v1.3 final.
= Known Issues =
* The XML filter component is not complete. The current output from
this component is preliminary and not real XML. A bit more work
needs to be done to configure.m4 search for an appropriate XML
library/link it in/use it at run time.
* There are possible recursion loops in the orte_output() and
orte_show_help() functions -- e.g., if RML send calls orte_output()
or orte_show_help(). We have some ideas how to fix these, but
figured that it was ok to commit before feature freeze with known
issues. The code currently contains sub-optimal workarounds so
that this will not be a problem, but it would be good to actually
solve the problem rather than have hackish workarounds before v1.3 final.
This commit was SVN r18434.
2008-05-14 00:00:55 +04:00
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* setup my session directory */
|
2010-03-02 18:18:33 +03:00
|
|
|
if (orte_create_session_dirs) {
|
2008-06-09 18:53:58 +04:00
|
|
|
OPAL_OUTPUT_VERBOSE((2, orte_debug_output,
|
2010-03-02 18:18:33 +03:00
|
|
|
"%s setting up session dir with\n\ttmpdir: %s\n\thost %s",
|
2009-03-06 00:50:47 +03:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
2010-03-02 18:18:33 +03:00
|
|
|
(NULL == orte_process_info.tmpdir_base) ? "UNDEF" : orte_process_info.tmpdir_base,
|
|
|
|
orte_process_info.nodename));
|
|
|
|
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_session_dir(true,
|
|
|
|
orte_process_info.tmpdir_base,
|
|
|
|
orte_process_info.nodename, NULL,
|
|
|
|
ORTE_PROC_MY_NAME))) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_session_dir";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Once the session directory location has been established, set
|
|
|
|
the opal_output hnp file location to be in the
|
|
|
|
proc-specific session directory. */
|
|
|
|
opal_output_set_output_file_info(orte_process_info.proc_session_dir,
|
|
|
|
"output-", NULL, NULL);
|
|
|
|
|
|
|
|
/* save my contact info in a file for others to find */
|
|
|
|
jobfam_dir = opal_dirname(orte_process_info.job_session_dir);
|
|
|
|
contact_path = opal_os_path(false, jobfam_dir, "contact.txt", NULL);
|
|
|
|
free(jobfam_dir);
|
|
|
|
|
2008-06-09 18:53:58 +04:00
|
|
|
OPAL_OUTPUT_VERBOSE((2, orte_debug_output,
|
2010-03-02 18:18:33 +03:00
|
|
|
"%s writing contact file %s",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
contact_path));
|
|
|
|
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_write_hnp_contact_file(contact_path))) {
|
|
|
|
OPAL_OUTPUT_VERBOSE((2, orte_debug_output,
|
|
|
|
"%s writing contact file failed with error %s",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_ERROR_NAME(ret)));
|
|
|
|
} else {
|
|
|
|
OPAL_OUTPUT_VERBOSE((2, orte_debug_output,
|
|
|
|
"%s wrote contact file",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
|
|
|
}
|
|
|
|
free(contact_path);
|
2008-02-28 04:57:57 +03:00
|
|
|
}
|
|
|
|
|
2009-03-03 19:39:13 +03:00
|
|
|
/* setup the global job and node arrays */
|
|
|
|
orte_job_data = OBJ_NEW(opal_pointer_array_t);
|
|
|
|
if (ORTE_SUCCESS != (ret = opal_pointer_array_init(orte_job_data,
|
|
|
|
1,
|
|
|
|
ORTE_GLOBAL_ARRAY_MAX_SIZE,
|
|
|
|
1))) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "setup job array";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
orte_node_pool = OBJ_NEW(opal_pointer_array_t);
|
|
|
|
if (ORTE_SUCCESS != (ret = opal_pointer_array_init(orte_node_pool,
|
|
|
|
ORTE_GLOBAL_ARRAY_BLOCK_SIZE,
|
|
|
|
ORTE_GLOBAL_ARRAY_MAX_SIZE,
|
|
|
|
ORTE_GLOBAL_ARRAY_BLOCK_SIZE))) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "setup node array";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* Setup the job data object for the daemons */
|
|
|
|
/* create and store the job data object */
|
|
|
|
jdata = OBJ_NEW(orte_job_t);
|
|
|
|
jdata->jobid = ORTE_PROC_MY_NAME->jobid;
|
2009-03-03 19:39:13 +03:00
|
|
|
opal_pointer_array_set_item(orte_job_data, 0, jdata);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
|
|
|
/* create and store a node object where we are */
|
|
|
|
node = OBJ_NEW(orte_node_t);
|
2009-03-06 00:56:03 +03:00
|
|
|
node->name = strdup(orte_process_info.nodename);
|
2008-02-28 08:32:23 +03:00
|
|
|
node->index = opal_pointer_array_add(orte_node_pool, node);
|
2010-01-26 01:25:13 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* create and store a proc object for us */
|
|
|
|
proc = OBJ_NEW(orte_proc_t);
|
|
|
|
proc->name.jobid = ORTE_PROC_MY_NAME->jobid;
|
|
|
|
proc->name.vpid = ORTE_PROC_MY_NAME->vpid;
|
2009-03-06 00:56:03 +03:00
|
|
|
proc->pid = orte_process_info.pid;
|
2008-02-28 04:57:57 +03:00
|
|
|
proc->rml_uri = orte_rml.get_contact_info();
|
|
|
|
proc->state = ORTE_PROC_STATE_RUNNING;
|
|
|
|
OBJ_RETAIN(node); /* keep accounting straight */
|
|
|
|
proc->node = node;
|
2008-04-30 23:49:53 +04:00
|
|
|
proc->nodename = node->name;
|
2008-02-28 08:32:23 +03:00
|
|
|
opal_pointer_array_add(jdata->procs, proc);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
|
|
|
/* record that the daemon (i.e., us) is on this node
|
|
|
|
* NOTE: we do not add the proc object to the node's
|
|
|
|
* proc array because we are not an application proc.
|
|
|
|
* Instead, we record it in the daemon field of the
|
|
|
|
* node object
|
|
|
|
*/
|
|
|
|
OBJ_RETAIN(proc); /* keep accounting straight */
|
|
|
|
node->daemon = proc;
|
|
|
|
node->daemon_launched = true;
|
|
|
|
node->state = ORTE_NODE_STATE_UP;
|
|
|
|
|
|
|
|
/* record that the daemon job is running */
|
|
|
|
jdata->num_procs = 1;
|
|
|
|
jdata->state = ORTE_JOB_STATE_RUNNING;
|
|
|
|
|
|
|
|
/* setup the routed info - the selected routed component
|
|
|
|
* will know what to do.
|
|
|
|
*/
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_routed.init_routes(ORTE_PROC_MY_NAME->jobid, NULL))) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_routed.init_routes";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
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 I/O forwarding system - must come after we init routes */
|
2008-02-28 04:57:57 +03:00
|
|
|
if (ORTE_SUCCESS != (ret = orte_iof_base_open())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_iof_base_open";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_iof_base_select())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_iof_base_select";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* setup the FileM */
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_filem_base_open())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_filem_base_open";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_filem_base_select())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_filem_base_select";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
2010-03-13 02:57:50 +03:00
|
|
|
#if OPAL_ENABLE_FT_CR == 1
|
2008-02-28 04:57:57 +03:00
|
|
|
/*
|
|
|
|
* Setup the SnapC
|
|
|
|
*/
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_snapc_base_open())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_snapc_base_open";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
2009-05-04 15:07:40 +04:00
|
|
|
if (ORTE_SUCCESS != (ret = orte_snapc_base_select(ORTE_PROC_IS_HNP, !ORTE_PROC_IS_DAEMON))) {
|
2008-02-28 04:57:57 +03:00
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_snapc_base_select";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* For HNP, ORTE doesn't need the OPAL CR stuff */
|
|
|
|
opal_cr_set_enabled(false);
|
|
|
|
#else
|
|
|
|
opal_cr_set_enabled(false);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Initalize the CR setup
|
|
|
|
* Note: Always do this, even in non-FT builds.
|
|
|
|
* If we don't some user level tools may hang.
|
|
|
|
*/
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_cr_init())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_cr_init";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
2008-08-07 01:59:21 +04:00
|
|
|
/* setup the notifier system */
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_notifier_base_open())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_notifer_open";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_notifier_base_select())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_notifer_select";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
2010-05-03 08:11:03 +04:00
|
|
|
/* setup the db framework */
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_db_base_open())) {
|
2010-03-16 23:59:48 +03:00
|
|
|
ORTE_ERROR_LOG(ret);
|
2010-05-03 08:11:03 +04:00
|
|
|
error = "orte_db_open";
|
2010-03-16 23:59:48 +03:00
|
|
|
goto error;
|
|
|
|
}
|
2010-05-03 08:11:03 +04:00
|
|
|
if (ORTE_SUCCESS != (ret = orte_db_base_select())) {
|
2010-03-16 23:59:48 +03:00
|
|
|
ORTE_ERROR_LOG(ret);
|
2010-05-03 08:11:03 +04:00
|
|
|
error = "orte_db_select";
|
2010-03-16 23:59:48 +03:00
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
2010-04-27 02:15:57 +04:00
|
|
|
/* setup the SENSOR framework */
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_sensor_base_open())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_sensor_open";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_sensor_base_select())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
2010-05-05 04:48:43 +04:00
|
|
|
error = "orte_sensor_select";
|
2010-04-27 02:15:57 +04:00
|
|
|
goto error;
|
|
|
|
}
|
2010-05-05 04:48:43 +04:00
|
|
|
/* start the local sensors */
|
|
|
|
orte_sensor.start(ORTE_PROC_MY_NAME->jobid);
|
|
|
|
|
2010-07-07 03:35:42 +04:00
|
|
|
/* start the debuggers */
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_debugger_base_open())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_debugger_open";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_debugger_base_select())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_debugger_select";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
2009-09-10 01:00:27 +04:00
|
|
|
/* if a tool has launched us and is requesting event reports,
|
|
|
|
* then set its contact info into the comm system
|
|
|
|
*/
|
|
|
|
if (orte_report_events) {
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_util_comm_connect_tool(orte_report_events_uri))) {
|
|
|
|
error = "could not connect to tool";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-06-25 07:00:53 +04:00
|
|
|
/* We actually do *not* want an HNP to voluntarily yield() the
|
|
|
|
processor more than necessary. Orterun already blocks when
|
|
|
|
it is doing nothing, so it doesn't use any more CPU cycles than
|
|
|
|
it should; but when it *is* doing something, we do not want it
|
|
|
|
to be unnecessarily delayed because it voluntarily yielded the
|
|
|
|
processor in the middle of its work.
|
|
|
|
|
|
|
|
For example: when a message arrives at orterun, we want the
|
|
|
|
OS to wake us up in a timely fashion (which most OS's
|
|
|
|
seem good about doing) and then we want orterun to process
|
|
|
|
the message as fast as possible. If orterun yields and lets
|
|
|
|
aggressive MPI applications get the processor back, it may be a
|
|
|
|
long time before the OS schedules orterun to run again
|
|
|
|
(particularly if there is no IO event to wake it up). Hence,
|
|
|
|
routed OOB messages (for example) may be significantly delayed
|
|
|
|
before being delivered to MPI processes, which can be
|
|
|
|
problematic in some scenarios (e.g., COMM_SPAWN, BTL's that
|
|
|
|
require OOB messages for wireup, etc.). */
|
|
|
|
opal_progress_set_yield_when_idle(false);
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
|
|
|
|
error:
|
2010-05-18 03:08:56 +04:00
|
|
|
if (ORTE_ERR_SILENT != OPAL_SOS_GET_ERROR_CODE(ret)) {
|
2008-06-24 21:53:10 +04:00
|
|
|
orte_show_help("help-orte-runtime.txt",
|
|
|
|
"orte_init:startup:internal-failure",
|
|
|
|
true, error, ORTE_ERROR_NAME(ret), ret);
|
|
|
|
}
|
2008-02-28 04:57:57 +03:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rte_finalize(void)
|
|
|
|
{
|
|
|
|
char *contact_path;
|
2009-05-11 18:03:07 +04:00
|
|
|
orte_node_t *node;
|
|
|
|
orte_job_t *job;
|
2009-03-03 19:39:13 +03:00
|
|
|
int i;
|
2009-01-08 17:25:56 +03:00
|
|
|
|
2010-07-18 01:03:27 +04:00
|
|
|
if (signals_set) {
|
|
|
|
/* Remove the epipe handler */
|
2010-10-28 19:22:46 +04:00
|
|
|
opal_event_signal_del(&epipe_handler);
|
2010-07-18 01:03:27 +04:00
|
|
|
/* Remove the TERM and INT signal handlers */
|
2010-10-28 19:22:46 +04:00
|
|
|
opal_event_signal_del(&term_handler);
|
|
|
|
opal_event_signal_del(&int_handler);
|
2010-07-18 01:03:27 +04:00
|
|
|
#ifndef __WINDOWS__
|
|
|
|
/** Remove the USR signal handlers */
|
2010-10-28 19:22:46 +04:00
|
|
|
opal_event_signal_del(&sigusr1_handler);
|
|
|
|
opal_event_signal_del(&sigusr2_handler);
|
2010-07-18 01:03:27 +04:00
|
|
|
if (orte_forward_job_control) {
|
2010-10-28 19:22:46 +04:00
|
|
|
opal_event_signal_del(&sigtstp_handler);
|
|
|
|
opal_event_signal_del(&sigcont_handler);
|
2010-07-18 01:03:27 +04:00
|
|
|
}
|
|
|
|
#endif /* __WINDOWS__ */
|
|
|
|
signals_set = false;
|
|
|
|
}
|
|
|
|
|
2010-07-07 03:35:42 +04:00
|
|
|
/* stop the debuggers */
|
|
|
|
orte_debugger_base_close();
|
|
|
|
|
2010-05-05 04:48:43 +04:00
|
|
|
/* stop the local sensors */
|
|
|
|
orte_sensor.stop(ORTE_PROC_MY_NAME->jobid);
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* remove my contact info file */
|
2009-03-06 00:56:03 +03:00
|
|
|
contact_path = opal_os_path(false, orte_process_info.top_session_dir,
|
2008-02-28 04:57:57 +03:00
|
|
|
"contact.txt", NULL);
|
|
|
|
unlink(contact_path);
|
|
|
|
free(contact_path);
|
|
|
|
|
2010-04-27 02:15:57 +04:00
|
|
|
orte_sensor_base_close();
|
2010-05-03 08:11:03 +04:00
|
|
|
orte_db_base_close();
|
2008-08-07 01:59:21 +04:00
|
|
|
orte_notifier_base_close();
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
orte_cr_finalize();
|
|
|
|
|
2010-03-13 02:57:50 +03:00
|
|
|
#if OPAL_ENABLE_FT_CR == 1
|
2008-02-28 04:57:57 +03:00
|
|
|
orte_snapc_base_close();
|
|
|
|
#endif
|
|
|
|
orte_filem_base_close();
|
|
|
|
|
|
|
|
orte_odls_base_close();
|
|
|
|
|
|
|
|
orte_wait_finalize();
|
|
|
|
orte_iof_base_close();
|
|
|
|
|
|
|
|
/* finalize selected modules so they can de-register
|
|
|
|
* any receives
|
|
|
|
*/
|
|
|
|
orte_ras_base_close();
|
|
|
|
orte_rmaps_base_close();
|
|
|
|
orte_plm_base_close();
|
|
|
|
orte_errmgr_base_close();
|
2010-02-25 04:11:29 +03:00
|
|
|
orte_grpcomm_base_close();
|
|
|
|
|
2009-09-22 04:58:29 +04:00
|
|
|
/* close the multicast */
|
|
|
|
orte_rmcast_base_close();
|
2009-12-15 04:18:27 +03:00
|
|
|
|
2010-02-25 04:11:29 +03:00
|
|
|
/* now can close the rml */
|
2009-12-15 04:18:27 +03:00
|
|
|
orte_routed_base_close();
|
|
|
|
orte_rml_base_close();
|
|
|
|
|
2009-01-08 17:25:56 +03:00
|
|
|
/* if we were doing timing studies, close the timing file */
|
|
|
|
if (orte_timing) {
|
|
|
|
if (stdout != orte_timing_output &&
|
|
|
|
stderr != orte_timing_output) {
|
|
|
|
fclose(orte_timing_output);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-03-03 19:39:13 +03:00
|
|
|
/* cleanup the job and node info arrays */
|
|
|
|
if (NULL != orte_node_pool) {
|
|
|
|
for (i=0; i < orte_node_pool->size; i++) {
|
2009-05-11 18:03:07 +04:00
|
|
|
if (NULL != (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool,i))) {
|
|
|
|
OBJ_RELEASE(node);
|
2009-03-03 19:39:13 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
OBJ_RELEASE(orte_node_pool);
|
|
|
|
}
|
|
|
|
if (NULL != orte_job_data) {
|
|
|
|
for (i=0; i < orte_job_data->size; i++) {
|
2009-05-11 18:03:07 +04:00
|
|
|
if (NULL != (job = (orte_job_t*)opal_pointer_array_get_item(orte_job_data,i))) {
|
|
|
|
OBJ_RELEASE(job);
|
2009-03-03 19:39:13 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
OBJ_RELEASE(orte_job_data);
|
|
|
|
}
|
|
|
|
|
2009-01-08 17:25:56 +03:00
|
|
|
/* finalize the session directory tree */
|
2008-02-28 04:57:57 +03:00
|
|
|
orte_session_dir_finalize(ORTE_PROC_MY_NAME);
|
|
|
|
|
|
|
|
/* clean out the global structures */
|
|
|
|
orte_proc_info_finalize();
|
2009-07-15 23:43:26 +04:00
|
|
|
if (NULL != orte_job_ident) {
|
|
|
|
free(orte_job_ident);
|
|
|
|
}
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2009-09-02 22:03:10 +04:00
|
|
|
/* close the xml output file, if open */
|
|
|
|
if (orte_xml_output) {
|
|
|
|
fprintf(orte_xml_fp, "</mpirun>\n");
|
|
|
|
fflush(orte_xml_fp);
|
|
|
|
if (stdout != orte_xml_fp) {
|
|
|
|
fclose(orte_xml_fp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-12-01 02:11:25 +03:00
|
|
|
/* handle the orted-specific OPAL stuff */
|
|
|
|
opal_sysinfo_base_close();
|
|
|
|
opal_pstat_base_close();
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rte_abort(int status, bool report)
|
|
|
|
{
|
|
|
|
/* do NOT do a normal finalize as this will very likely
|
|
|
|
* hang the process. We are aborting due to an abnormal condition
|
|
|
|
* that precludes normal cleanup
|
|
|
|
*
|
|
|
|
* We do need to do the following bits to make sure we leave a
|
|
|
|
* clean environment. Taken from orte_finalize():
|
|
|
|
* - Assume errmgr cleans up child processes before we exit.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* CRS cleanup since it may have a named pipe and thread active */
|
|
|
|
orte_cr_finalize();
|
|
|
|
|
|
|
|
/* - Clean out the global structures
|
|
|
|
* (not really necessary, but good practice)
|
|
|
|
*/
|
|
|
|
orte_proc_info_finalize();
|
|
|
|
|
2010-05-12 22:11:58 +04:00
|
|
|
/* just exit */
|
2008-06-26 20:10:03 +04:00
|
|
|
exit(status);
|
2008-02-28 04:57:57 +03:00
|
|
|
}
|
|
|
|
|
Per the RFC, extend the current use of the ompi_proc_t flags field (without changing the field itself).
The prior ompi_proc_t structure had a uint8_t flag field in it, where only one
bit was used to flag that a proc was "local". In that context, "local" was
constrained to mean "local to this node".
This commit provides a greater degree of granularity on the term "local", to include tests
to see if the proc is on the same socket, PC board, node, switch, CU (computing
unit), and cluster.
Add #define's to designate which bits stand for which local condition. This
was added to the OPAL layer to avoid conflicting with the proposed movement of
the BTLs. To make it easier to use, a set of macros have been defined - e.g.,
OPAL_PROC_ON_LOCAL_SOCKET - that test the specific bit. These can be used in
the code base to clearly indicate which sense of locality is being considered.
All locations in the code base that looked at the current proc_t field have
been changed to use the new macros.
Also modify the orte_ess modules so that each returns a uint8_t (to match the
ompi_proc_t field) that contains a complete description of the locality of this
proc. Obviously, not all environments will be capable of providing such detailed
info. Thus, getting a "false" from a test for "on_local_socket" may simply
indicate a lack of knowledge.
This commit was SVN r20496.
2009-02-10 05:20:16 +03:00
|
|
|
static uint8_t proc_get_locality(orte_process_name_t *proc)
|
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
|
|
|
{
|
2009-06-27 00:54:58 +04:00
|
|
|
orte_node_t *node;
|
|
|
|
orte_proc_t *myproc;
|
|
|
|
int i;
|
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
|
|
|
|
|
|
|
/* the HNP is always on node=0 of the node array */
|
2009-06-27 01:43:09 +04:00
|
|
|
node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, 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
|
|
|
|
|
|
|
/* cycle through the array of local procs */
|
2009-06-27 00:54:58 +04:00
|
|
|
for (i=0; i < node->procs->size; i++) {
|
|
|
|
if (NULL == (myproc = (orte_proc_t*)opal_pointer_array_get_item(node->procs, i))) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (myproc->name.jobid == proc->jobid &&
|
|
|
|
myproc->name.vpid == proc->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
|
|
|
OPAL_OUTPUT_VERBOSE((2, orte_ess_base_output,
|
|
|
|
"%s ess:hnp: proc %s is LOCAL",
|
2009-03-06 00:50:47 +03:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_NAME_PRINT(proc)));
|
Per the RFC, extend the current use of the ompi_proc_t flags field (without changing the field itself).
The prior ompi_proc_t structure had a uint8_t flag field in it, where only one
bit was used to flag that a proc was "local". In that context, "local" was
constrained to mean "local to this node".
This commit provides a greater degree of granularity on the term "local", to include tests
to see if the proc is on the same socket, PC board, node, switch, CU (computing
unit), and cluster.
Add #define's to designate which bits stand for which local condition. This
was added to the OPAL layer to avoid conflicting with the proposed movement of
the BTLs. To make it easier to use, a set of macros have been defined - e.g.,
OPAL_PROC_ON_LOCAL_SOCKET - that test the specific bit. These can be used in
the code base to clearly indicate which sense of locality is being considered.
All locations in the code base that looked at the current proc_t field have
been changed to use the new macros.
Also modify the orte_ess modules so that each returns a uint8_t (to match the
ompi_proc_t field) that contains a complete description of the locality of this
proc. Obviously, not all environments will be capable of providing such detailed
info. Thus, getting a "false" from a test for "on_local_socket" may simply
indicate a lack of knowledge.
This commit was SVN r20496.
2009-02-10 05:20:16 +03:00
|
|
|
return (OPAL_PROC_ON_NODE | OPAL_PROC_ON_CU | OPAL_PROC_ON_CLUSTER);
|
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_OUTPUT_VERBOSE((2, orte_ess_base_output,
|
2009-01-23 23:46:54 +03:00
|
|
|
"%s ess:hnp: proc %s is REMOTE",
|
2009-03-06 00:50:47 +03:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_NAME_PRINT(proc)));
|
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
|
|
|
|
Per the RFC, extend the current use of the ompi_proc_t flags field (without changing the field itself).
The prior ompi_proc_t structure had a uint8_t flag field in it, where only one
bit was used to flag that a proc was "local". In that context, "local" was
constrained to mean "local to this node".
This commit provides a greater degree of granularity on the term "local", to include tests
to see if the proc is on the same socket, PC board, node, switch, CU (computing
unit), and cluster.
Add #define's to designate which bits stand for which local condition. This
was added to the OPAL layer to avoid conflicting with the proposed movement of
the BTLs. To make it easier to use, a set of macros have been defined - e.g.,
OPAL_PROC_ON_LOCAL_SOCKET - that test the specific bit. These can be used in
the code base to clearly indicate which sense of locality is being considered.
All locations in the code base that looked at the current proc_t field have
been changed to use the new macros.
Also modify the orte_ess modules so that each returns a uint8_t (to match the
ompi_proc_t field) that contains a complete description of the locality of this
proc. Obviously, not all environments will be capable of providing such detailed
info. Thus, getting a "false" from a test for "on_local_socket" may simply
indicate a lack of knowledge.
This commit was SVN r20496.
2009-02-10 05:20:16 +03:00
|
|
|
return OPAL_PROC_NON_LOCAL;
|
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 orte_proc_t* find_proc(orte_process_name_t *proc)
|
|
|
|
{
|
|
|
|
orte_job_t *jdata;
|
|
|
|
|
|
|
|
if (NULL == (jdata = orte_get_job_data_object(proc->jobid))) {
|
|
|
|
return NULL;
|
|
|
|
}
|
2009-06-27 00:54:58 +04:00
|
|
|
|
|
|
|
return (orte_proc_t*)opal_pointer_array_get_item(jdata->procs, proc->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
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-11-01 00:10:00 +03:00
|
|
|
static orte_vpid_t proc_get_daemon(orte_process_name_t *proc)
|
|
|
|
{
|
|
|
|
orte_proc_t *pdata;
|
|
|
|
|
2009-06-24 00:43:45 +04:00
|
|
|
if( ORTE_JOBID_IS_DAEMON(proc->jobid) ) {
|
|
|
|
return proc->vpid;
|
|
|
|
}
|
|
|
|
|
2008-11-01 00:10:00 +03:00
|
|
|
/* get the job data */
|
|
|
|
if (NULL == (pdata = find_proc(proc))) {
|
|
|
|
return ORTE_VPID_INVALID;
|
|
|
|
}
|
|
|
|
|
|
|
|
OPAL_OUTPUT_VERBOSE((2, orte_ess_base_output,
|
2009-01-23 23:46:54 +03:00
|
|
|
"%s ess:hnp: proc %s is hosted by daemon %s",
|
2009-03-06 00:50:47 +03:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_NAME_PRINT(proc),
|
|
|
|
ORTE_VPID_PRINT(pdata->node->daemon->name.vpid)));
|
2008-11-01 00:10:00 +03:00
|
|
|
|
|
|
|
return pdata->node->daemon->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
|
|
|
static char* proc_get_hostname(orte_process_name_t *proc)
|
|
|
|
{
|
|
|
|
orte_proc_t *pdata;
|
|
|
|
|
|
|
|
if (NULL == (pdata = find_proc(proc))) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
OPAL_OUTPUT_VERBOSE((2, orte_ess_base_output,
|
|
|
|
"%s ess:hnp: proc %s is on host %s",
|
2009-03-06 00:50:47 +03:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_NAME_PRINT(proc),
|
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
|
|
|
pdata->node->name));
|
|
|
|
|
|
|
|
return pdata->node->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
static orte_local_rank_t proc_get_local_rank(orte_process_name_t *proc)
|
|
|
|
{
|
|
|
|
orte_proc_t *pdata;
|
|
|
|
|
|
|
|
if (NULL == (pdata = find_proc(proc))) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
2009-01-21 03:19:37 +03:00
|
|
|
return ORTE_LOCAL_RANK_INVALID;
|
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_OUTPUT_VERBOSE((2, orte_ess_base_output,
|
|
|
|
"%s ess:hnp: proc %s has local rank %d",
|
2009-03-06 00:50:47 +03:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_NAME_PRINT(proc),
|
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)pdata->local_rank));
|
|
|
|
|
|
|
|
return pdata->local_rank;
|
|
|
|
}
|
|
|
|
|
|
|
|
static orte_node_rank_t proc_get_node_rank(orte_process_name_t *proc)
|
|
|
|
{
|
|
|
|
orte_proc_t *pdata;
|
|
|
|
|
|
|
|
if (NULL == (pdata = find_proc(proc))) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
2009-01-21 03:19:37 +03:00
|
|
|
return ORTE_NODE_RANK_INVALID;
|
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_OUTPUT_VERBOSE((2, orte_ess_base_output,
|
|
|
|
"%s ess:hnp: proc %s has node rank %d",
|
2009-03-06 00:50:47 +03:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_NAME_PRINT(proc),
|
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)pdata->node_rank));
|
|
|
|
|
|
|
|
return pdata->node_rank;
|
|
|
|
}
|
2008-11-01 00:10:00 +03:00
|
|
|
|
2008-11-18 18:35:50 +03:00
|
|
|
static int update_pidmap(opal_byte_object_t *bo)
|
2008-11-01 00:10:00 +03:00
|
|
|
{
|
|
|
|
/* there is nothing to do here - the HNP can resolve
|
|
|
|
* all requests directly from its internal data. However,
|
|
|
|
* we do need to free the data in the byte object to
|
|
|
|
* be consistent with other modules
|
|
|
|
*/
|
|
|
|
if (NULL != bo && NULL != bo->bytes) {
|
|
|
|
free(bo->bytes);
|
|
|
|
}
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int update_nidmap(opal_byte_object_t *bo)
|
|
|
|
{
|
|
|
|
/* there is nothing to do here - the HNP can resolve
|
|
|
|
* all requests directly from its internal data. However,
|
|
|
|
* we do need to free the data in the byte object to
|
|
|
|
* be consistent with other modules
|
|
|
|
*/
|
|
|
|
if (NULL != bo && NULL != bo->bytes) {
|
|
|
|
free(bo->bytes);
|
|
|
|
}
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
2010-07-18 01:03:27 +04:00
|
|
|
|
|
|
|
static bool forcibly_die=false;
|
|
|
|
|
|
|
|
static void abort_exit_callback(int fd, short ign, void *arg)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
fprintf(stderr, "%s: killing job...\n\n", orte_basename);
|
|
|
|
|
|
|
|
/* since we are being terminated by a user's signal, be
|
|
|
|
* sure to exit with a non-zero exit code - but don't
|
|
|
|
* overwrite any error code from a proc that might have
|
|
|
|
* failed, in case that is why the user ordered us
|
|
|
|
* to terminate
|
|
|
|
*/
|
|
|
|
ORTE_UPDATE_EXIT_STATUS(ORTE_ERROR_DEFAULT_EXIT_CODE);
|
|
|
|
|
|
|
|
/* terminate the job - this will also wakeup orterun so
|
|
|
|
* it can report to the user and kill all the orteds.
|
|
|
|
* Check the jobid, though, just in case the user
|
|
|
|
* hit ctrl-c before we had a chance to setup the
|
|
|
|
* job in the system - in which case there is nothing
|
|
|
|
* to terminate!
|
|
|
|
*/
|
|
|
|
if (!orte_never_launched) {
|
|
|
|
/* if the debuggers were run, clean up */
|
|
|
|
orte_debugger.finalize();
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Turn off the process recovery functionality, if it was enabled.
|
|
|
|
* This keeps the errmgr from trying to recover from the shutdown
|
|
|
|
* procedure.
|
|
|
|
*/
|
|
|
|
orte_enable_recovery = false;
|
|
|
|
|
|
|
|
/* terminate the orteds - they will automatically kill
|
|
|
|
* their local procs
|
|
|
|
*/
|
|
|
|
ret = orte_plm.terminate_orteds();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
/* if the jobid is invalid or we never launched,
|
|
|
|
* there is nothing to do but just clean ourselves
|
|
|
|
* up and exit
|
|
|
|
*/
|
|
|
|
orte_quit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Attempt to terminate the job and wait for callback indicating
|
|
|
|
* the job has been aborted.
|
|
|
|
*/
|
|
|
|
static void abort_signal_callback(int fd, short flags, void *arg)
|
|
|
|
{
|
|
|
|
/* if we have already ordered this once, don't keep
|
|
|
|
* doing it to avoid race conditions
|
|
|
|
*/
|
|
|
|
if (!opal_atomic_trylock(&orte_abort_inprogress_lock)) { /* returns 1 if already locked */
|
|
|
|
if (forcibly_die) {
|
|
|
|
/* kill any local procs */
|
|
|
|
orte_odls.kill_local_procs(NULL);
|
|
|
|
|
|
|
|
/* whack any lingering session directory files from our jobs */
|
|
|
|
orte_session_dir_cleanup(ORTE_JOBID_WILDCARD);
|
|
|
|
|
|
|
|
/* cleanup our data server */
|
|
|
|
orte_data_server_finalize();
|
|
|
|
|
|
|
|
/* exit with a non-zero status */
|
|
|
|
exit(ORTE_ERROR_DEFAULT_EXIT_CODE);
|
|
|
|
}
|
|
|
|
fprintf(stderr, "%s: abort is already in progress...hit ctrl-c again to forcibly terminate\n\n", orte_basename);
|
|
|
|
forcibly_die = true;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* set the global abnormal exit flag so we know not to
|
|
|
|
* use the standard xcast for terminating orteds
|
|
|
|
*/
|
|
|
|
orte_abnormal_term_ordered = true;
|
|
|
|
/* ensure that the forwarding of stdin stops */
|
|
|
|
orte_job_term_ordered = true;
|
|
|
|
|
|
|
|
/* tell us to be quiet - hey, the user killed us with a ctrl-c,
|
|
|
|
* so need to tell them that!
|
|
|
|
*/
|
|
|
|
orte_execute_quiet = true;
|
|
|
|
|
|
|
|
/* We are in an event handler; the job completed procedure
|
|
|
|
will delete the signal handler that is currently running
|
|
|
|
(which is a Bad Thing), so we can't call it directly.
|
|
|
|
Instead, we have to exit this handler and setup to call
|
|
|
|
job_completed() after this. */
|
|
|
|
ORTE_TIMER_EVENT(0, 0, abort_exit_callback);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deal with sigpipe errors
|
|
|
|
*/
|
2010-11-25 18:25:24 +03:00
|
|
|
static int sigpipe_error_count=0;
|
2010-07-18 01:03:27 +04:00
|
|
|
static void epipe_signal_callback(int fd, short flags, void *arg)
|
|
|
|
{
|
2010-11-25 18:25:24 +03:00
|
|
|
sigpipe_error_count++;
|
|
|
|
|
|
|
|
if (10 < sigpipe_error_count) {
|
|
|
|
/* time to abort */
|
2010-11-25 18:32:48 +03:00
|
|
|
opal_output(0, "%s: SIGPIPE detected on fd %d - aborting", orte_basename, fd);
|
2010-11-25 18:25:24 +03:00
|
|
|
abort_exit_callback(0, 0, 0);
|
|
|
|
}
|
|
|
|
|
2010-07-18 01:03:27 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Pass user signals to the remote application processes
|
|
|
|
*/
|
|
|
|
static void signal_forward_callback(int fd, short event, void *arg)
|
|
|
|
{
|
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
|
|
|
opal_event_t *signal = (opal_event_t*)arg;
|
2010-07-18 01:03:27 +04:00
|
|
|
int signum, ret;
|
|
|
|
|
|
|
|
signum = OPAL_EVENT_SIGNAL(signal);
|
|
|
|
if (!orte_execute_quiet){
|
|
|
|
fprintf(stderr, "%s: Forwarding signal %d to job\n",
|
|
|
|
orte_basename, signum);
|
|
|
|
}
|
|
|
|
|
|
|
|
/** send the signal out to the processes, including any descendants */
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_plm.signal_job(ORTE_JOBID_WILDCARD, signum))) {
|
|
|
|
fprintf(stderr, "Signal %d could not be sent to the job (returned %d)",
|
|
|
|
signum, ret);
|
|
|
|
}
|
|
|
|
}
|