2005-03-14 23:57:21 +03:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2006-08-23 07:32:36 +04:00
|
|
|
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
2005-11-05 22:57:48 +03:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2005-03-14 23:57:21 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2006-05-16 18:14:12 +04:00
|
|
|
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
2007-06-05 07:03:59 +04:00
|
|
|
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
|
|
|
|
* reserved.
|
2005-03-14 23:57:21 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*
|
|
|
|
* These symbols are in a file by themselves to provide nice linker
|
|
|
|
* semantics. Since linkers generally pull in symbols by object
|
|
|
|
* files, keeping these symbols as the only symbols in this file
|
|
|
|
* prevents utility programs such as "ompi_info" from having to import
|
|
|
|
* entire components just to query their version and parameters.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "orte_config.h"
|
2008-02-28 04:57:57 +03:00
|
|
|
#include "orte/constants.h"
|
|
|
|
#include "orte/types.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
|
|
|
#if HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
|
|
|
#include <signal.h>
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
2005-03-18 06:43:59 +03:00
|
|
|
#include <sys/types.h>
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
#endif
|
2007-08-14 22:44:52 +04:00
|
|
|
#ifdef HAVE_SYS_STAT_H
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#endif
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
#ifdef HAVE_SYS_WAIT_H
|
2005-03-18 06:43:59 +03:00
|
|
|
#include <sys/wait.h>
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
#endif
|
2005-08-19 20:49:59 +04:00
|
|
|
#ifdef HAVE_SCHED_H
|
|
|
|
#include <sched.h>
|
|
|
|
#endif
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
#ifdef HAVE_SYS_TIME_H
|
|
|
|
#include <sys/time.h>
|
|
|
|
#endif
|
2005-08-19 20:49:59 +04:00
|
|
|
#include <errno.h>
|
|
|
|
#include <tm.h>
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2007-04-21 04:15:05 +04:00
|
|
|
#include "opal/mca/installdirs/installdirs.h"
|
2006-09-15 01:29:51 +04:00
|
|
|
#include "opal/threads/condition.h"
|
2006-07-05 00:12:35 +04:00
|
|
|
#include "opal/event/event.h"
|
2005-07-04 04:13:44 +04:00
|
|
|
#include "opal/util/argv.h"
|
2005-07-04 03:31:27 +04:00
|
|
|
#include "opal/util/output.h"
|
2005-07-04 05:36:20 +04:00
|
|
|
#include "opal/util/opal_environ.h"
|
2005-10-02 15:58:18 +04:00
|
|
|
#include "opal/util/show_help.h"
|
2005-10-04 23:38:51 +04:00
|
|
|
#include "opal/util/path.h"
|
2006-05-16 18:14:12 +04:00
|
|
|
#include "opal/util/basename.h"
|
2005-08-25 02:20:51 +04:00
|
|
|
#include "opal/mca/base/mca_base_param.h"
|
2005-08-19 20:49:59 +04:00
|
|
|
#include "opal/runtime/opal_progress.h"
|
2006-09-15 01:29:51 +04:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
#include "orte/util/name_fns.h"
|
|
|
|
#include "orte/runtime/orte_globals.h"
|
2005-08-25 02:20:51 +04:00
|
|
|
#include "orte/runtime/orte_wait.h"
|
|
|
|
#include "orte/mca/errmgr/errmgr.h"
|
2006-10-07 19:45:24 +04:00
|
|
|
#include "orte/mca/rmaps/rmaps.h"
|
2006-09-15 01:29:51 +04:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
#include "orte/mca/plm/plm.h"
|
|
|
|
#include "orte/mca/plm/base/plm_private.h"
|
|
|
|
#include "plm_tm.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
|
|
|
|
2006-07-05 00:12:35 +04:00
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
/*
|
|
|
|
* Local functions
|
|
|
|
*/
|
2008-02-28 04:57:57 +03:00
|
|
|
static int plm_tm_init(void);
|
|
|
|
static int plm_tm_launch_job(orte_job_t *jdata);
|
|
|
|
static int plm_tm_terminate_job(orte_jobid_t jobid);
|
|
|
|
static int plm_tm_terminate_orteds(void);
|
|
|
|
static int plm_tm_signal_job(orte_jobid_t jobid, int32_t signal);
|
|
|
|
static int plm_tm_finalize(void);
|
2006-09-15 01:29:51 +04:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
static int plm_tm_connect(void);
|
|
|
|
static int plm_tm_disconnect(void);
|
2006-09-15 01:29:51 +04:00
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
/*
|
|
|
|
* Global variable
|
|
|
|
*/
|
2008-02-28 04:57:57 +03:00
|
|
|
orte_plm_base_module_t orte_plm_tm_module = {
|
|
|
|
plm_tm_init,
|
|
|
|
orte_plm_base_set_hnp_name,
|
|
|
|
plm_tm_launch_job,
|
|
|
|
plm_tm_terminate_job,
|
|
|
|
plm_tm_terminate_orteds,
|
|
|
|
plm_tm_signal_job,
|
|
|
|
plm_tm_finalize
|
2005-03-14 23:57:21 +03:00
|
|
|
};
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/**
|
|
|
|
* Init the module
|
|
|
|
*/
|
|
|
|
static int plm_tm_init(void)
|
|
|
|
{
|
|
|
|
int rc;
|
|
|
|
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_plm_base_comm_start())) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
}
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-04-25 00:53:54 +04:00
|
|
|
/* When working in this function, ALWAYS jump to "cleanup" if
|
|
|
|
* you encounter an error so that orterun will be woken up and
|
|
|
|
* the job can cleanly terminate
|
|
|
|
*/
|
2008-02-28 04:57:57 +03:00
|
|
|
static int plm_tm_launch_job(orte_job_t *jdata)
|
2005-03-14 23:57:21 +03:00
|
|
|
{
|
2007-04-25 00:53:54 +04:00
|
|
|
orte_job_map_t *map = NULL;
|
2008-02-28 04:57:57 +03:00
|
|
|
orte_app_context_t **apps;
|
|
|
|
orte_node_t **nodes;
|
2005-08-19 20:49:59 +04:00
|
|
|
int node_name_index;
|
2008-02-28 04:57:57 +03:00
|
|
|
int proc_vpid_index;
|
2007-05-08 17:21:18 +04:00
|
|
|
char *param;
|
2007-04-25 00:53:54 +04:00
|
|
|
char **env = NULL;
|
2006-10-07 19:45:24 +04:00
|
|
|
char *var;
|
2007-04-25 00:53:54 +04:00
|
|
|
char **argv = NULL;
|
2005-08-19 20:49:59 +04:00
|
|
|
int argc;
|
|
|
|
int rc;
|
2005-08-19 22:10:37 +04:00
|
|
|
bool connected = false;
|
2008-02-28 04:57:57 +03:00
|
|
|
orte_std_cntr_t launched = 0, i;
|
2006-05-16 18:14:12 +04:00
|
|
|
char *bin_base = NULL, *lib_base = NULL;
|
2006-09-15 01:29:51 +04:00
|
|
|
tm_event_t *tm_events = NULL;
|
|
|
|
tm_task_id *tm_task_ids = NULL;
|
|
|
|
int local_err;
|
|
|
|
tm_event_t event;
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
struct timeval launchstart, launchstop, completionstart, completionstop;
|
|
|
|
struct timeval jobstart, jobstop;
|
2007-01-25 20:22:01 +03:00
|
|
|
int maxtime=0, mintime=99999999, maxiter = 0, miniter = 0, deltat;
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
float avgtime=0.0;
|
2007-04-25 00:53:54 +04:00
|
|
|
bool failed_launch = true;
|
2007-08-14 22:44:52 +04:00
|
|
|
mode_t current_umask;
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
/* check for timing request - get start time if so */
|
2008-02-28 04:57:57 +03:00
|
|
|
if (orte_timing) {
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
if (0 != gettimeofday(&jobstart, NULL)) {
|
2008-02-28 04:57:57 +03:00
|
|
|
opal_output(0, "plm_tm: could not obtain job start time");
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* create a jobid for this job */
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_plm_base_create_jobid(&jdata->jobid))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output,
|
|
|
|
"%s plm:tm: launching job %s",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_JOBID_PRINT(jdata->jobid)));
|
|
|
|
|
|
|
|
/* setup the job */
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_plm_base_setup_job(jdata))) {
|
2006-11-16 18:11:45 +03:00
|
|
|
ORTE_ERROR_LOG(rc);
|
2007-04-25 00:53:54 +04:00
|
|
|
goto cleanup;
|
2005-08-19 20:49:59 +04:00
|
|
|
}
|
2008-02-28 04:57:57 +03:00
|
|
|
|
|
|
|
/* Get the map for this job */
|
|
|
|
if (NULL == (map = orte_rmaps.get_job_map(jdata->jobid))) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
|
|
|
rc = ORTE_ERR_NOT_FOUND;
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
apps = (orte_app_context_t**)jdata->apps->addr;
|
|
|
|
nodes = (orte_node_t**)map->nodes->addr;
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
if (0 == map->num_new_daemons) {
|
2007-07-12 23:53:18 +04:00
|
|
|
/* have all the daemons we need - launch app */
|
|
|
|
goto launch_apps;
|
2006-09-15 01:29:51 +04:00
|
|
|
}
|
|
|
|
|
2006-07-15 02:04:41 +04:00
|
|
|
/* Allocate a bunch of TM events to use for tm_spawn()ing */
|
2008-02-28 04:57:57 +03:00
|
|
|
tm_events = malloc(sizeof(tm_event_t) * map->num_new_daemons);
|
2006-09-15 01:29:51 +04:00
|
|
|
if (NULL == tm_events) {
|
|
|
|
rc = ORTE_ERR_OUT_OF_RESOURCE;
|
2007-04-25 00:53:54 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
2006-09-15 01:29:51 +04:00
|
|
|
goto cleanup;
|
|
|
|
}
|
2008-02-28 04:57:57 +03:00
|
|
|
tm_task_ids = malloc(sizeof(tm_task_id) * map->num_new_daemons);
|
2006-09-15 01:29:51 +04:00
|
|
|
if (NULL == tm_task_ids) {
|
2006-07-15 02:04:41 +04:00
|
|
|
rc = ORTE_ERR_OUT_OF_RESOURCE;
|
2007-04-25 00:53:54 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
2006-07-15 02:04:41 +04:00
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
2005-08-19 20:49:59 +04:00
|
|
|
/* add the daemon command (as specified by user) */
|
2008-02-28 04:57:57 +03:00
|
|
|
argv = opal_argv_split(mca_plm_tm_component.orted, ' ');
|
2005-10-04 23:38:51 +04:00
|
|
|
argc = opal_argv_count(argv);
|
2005-08-19 20:49:59 +04:00
|
|
|
|
2007-04-10 18:23:32 +04:00
|
|
|
/* Add basic orted command line options */
|
2008-02-28 04:57:57 +03:00
|
|
|
orte_plm_base_orted_append_basic_args(&argc, &argv, "env",
|
|
|
|
&proc_vpid_index,
|
These changes were mostly captured in a prior RFC (except for #2 below) and are aimed specifically at improving startup performance and setting up the remaining modifications described in that RFC.
The commit has been tested for C/R and Cray operations, and on Odin (SLURM, rsh) and RoadRunner (TM). I tried to update all environments, but obviously could not test them. I know that Windows needs some work, and have highlighted what is know to be needed in the odls process component.
This represents a lot of work by Brian, Tim P, Josh, and myself, with much advice from Jeff and others. For posterity, I have appended a copy of the email describing the work that was done:
As we have repeatedly noted, the modex operation in MPI_Init is the single greatest consumer of time during startup. To-date, we have executed that operation as an ORTE stage gate that held the process until a startup message containing all required modex (and OOB contact info - see #3 below) info could be sent to it. Each process would send its data to the HNP's registry, which assembled and sent the message when all processes had reported in.
In addition, ORTE had taken responsibility for monitoring process status as it progressed through a series of "stage gates". The process reported its status at each gate, and ORTE would then send a "release" message once all procs had reported in.
The incoming changes revamp these procedures in three ways:
1. eliminating the ORTE stage gate system and cleanly delineating responsibility between the OMPI and ORTE layers for MPI init/finalize. The modex stage gate (STG1) has been replaced by a collective operation in the modex itself that performs an allgather on the required modex info. The allgather is implemented using the orte_grpcomm framework since the BTL's are not active at that point. At the moment, the grpcomm framework only has a "basic" component analogous to OMPI's "basic" coll framework - I would recommend that the MPI team create additional, more advanced components to improve performance of this step.
The other stage gates have been replaced by orte_grpcomm barrier functions. We tried to use MPI barriers instead (since the BTL's are active at that point), but - as we discussed on the telecon - these are not currently true barriers so the job would hang when we fell through while messages were still in process. Note that the grpcomm barrier doesn't actually resolve that problem, but Brian has pointed out that we are unlikely to ever see it violated. Again, you might want to spend a little time on an advanced barrier algorithm as the one in "basic" is very simplistic.
Summarizing this change: ORTE no longer tracks process state nor has direct responsibility for synchronizing jobs. This is now done via collective operations within the MPI layer, albeit using ORTE collective communication services. I -strongly- urge the MPI team to implement advanced collective algorithms to improve the performance of this critical procedure.
2. reducing the volume of data exchanged during modex. Data in the modex consisted of the process name, the name of the node where that process is located (expressed as a string), plus a string representation of all contact info. The nodename was required in order for the modex to determine if the process was local or not - in addition, some people like to have it to print pretty error messages when a connection failed.
The size of this data has been reduced in three ways:
(a) reducing the size of the process name itself. The process name consisted of two 32-bit fields for the jobid and vpid. This is far larger than any current system, or system likely to exist in the near future, can support. Accordingly, the default size of these fields has been reduced to 16-bits, which means you can have 32k procs in each of 32k jobs. Since the daemons must have a vpid, and we require one daemon/node, this also restricts the default configuration to 32k nodes.
To support any future "mega-clusters", a configuration option --enable-jumbo-apps has been added. This option increases the jobid and vpid field sizes to 32-bits. Someday, if necessary, someone can add yet another option to increase them to 64-bits, I suppose.
(b) replacing the string nodename with an integer nodeid. Since we have one daemon/node, the nodeid corresponds to the local daemon's vpid. This replaces an often lengthy string with only 2 (or at most 4) bytes, a substantial reduction.
(c) when the mca param requesting that nodenames be sent to support pretty error messages, a second mca param is now used to request FQDN - otherwise, the domain name is stripped (by default) from the message to save space. If someone wants to combine those into a single param somehow (perhaps with an argument?), they are welcome to do so - I didn't want to alter what people are already using.
While these may seem like small savings, they actually amount to a significant impact when aggregated across the entire modex operation. Since every proc must receive the modex data regardless of the collective used to send it, just reducing the size of the process name removes nearly 400MBytes of communication from a 32k proc job (admittedly, much of this comm may occur in parallel). So it does add up pretty quickly.
3. routing RML messages to reduce connections. The default messaging system remains point-to-point - i.e., each proc opens a socket to every proc it communicates with and sends its messages directly. A new option uses the orteds as routers - i.e., each proc only opens a single socket to its local orted. All messages are sent from the proc to the orted, which forwards the message to the orted on the node where the intended recipient proc is located - that orted then forwards the message to its local proc (the recipient). This greatly reduces the connection storm we have encountered during startup.
It also has the benefit of removing the sharing of every proc's OOB contact with every other proc. The orted routing tables are populated during launch since every orted gets a map of where every proc is being placed. Each proc, therefore, only needs to know the contact info for its local daemon, which is passed in via the environment when the proc is fork/exec'd by the daemon. This alone removes ~50 bytes/process of communication that was in the current STG1 startup message - so for our 32k proc job, this saves us roughly 32k*50 = 1.6MBytes sent to 32k procs = 51GBytes of messaging.
Note that you can use the new routing method by specifying -mca routed tree - if you so desire. This mode will become the default at some point in the future.
There are a few minor additional changes in the commit that I'll just note in passing:
* propagation of command line mca params to the orteds - fixes ticket #1073. See note there for details.
* requiring of "finalize" prior to "exit" for MPI procs - fixes ticket #1144. See note there for details.
* cleanup of some stale header files
This commit was SVN r16364.
2007-10-05 23:48:23 +04:00
|
|
|
&node_name_index);
|
2005-08-19 20:49:59 +04:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
if (0 < opal_output_get_verbosity(orte_plm_globals.output)) {
|
2005-08-19 20:49:59 +04:00
|
|
|
param = opal_argv_join(argv, ' ');
|
2008-02-28 04:57:57 +03:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output,
|
|
|
|
"%s plm:tm: final top-level argv:\n\t%s",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
(NULL == param) ? "NULL" : param));
|
|
|
|
if (NULL != param) free(param);
|
2005-03-14 23:57:21 +03:00
|
|
|
}
|
2005-03-18 06:43:59 +03:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
rc = plm_tm_connect();
|
2005-08-19 20:49:59 +04:00
|
|
|
if (ORTE_SUCCESS != rc) {
|
|
|
|
goto cleanup;
|
2005-03-18 06:43:59 +03:00
|
|
|
}
|
2005-08-19 22:10:37 +04:00
|
|
|
connected = true;
|
2005-03-18 06:43:59 +03:00
|
|
|
|
2006-05-16 18:14:12 +04:00
|
|
|
/* Figure out the basenames for the libdir and bindir. There is a
|
2008-02-28 04:57:57 +03:00
|
|
|
lengthy comment about this in plm_rsh_module.c explaining all
|
2006-05-16 18:14:12 +04:00
|
|
|
the rationale for how / why we're doing this. */
|
2007-04-21 04:15:05 +04:00
|
|
|
lib_base = opal_basename(opal_install_dirs.libdir);
|
|
|
|
bin_base = opal_basename(opal_install_dirs.bindir);
|
2006-05-16 18:14:12 +04:00
|
|
|
|
2006-10-07 19:45:24 +04:00
|
|
|
/* setup environment */
|
|
|
|
env = opal_argv_copy(environ);
|
|
|
|
|
2007-08-14 22:44:52 +04:00
|
|
|
/* add our umask -- see big note in orted.c */
|
|
|
|
current_umask = umask(0);
|
|
|
|
umask(current_umask);
|
|
|
|
asprintf(&var, "0%o", current_umask);
|
|
|
|
opal_setenv("ORTE_DAEMON_UMASK_VALUE", var, true, &env);
|
2007-08-15 01:12:00 +04:00
|
|
|
free(var);
|
2006-10-20 20:50:13 +04:00
|
|
|
|
2006-10-07 19:45:24 +04:00
|
|
|
/* If we have a prefix, then modify the PATH and
|
|
|
|
LD_LIBRARY_PATH environment variables. We only allow
|
|
|
|
a single prefix to be specified. Since there will
|
|
|
|
always be at least one app_context, we take it from
|
|
|
|
there
|
|
|
|
*/
|
2008-02-28 04:57:57 +03:00
|
|
|
if (NULL != apps[0]->prefix_dir) {
|
2006-10-07 19:45:24 +04:00
|
|
|
char *newenv;
|
|
|
|
|
|
|
|
for (i = 0; NULL != env && NULL != env[i]; ++i) {
|
|
|
|
/* Reset PATH */
|
|
|
|
if (0 == strncmp("PATH=", env[i], 5)) {
|
|
|
|
asprintf(&newenv, "%s/%s:%s",
|
2008-02-28 04:57:57 +03:00
|
|
|
apps[0]->prefix_dir, bin_base, env[i] + 5);
|
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output,
|
|
|
|
"%s plm:tm: resetting PATH: %s",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
newenv));
|
2006-10-07 19:45:24 +04:00
|
|
|
opal_setenv("PATH", newenv, true, &env);
|
|
|
|
free(newenv);
|
|
|
|
}
|
2005-10-02 15:58:18 +04:00
|
|
|
|
2006-10-07 19:45:24 +04:00
|
|
|
/* Reset LD_LIBRARY_PATH */
|
|
|
|
else if (0 == strncmp("LD_LIBRARY_PATH=", env[i], 16)) {
|
|
|
|
asprintf(&newenv, "%s/%s:%s",
|
2008-02-28 04:57:57 +03:00
|
|
|
apps[0]->prefix_dir, lib_base, env[i] + 16);
|
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output,
|
|
|
|
"%s plm:tm: resetting LD_LIBRARY_PATH: %s",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
newenv));
|
2006-10-07 19:45:24 +04:00
|
|
|
opal_setenv("LD_LIBRARY_PATH", newenv, true, &env);
|
|
|
|
free(newenv);
|
|
|
|
}
|
2005-10-02 15:58:18 +04:00
|
|
|
}
|
2006-10-07 19:45:24 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Iterate through each of the nodes and spin
|
|
|
|
* up a daemon.
|
|
|
|
*/
|
2008-02-28 04:57:57 +03:00
|
|
|
for (i = 0; i < map->num_nodes; i++) {
|
|
|
|
orte_node_t* node = nodes[i];
|
|
|
|
char* vpid_string;
|
2006-07-05 00:12:35 +04:00
|
|
|
|
2007-06-14 16:33:34 +04:00
|
|
|
/* if this daemon already exists, don't launch it! */
|
2008-02-28 04:57:57 +03:00
|
|
|
if (node->daemon_launched) {
|
2007-06-14 16:33:34 +04:00
|
|
|
continue;
|
|
|
|
}
|
2007-07-12 23:53:18 +04:00
|
|
|
|
2006-10-07 19:45:24 +04:00
|
|
|
/* setup node name */
|
|
|
|
free(argv[node_name_index]);
|
2008-02-28 04:57:57 +03:00
|
|
|
argv[node_name_index] = strdup(node->name);
|
2006-10-07 19:45:24 +04:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output,
|
|
|
|
"%s plm:tm: launching on node %s",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
node->name));
|
2006-10-07 19:45:24 +04:00
|
|
|
|
|
|
|
/* setup process name */
|
2008-02-28 04:57:57 +03:00
|
|
|
rc = orte_util_convert_vpid_to_string(&vpid_string, nodes[i]->daemon->name.vpid);
|
2006-10-07 19:45:24 +04:00
|
|
|
if (ORTE_SUCCESS != rc) {
|
2008-02-28 04:57:57 +03:00
|
|
|
opal_output(0, "plm:tm: unable to get daemon vpid as string");
|
|
|
|
exit(-1);
|
2006-10-07 19:45:24 +04:00
|
|
|
}
|
2008-02-28 04:57:57 +03:00
|
|
|
free(argv[proc_vpid_index]);
|
|
|
|
argv[proc_vpid_index] = strdup(vpid_string);
|
|
|
|
free(vpid_string);
|
|
|
|
|
2006-10-07 19:45:24 +04:00
|
|
|
/* exec the daemon */
|
2008-02-28 04:57:57 +03:00
|
|
|
if (0 < opal_output_get_verbosity(orte_plm_globals.output)) {
|
2006-10-07 19:45:24 +04:00
|
|
|
param = opal_argv_join(argv, ' ');
|
2008-02-28 04:57:57 +03:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output,
|
|
|
|
"%s plm:tm: executing:\n\t%s",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
(NULL == param) ? "NULL" : param));
|
|
|
|
if (NULL != param) free(param);
|
2005-03-18 06:43:59 +03:00
|
|
|
}
|
2006-10-07 19:45:24 +04:00
|
|
|
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
/* check for timing request - get start time if so */
|
2008-02-28 04:57:57 +03:00
|
|
|
if (orte_timing) {
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
if (0 != gettimeofday(&launchstart, NULL)) {
|
2008-02-28 04:57:57 +03:00
|
|
|
opal_output(0, "plm_tm: could not obtain start time");
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
launchstart.tv_sec = 0;
|
|
|
|
launchstart.tv_usec = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-02-09 18:06:45 +03:00
|
|
|
rc = tm_spawn(argc, argv, env, node->launch_id, tm_task_ids + launched, tm_events + launched);
|
|
|
|
if (TM_SUCCESS != rc) {
|
2008-02-28 04:57:57 +03:00
|
|
|
opal_show_help("help-plm-tm.txt", "tm-spawn-failed",
|
|
|
|
true, argv[0], node->name, node->launch_id);
|
2007-04-25 00:53:54 +04:00
|
|
|
rc = ORTE_ERROR;
|
2006-10-07 19:45:24 +04:00
|
|
|
goto cleanup;
|
|
|
|
}
|
2007-04-25 00:53:54 +04:00
|
|
|
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
/* check for timing request - get stop time and process if so */
|
2008-02-28 04:57:57 +03:00
|
|
|
if (orte_timing) {
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
if (0 != gettimeofday(&launchstop, NULL)) {
|
2008-02-28 04:57:57 +03:00
|
|
|
opal_output(0, "plm_tm: could not obtain stop time");
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
} else {
|
|
|
|
deltat = (launchstop.tv_sec - launchstart.tv_sec)*1000000 +
|
|
|
|
(launchstop.tv_usec - launchstart.tv_usec);
|
2008-02-28 04:57:57 +03:00
|
|
|
avgtime = avgtime + deltat / map->num_new_daemons;
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
if (deltat < mintime) {
|
|
|
|
mintime = deltat;
|
|
|
|
miniter = launched;
|
|
|
|
}
|
|
|
|
if (deltat > maxtime) {
|
|
|
|
maxtime = deltat;
|
|
|
|
maxiter = launched;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-10-07 19:45:24 +04:00
|
|
|
launched++;
|
2007-07-12 23:53:18 +04:00
|
|
|
|
2006-10-07 19:45:24 +04:00
|
|
|
/* Allow some progress to occur */
|
|
|
|
opal_event_loop(OPAL_EVLOOP_NONBLOCK);
|
2006-09-15 01:29:51 +04:00
|
|
|
}
|
2008-02-28 04:57:57 +03:00
|
|
|
|
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output,
|
|
|
|
"%s plm:tm:launch: finished spawning orteds",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
2006-07-05 00:12:35 +04:00
|
|
|
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
/* check for timing request - get start time for launch completion */
|
2008-02-28 04:57:57 +03:00
|
|
|
if (orte_timing) {
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
if (0 != gettimeofday(&completionstart, NULL)) {
|
2008-02-28 04:57:57 +03:00
|
|
|
opal_output(0, "plm_tm: could not obtain completion start time");
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
completionstart.tv_sec = 0;
|
|
|
|
completionstart.tv_usec = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-09-15 01:29:51 +04:00
|
|
|
/* TM poll for all the spawns */
|
|
|
|
for (i = 0; i < launched; ++i) {
|
|
|
|
rc = tm_poll(TM_NULL_EVENT, &event, 1, &local_err);
|
|
|
|
if (TM_SUCCESS != rc) {
|
2006-07-05 00:12:35 +04:00
|
|
|
errno = local_err;
|
2008-02-28 22:58:32 +03:00
|
|
|
opal_output(0, "plm:tm: failed to poll for a spawned daemon, return status = %d", rc);
|
2007-04-25 00:53:54 +04:00
|
|
|
goto cleanup;
|
2005-08-19 20:49:59 +04:00
|
|
|
}
|
2005-03-14 23:57:21 +03:00
|
|
|
}
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
|
2007-07-12 23:53:18 +04:00
|
|
|
/* wait for daemons to callback */
|
2008-02-28 04:57:57 +03:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_plm_base_daemon_callback(map->num_new_daemons))) {
|
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output,
|
|
|
|
"%s plm:tm: daemon launch failed for job %s on error %s",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_JOBID_PRINT(jdata->jobid), ORTE_ERROR_NAME(rc)));
|
2007-07-12 23:53:18 +04:00
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
|
|
|
launch_apps:
|
2008-02-28 04:57:57 +03:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_plm_base_launch_apps(jdata->jobid))) {
|
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output,
|
|
|
|
"%s plm:tm: launch of apps failed for job %s on error %s",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_JOBID_PRINT(jdata->jobid), ORTE_ERROR_NAME(rc)));
|
2007-07-12 23:53:18 +04:00
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
2007-04-25 00:53:54 +04:00
|
|
|
/* if we get here, then everything launched okay - record that fact */
|
|
|
|
failed_launch = false;
|
|
|
|
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
/* check for timing request - get stop time for launch completion and report */
|
2008-02-28 04:57:57 +03:00
|
|
|
if (orte_timing) {
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
if (0 != gettimeofday(&completionstop, NULL)) {
|
2008-02-28 04:57:57 +03:00
|
|
|
opal_output(0, "plm_tm: could not obtain completion stop time");
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
} else {
|
|
|
|
deltat = (launchstop.tv_sec - launchstart.tv_sec)*1000000 +
|
|
|
|
(launchstop.tv_usec - launchstart.tv_usec);
|
2008-02-28 04:57:57 +03:00
|
|
|
opal_output(0, "plm_tm: launch completion required %d usec", deltat);
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
}
|
2008-02-28 04:57:57 +03:00
|
|
|
opal_output(0, "plm_tm: Launch statistics:");
|
|
|
|
opal_output(0, "plm_tm: Average time to launch an orted: %f usec", avgtime);
|
|
|
|
opal_output(0, "plm_tm: Max time to launch an orted: %d usec at iter %d", maxtime, maxiter);
|
|
|
|
opal_output(0, "plm_tm: Min time to launch an orted: %d usec at iter %d", mintime, miniter);
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-07-05 00:12:35 +04:00
|
|
|
cleanup:
|
2007-04-25 00:53:54 +04:00
|
|
|
if (NULL != argv) {
|
|
|
|
opal_argv_free(argv);
|
|
|
|
}
|
|
|
|
if (NULL != env) {
|
|
|
|
opal_argv_free(env);
|
|
|
|
}
|
2006-10-08 02:44:00 +04:00
|
|
|
|
2005-08-19 22:10:37 +04:00
|
|
|
if (connected) {
|
2008-02-28 04:57:57 +03:00
|
|
|
plm_tm_disconnect();
|
2005-08-19 22:10:37 +04:00
|
|
|
}
|
2006-09-15 01:29:51 +04:00
|
|
|
if (NULL != tm_events) {
|
|
|
|
free(tm_events);
|
|
|
|
}
|
|
|
|
if (NULL != tm_task_ids) {
|
|
|
|
free(tm_task_ids);
|
2006-07-15 02:04:41 +04:00
|
|
|
}
|
2006-07-05 00:12:35 +04:00
|
|
|
|
2006-05-16 18:14:12 +04:00
|
|
|
if (NULL != lib_base) {
|
|
|
|
free(lib_base);
|
|
|
|
}
|
|
|
|
if (NULL != bin_base) {
|
|
|
|
free(bin_base);
|
|
|
|
}
|
|
|
|
|
2007-04-25 00:53:54 +04:00
|
|
|
/* check for failed launch - if so, force terminate */
|
|
|
|
if (failed_launch) {
|
2008-02-28 22:58:32 +03:00
|
|
|
orte_plm_base_launch_failed(jdata->jobid, true, -1, 0, ORTE_JOB_STATE_FAILED_TO_START);
|
2006-09-15 01:29:51 +04:00
|
|
|
}
|
2007-04-25 00:53:54 +04:00
|
|
|
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
/* check for timing request - get stop time and process if so */
|
2008-02-28 04:57:57 +03:00
|
|
|
if (orte_timing) {
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
if (0 != gettimeofday(&jobstop, NULL)) {
|
2008-02-28 04:57:57 +03:00
|
|
|
opal_output(0, "plm_tm: could not obtain stop time");
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
} else {
|
|
|
|
deltat = (jobstop.tv_sec - jobstart.tv_sec)*1000000 +
|
|
|
|
(jobstop.tv_usec - jobstart.tv_usec);
|
2008-02-28 04:57:57 +03:00
|
|
|
opal_output(0, "plm_tm: launch of entire job required %d usec", deltat);
|
Bring the timing instrumentation to the trunk.
If you want to look at our launch and MPI process startup times, you can do so with two MCA params:
OMPI_MCA_orte_timing: set it to anything non-zero and you will get the launch time for different steps in the job launch procedure. The degree of detail depends on the launch environment. rsh will provide you with the average, min, and max launch time for the daemons. SLURM block launches the daemon, so you only get the time to launch the daemons and the total time to launch the job. Ditto for bproc. TM looks more like rsh. Only those four environments are currently supported - anyone interested in extending this capability to other environs is welcome to do so. In all cases, you also get the time to setup the job for launch.
OMPI_MCA_ompi_timing: set it to anything non-zero and you will get the time for mpi_init to reach the compound registry command, the time to execute that command, the time to go from our stage1 barrier to the stage2 barrier, and the time to go from the stage2 barrier to the end of mpi_init. This will be output for each process, so you'll have to compile any statistics on your own. Note: if someone develops a nice parser to do so, it would be really appreciated if you could/would share!
This commit was SVN r12302.
2006-10-25 19:27:47 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output,
|
|
|
|
"%s plm:tm:launch: finished",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
|
|
|
|
2005-08-19 20:49:59 +04:00
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
static int plm_tm_terminate_job(orte_jobid_t jobid)
|
2005-08-19 20:49:59 +04:00
|
|
|
{
|
2006-09-15 01:29:51 +04:00
|
|
|
int rc;
|
|
|
|
|
2007-04-25 00:53:54 +04:00
|
|
|
/* order all of the daemons to kill their local procs for this job */
|
2008-02-28 04:57:57 +03:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_plm_base_orted_kill_local_procs(jobid))) {
|
2006-09-15 01:29:51 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
}
|
2007-04-25 00:53:54 +04:00
|
|
|
|
2006-09-15 01:29:51 +04:00
|
|
|
return rc;
|
2005-03-14 23:57:21 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-09-15 01:29:51 +04:00
|
|
|
/**
|
|
|
|
* Terminate the orteds for a given job
|
|
|
|
*/
|
2008-02-28 04:57:57 +03:00
|
|
|
int plm_tm_terminate_orteds(void)
|
2006-09-15 01:29:51 +04:00
|
|
|
{
|
|
|
|
int rc;
|
|
|
|
|
|
|
|
/* now tell them to die! */
|
2008-02-28 04:57:57 +03:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_plm_base_orted_exit())) {
|
2006-09-15 01:29:51 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
}
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
static int plm_tm_signal_job(orte_jobid_t jobid, int32_t signal)
|
2006-06-08 22:27:17 +04:00
|
|
|
{
|
2006-09-15 01:29:51 +04:00
|
|
|
int rc;
|
|
|
|
|
|
|
|
/* order them to pass this signal to their local procs */
|
2008-02-28 04:57:57 +03:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_plm_base_orted_signal_local_procs(jobid, signal))) {
|
2006-09-15 01:29:51 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
}
|
|
|
|
|
|
|
|
return rc;
|
2006-06-08 22:27:17 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
/*
|
|
|
|
* Free stuff
|
|
|
|
*/
|
2008-02-28 04:57:57 +03:00
|
|
|
static int plm_tm_finalize(void)
|
2005-03-14 23:57:21 +03:00
|
|
|
{
|
2006-09-15 01:29:51 +04:00
|
|
|
int rc;
|
|
|
|
|
2005-08-19 20:49:59 +04:00
|
|
|
/* cleanup any pending recvs */
|
2008-02-28 04:57:57 +03:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_plm_base_comm_stop())) {
|
2006-09-15 01:29:51 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
}
|
2005-03-14 23:57:21 +03:00
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
static int plm_tm_connect(void)
|
2005-03-14 23:57:21 +03:00
|
|
|
{
|
2005-08-19 20:49:59 +04:00
|
|
|
int ret;
|
|
|
|
struct tm_roots tm_root;
|
|
|
|
int count, progress;
|
|
|
|
|
|
|
|
/* try a couple times to connect - might get busy signals every
|
|
|
|
now and then */
|
|
|
|
for (count = 0 ; count < 10; ++count) {
|
|
|
|
ret = tm_init(NULL, &tm_root);
|
|
|
|
if (TM_SUCCESS == ret) {
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2005-08-19 20:49:59 +04:00
|
|
|
for (progress = 0 ; progress < 10 ; ++progress) {
|
|
|
|
opal_progress();
|
|
|
|
#if HAVE_SCHED_YIELD
|
|
|
|
sched_yield();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2005-08-19 20:49:59 +04:00
|
|
|
return ORTE_ERR_RESOURCE_BUSY;
|
2005-03-14 23:57:21 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
static int plm_tm_disconnect(void)
|
2005-08-19 20:49:59 +04:00
|
|
|
{
|
|
|
|
tm_finalize();
|
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|