2008-02-28 04:57:57 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2011-06-24 00:38:02 +04:00
|
|
|
* Copyright (c) 2004-2011 The University of Tennessee and The University
|
2008-02-28 04:57:57 +03:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2011-11-03 08:04:32 +04:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2008-02-28 04:57:57 +03:00
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2011-11-03 08:04:32 +04:00
|
|
|
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
|
2013-03-28 01:14:43 +04:00
|
|
|
* Copyright (c) 2011-2013 Los Alamos National Security, LLC.
|
2011-11-03 08:04:32 +04:00
|
|
|
* All rights reserved.
|
2008-02-28 04:57:57 +03:00
|
|
|
* $COPYRIGHT$
|
2011-11-03 08:04:32 +04:00
|
|
|
*
|
2008-02-28 04:57:57 +03:00
|
|
|
* Additional copyrights may follow
|
2011-11-03 08:04:32 +04:00
|
|
|
*
|
2008-02-28 04:57:57 +03:00
|
|
|
* $HEADER$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "orte_config.h"
|
|
|
|
#include "orte/constants.h"
|
|
|
|
|
2012-01-19 00:56:53 +04:00
|
|
|
#if defined(HAVE_CNOS_MPI_OS_H)
|
|
|
|
#include "cnos_mpi_os.h"
|
|
|
|
#elif defined(HAVE_CATAMOUNT_CNOS_MPI_OS_H)
|
|
|
|
#include "catamount/cnos_mpi_os.h"
|
2009-11-09 17:26:24 +03:00
|
|
|
#endif
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2008-06-09 18:53:58 +04:00
|
|
|
#include "orte/util/show_help.h"
|
2009-05-16 08:15:55 +04:00
|
|
|
#include "opal/util/argv.h"
|
2008-02-28 04:57:57 +03:00
|
|
|
|
|
|
|
#include "orte/util/proc_info.h"
|
|
|
|
#include "orte/mca/errmgr/base/base.h"
|
|
|
|
#include "orte/util/name_fns.h"
|
2008-11-03 19:23:42 +03:00
|
|
|
#include "orte/util/nidmap.h"
|
2011-08-13 01:02:48 +04:00
|
|
|
#include "orte/util/regex.h"
|
2008-02-28 04:57:57 +03:00
|
|
|
#include "orte/runtime/orte_globals.h"
|
|
|
|
|
|
|
|
#include "orte/mca/ess/ess.h"
|
|
|
|
#include "orte/mca/ess/base/base.h"
|
|
|
|
#include "orte/mca/ess/alps/ess_alps.h"
|
|
|
|
|
2011-11-06 21:28:40 +04:00
|
|
|
#include <errno.h>
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
static int alps_set_name(void);
|
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);
|
|
|
|
|
|
|
|
orte_ess_base_module_t orte_ess_alps_module = {
|
|
|
|
rte_init,
|
|
|
|
rte_finalize,
|
2008-03-05 07:57:23 +03:00
|
|
|
orte_ess_base_app_abort,
|
|
|
|
NULL /* ft_event */
|
2008-02-28 04:57:57 +03:00
|
|
|
};
|
|
|
|
|
2011-11-03 08:04:32 +04:00
|
|
|
/* Local variables */
|
|
|
|
static orte_vpid_t starting_vpid = 0;
|
|
|
|
|
2009-05-04 15:07:40 +04:00
|
|
|
static int rte_init(void)
|
2008-02-28 04:57:57 +03:00
|
|
|
{
|
2011-08-18 18:59:18 +04:00
|
|
|
int ret, i;
|
2008-02-28 04:57:57 +03:00
|
|
|
char *error = NULL;
|
2009-05-16 08:15:55 +04:00
|
|
|
char **hosts = NULL;
|
2008-04-30 23:49:53 +04: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;
|
|
|
|
}
|
2011-11-03 08:04:32 +04:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* Start by getting a unique name */
|
|
|
|
alps_set_name();
|
2011-11-03 08:04:32 +04:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* if I am a daemon, complete my setup using the
|
|
|
|
* default procedure
|
|
|
|
*/
|
2009-05-04 15:07:40 +04:00
|
|
|
if (ORTE_PROC_IS_DAEMON) {
|
2011-08-13 01:02:48 +04:00
|
|
|
if (NULL != orte_node_regex) {
|
|
|
|
/* extract the nodes */
|
2011-11-03 08:04:32 +04:00
|
|
|
if (ORTE_SUCCESS != (ret =
|
|
|
|
orte_regex_extract_node_names(orte_node_regex, &hosts)) ||
|
2011-08-18 18:59:18 +04:00
|
|
|
NULL == hosts) {
|
2011-08-13 01:02:48 +04:00
|
|
|
error = "orte_regex_extract_node_names";
|
|
|
|
goto error;
|
|
|
|
}
|
2011-10-28 17:39:32 +04:00
|
|
|
|
|
|
|
/* find our host in the list */
|
|
|
|
for (i=0; NULL != hosts[i]; i++) {
|
2011-11-03 08:04:32 +04:00
|
|
|
if (0 == strncmp(hosts[i], orte_process_info.nodename,
|
|
|
|
strlen(hosts[i]))) {
|
2011-10-28 17:39:32 +04:00
|
|
|
/* correct our vpid */
|
|
|
|
ORTE_PROC_MY_NAME->vpid = starting_vpid + i;
|
2013-03-28 01:14:43 +04:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_ess_base_framework.framework_output,
|
2011-10-28 17:39:32 +04:00
|
|
|
"ess:alps reset name to %s",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
|
|
|
break;
|
|
|
|
}
|
2011-08-18 18:59:18 +04:00
|
|
|
}
|
|
|
|
}
|
2009-05-16 08:15:55 +04:00
|
|
|
if (ORTE_SUCCESS != (ret = orte_ess_base_orted_setup(hosts))) {
|
2008-02-28 04:57:57 +03:00
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_ess_base_orted_setup";
|
|
|
|
goto error;
|
|
|
|
}
|
2009-05-16 08:15:55 +04:00
|
|
|
opal_argv_free(hosts);
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
if (ORTE_PROC_IS_TOOL) {
|
2008-02-28 04:57:57 +03:00
|
|
|
/* otherwise, if I am a tool proc, use that procedure */
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_ess_base_tool_setup())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_ess_base_tool_setup";
|
|
|
|
goto error;
|
|
|
|
}
|
2008-11-01 00:10:00 +03:00
|
|
|
/* as a tool, I don't need a nidmap - so just return now */
|
|
|
|
return ORTE_SUCCESS;
|
2009-05-16 08:15:55 +04:00
|
|
|
}
|
|
|
|
/* otherwise, I must be an application process - use
|
|
|
|
* the default procedure to finish my setup
|
|
|
|
*/
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_ess_base_app_setup())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_ess_base_app_setup";
|
|
|
|
goto error;
|
2008-11-01 00:10:00 +03:00
|
|
|
}
|
|
|
|
/* setup the nidmap arrays */
|
2011-11-03 08:04:32 +04:00
|
|
|
if (ORTE_SUCCESS !=
|
|
|
|
(ret = orte_util_nidmap_init(orte_process_info.sync_buf))) {
|
2008-11-01 00:10:00 +03:00
|
|
|
ORTE_ERROR_LOG(ret);
|
2009-01-07 17:58:38 +03:00
|
|
|
error = "orte_util_nidmap_init";
|
2008-11-01 00:10:00 +03:00
|
|
|
goto error;
|
2008-02-28 04:57:57 +03:00
|
|
|
}
|
2011-11-03 08:04:32 +04:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
return ORTE_SUCCESS;
|
2011-11-03 08:04:32 +04:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
error:
|
2011-11-23 01:24:35 +04:00
|
|
|
if (ORTE_ERR_SILENT != ret && !orte_report_silent_errors) {
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
int ret;
|
2011-11-03 08:04:32 +04:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
/* if I am a daemon, finalize using the default procedure */
|
2009-05-04 15:07:40 +04:00
|
|
|
if (ORTE_PROC_IS_DAEMON) {
|
2008-02-28 04:57:57 +03:00
|
|
|
if (ORTE_SUCCESS != (ret = orte_ess_base_orted_finalize())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
}
|
2009-05-04 15:07:40 +04:00
|
|
|
} else if (ORTE_PROC_IS_TOOL) {
|
2008-02-28 04:57:57 +03:00
|
|
|
/* otherwise, if I am a tool proc, use that procedure */
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_ess_base_tool_finalize())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
}
|
2008-11-01 00:10:00 +03:00
|
|
|
/* as a tool, I didn't create a nidmap - so just return now */
|
|
|
|
return ret;
|
2008-02-28 04:57:57 +03:00
|
|
|
} else {
|
2008-11-01 00:10:00 +03:00
|
|
|
/* otherwise, I must be an application process
|
|
|
|
* use the default procedure to finish
|
Repair the MPI-2 dynamic operations. This includes:
1. repair of the linear and direct routed modules
2. repair of the ompi/pubsub/orte module to correctly init routes to the ompi-server, and correctly handle failure to correctly parse the provided ompi-server URI
3. modification of orterun to accept both "file" and "FILE" for designating where the ompi-server URI is to be found - purely a convenience feature
4. resolution of a message ordering problem during the connect/accept handshake that allowed the "send-first" proc to attempt to send to the "recv-first" proc before the HNP had actually updated its routes.
Let this be a further reminder to all - message ordering is NOT guaranteed in the OOB
5. Repair the ompi/dpm/orte module to correctly init routes during connect/accept.
Reminder to all: messages sent to procs in another job family (i.e., started by a different mpirun) are ALWAYS routed through the respective HNPs. As per the comments in orte/routed, this is REQUIRED to maintain connect/accept (where only the root proc on each side is capable of init'ing the routes), allow communication between mpirun's using different routing modules, and to minimize connections on tools such as ompi-server. It is all taken care of "under the covers" by the OOB to ensure that a route back to the sender is maintained, even when the different mpirun's are using different routed modules.
6. corrections in the orte/odls to ensure proper identification of daemons participating in a dynamic launch
7. corrections in build/nidmap to support update of an existing nidmap during dynamic launch
8. corrected implementation of the update_arch function in the ESS, along with consolidation of a number of ESS operations into base functions for easier maintenance. The ability to support info from multiple jobs was added, although we don't currently do so - this will come later to support further fault recovery strategies
9. minor updates to several functions to remove unnecessary and/or no longer used variables and envar's, add some debugging output, etc.
10. addition of a new macro ORTE_PROC_IS_DAEMON that resolves to true if the provided proc is a daemon
There is still more cleanup to be done for efficiency, but this at least works.
Tested on single-node Mac, multi-node SLURM via odin. Tests included connect/accept, publish/lookup/unpublish, comm_spawn, comm_spawn_multiple, and singleton comm_spawn.
Fixes ticket #1256
This commit was SVN r18804.
2008-07-03 21:53:37 +04:00
|
|
|
*/
|
2008-02-28 04:57:57 +03:00
|
|
|
if (ORTE_SUCCESS != (ret = orte_ess_base_app_finalize())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
}
|
|
|
|
}
|
2011-11-03 08:04:32 +04:00
|
|
|
|
2008-11-01 00:10:00 +03:00
|
|
|
/* deconstruct my nidmap and jobmap arrays */
|
2009-01-07 17:58:38 +03:00
|
|
|
orte_util_nidmap_finalize();
|
2011-11-03 08:04:32 +04:00
|
|
|
|
|
|
|
return ret;
|
2008-02-28 04:57:57 +03:00
|
|
|
}
|
|
|
|
|
2013-03-28 01:09:41 +04:00
|
|
|
static char *orte_ess_alps_jobid = NULL;
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
static int alps_set_name(void)
|
|
|
|
{
|
|
|
|
int rc;
|
|
|
|
orte_jobid_t jobid;
|
2011-11-03 08:04:32 +04:00
|
|
|
|
2013-03-28 01:14:43 +04:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_ess_base_framework.framework_output,
|
2008-02-28 04:57:57 +03:00
|
|
|
"ess:alps setting name"));
|
2011-11-03 08:04:32 +04:00
|
|
|
|
2013-03-28 01:09:41 +04:00
|
|
|
if (NULL == orte_ess_base_jobid) {
|
2008-02-28 04:57:57 +03:00
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
|
|
|
return ORTE_ERR_NOT_FOUND;
|
|
|
|
}
|
2013-03-28 01:09:41 +04:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_jobid(&jobid, orte_ess_base_jobid))) {
|
2008-02-28 04:57:57 +03:00
|
|
|
ORTE_ERROR_LOG(rc);
|
2011-11-03 08:04:32 +04:00
|
|
|
return rc;
|
2008-02-28 04:57:57 +03:00
|
|
|
}
|
2011-11-03 08:04:32 +04:00
|
|
|
|
2013-03-28 01:09:41 +04:00
|
|
|
if (NULL == orte_ess_base_vpid) {
|
2008-02-28 04:57:57 +03:00
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
|
|
|
return ORTE_ERR_NOT_FOUND;
|
|
|
|
}
|
2011-11-03 08:04:32 +04:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_vpid(&starting_vpid,
|
2013-03-28 01:09:41 +04:00
|
|
|
orte_ess_base_vpid))) {
|
2008-02-28 04:57:57 +03:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return(rc);
|
|
|
|
}
|
2011-11-03 08:04:32 +04:00
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
ORTE_PROC_MY_NAME->jobid = jobid;
|
2012-01-19 00:56:53 +04:00
|
|
|
ORTE_PROC_MY_NAME->vpid = (orte_vpid_t)cnos_get_rank() + starting_vpid;
|
2011-11-03 08:04:32 +04:00
|
|
|
|
2013-03-28 01:14:43 +04:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_ess_base_framework.framework_output,
|
2011-11-03 08:04:32 +04:00
|
|
|
"ess:alps set name to %s",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
|
|
|
|
2011-08-18 18:59:18 +04:00
|
|
|
/* get the num procs as provided in the cmd line param */
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_ess_env_get())) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
2009-05-16 08:15:55 +04:00
|
|
|
}
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2011-06-24 00:38:02 +04:00
|
|
|
if (orte_process_info.max_procs < orte_process_info.num_procs) {
|
|
|
|
orte_process_info.max_procs = orte_process_info.num_procs;
|
|
|
|
}
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|