
1. generalize orte_rml.xcast to become a general broadcast-like messaging system. Messages can now be sent to any tag on the daemons or processes. Note that any message sent via xcast will be delivered to ALL processes in the specified job - you don't get to pick and choose. At a later date, we will introduce an augmented capability that will use the daemons as relays, but will allow you to send to a specified array of process names. 2. extended orte_rml.xcast so it supports more scalable message routing methodologies. At the moment, we support three: (a) direct, which sends the message directly to all recipients; (b) linear, which sends the message to the local daemon on each node, which then relays it to its own local procs; and (b) binomial, which sends the message via a binomial algo across all the daemons, each of which then relays to its own local procs. The crossover points between the algos are adjustable via MCA param, or you can simply demand that a specific algo be used. 3. orteds no longer exhibit two types of behavior: bootproxy or VM. Orteds now always behave like they are part of a virtual machine - they simply launch a job if mpirun tells them to do so. This is another step towards creating an "orteboot" functionality, but also provided a clean system for supporting message relaying. Note one major impact of this commit: multiple daemons on a node cannot be supported any longer! Only a single daemon/node is now allowed. This commit is known to break support for the following environments: POE, Xgrid, Xcpu, Windows. It has been tested on rsh, SLURM, and Bproc. Modifications for TM support have been made but could not be verified due to machine problems at LANL. Modifications for SGE have been made but could not be verified. The developers for the non-verified environments will be separately notified along with suggestions on how to fix the problems. This commit was SVN r15007.
151 строка
5.6 KiB
C
151 строка
5.6 KiB
C
/*
|
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
|
* University Research and Technology
|
|
* Corporation. All rights reserved.
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
* of Tennessee Research Foundation. All rights
|
|
* reserved.
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
* University of Stuttgart. All rights reserved.
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
* All rights reserved.
|
|
* $COPYRIGHT$
|
|
*
|
|
* Additional copyrights may follow
|
|
*
|
|
* $HEADER$
|
|
*/
|
|
|
|
#include "orte_config.h"
|
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
#include <sys/types.h>
|
|
#endif
|
|
#ifdef HAVE_UNISTD_H
|
|
#include <unistd.h>
|
|
#endif
|
|
|
|
#include "opal/mca/base/mca_base_param.h"
|
|
#include "opal/util/output.h"
|
|
#include "orte/orte_constants.h"
|
|
#include "orte/mca/sds/base/base.h"
|
|
#include "orte/util/proc_info.h"
|
|
#include "orte/runtime/runtime.h"
|
|
#include "orte/mca/errmgr/base/base.h"
|
|
#include "orte/mca/ns/ns.h"
|
|
#include "orte/mca/ns/base/base.h"
|
|
|
|
int
|
|
orte_sds_base_basic_contact_universe(void)
|
|
{
|
|
int ret, rc, exit_if_not_exist;
|
|
orte_universe_t univ;
|
|
|
|
OBJ_CONSTRUCT(&univ, orte_universe_t);
|
|
|
|
/* if we were NOT given registry and name service replicas (i.e., we
|
|
* weren't told a universe contact point), check for some
|
|
* existing universe to join */
|
|
if (NULL == orte_process_info.ns_replica_uri || NULL == orte_process_info.gpr_replica_uri) {
|
|
if (ORTE_SUCCESS == (ret = orte_universe_exists(&univ))) {
|
|
/* copy universe info into our universe structure */
|
|
orte_universe_info.name = strdup(univ.name);
|
|
orte_universe_info.host = strdup(univ.host);
|
|
orte_universe_info.uid = strdup(univ.uid);
|
|
orte_universe_info.persistence = univ.persistence;
|
|
orte_universe_info.scope = strdup(univ.scope);
|
|
/* JJH XXX This will inadvertently overwrite the console MCA param */
|
|
/* orte_universe_info.console = univ.console; */
|
|
orte_universe_info.seed_uri = strdup(univ.seed_uri);
|
|
orte_universe_info.console_connected = univ.console_connected;
|
|
if( NULL != univ.scriptfile)
|
|
orte_universe_info.scriptfile = strdup(univ.scriptfile);
|
|
else
|
|
orte_universe_info.scriptfile = NULL;
|
|
/* define the replica contact points */
|
|
orte_process_info.ns_replica_uri = strdup(univ.seed_uri);
|
|
orte_process_info.gpr_replica_uri = strdup(univ.seed_uri);
|
|
} else {
|
|
/* if an existing universe is not detected, check the
|
|
* relevant MCA parameter to see if the caller wants
|
|
* us to abort in this situation
|
|
*/
|
|
if (0 > (rc = mca_base_param_register_int("orte", "univ", "exist", NULL, 0))) {
|
|
ORTE_ERROR_LOG(rc);
|
|
return rc;
|
|
}
|
|
if (ORTE_SUCCESS != (rc = mca_base_param_lookup_int(rc, &exit_if_not_exist))) {
|
|
ORTE_ERROR_LOG(rc);
|
|
return rc;
|
|
}
|
|
if (exit_if_not_exist) {
|
|
/* cleanup the subsystems that were already opened */
|
|
orte_system_finalize();
|
|
return ORTE_ERR_UNREACH;
|
|
}
|
|
if (ORTE_ERR_NOT_FOUND != ret) {
|
|
/* user-specified name - abort */
|
|
opal_output(0, "orte_init: could not contact the specified universe name %s",
|
|
orte_universe_info.name);
|
|
ORTE_ERROR_LOG(ret);
|
|
return ORTE_ERR_UNREACH;
|
|
}
|
|
orte_process_info.seed = true;
|
|
/* since we are seed, ensure that all replica info is NULL'd */
|
|
if (NULL != orte_process_info.ns_replica_uri) {
|
|
free(orte_process_info.ns_replica_uri);
|
|
orte_process_info.ns_replica_uri = NULL;
|
|
}
|
|
if (NULL != orte_process_info.ns_replica) {
|
|
free(orte_process_info.ns_replica);
|
|
orte_process_info.ns_replica = NULL;
|
|
}
|
|
|
|
if (NULL != orte_process_info.gpr_replica_uri) {
|
|
free(orte_process_info.gpr_replica_uri);
|
|
orte_process_info.gpr_replica_uri = NULL;
|
|
}
|
|
if (NULL != orte_process_info.gpr_replica) {
|
|
free(orte_process_info.gpr_replica);
|
|
orte_process_info.gpr_replica = NULL;
|
|
}
|
|
}
|
|
}
|
|
|
|
OBJ_DESTRUCT(&univ);
|
|
|
|
return ORTE_SUCCESS;
|
|
}
|
|
|
|
|
|
int
|
|
orte_sds_base_seed_set_name(void)
|
|
{
|
|
int id, flag, rc;
|
|
|
|
/* if we are a seed, then there can be only one proc */
|
|
orte_process_info.num_procs = 1;
|
|
orte_process_info.vpid_start = 0;
|
|
orte_process_info.local_rank = 0;
|
|
orte_process_info.num_local_procs = 1;
|
|
|
|
/* if we're a seed and we're not infrastructure, we're also a
|
|
singleton. So set the singleton flag in that case */
|
|
id = mca_base_param_find("orte", NULL, "infrastructure");
|
|
mca_base_param_lookup_int(id, &flag);
|
|
if (!flag) {
|
|
orte_process_info.singleton = true;
|
|
}
|
|
/* now need to create our name in a manner that puts our job info on the name service
|
|
* tracker. This is necessary so that
|
|
* functions like get_job_peers will work. Since we are the seed, these
|
|
* functions will always return the proper jobid=0, vpid=0 values
|
|
*/
|
|
if (ORTE_SUCCESS != (rc = orte_ns.create_my_name())) {
|
|
ORTE_ERROR_LOG(rc);
|
|
return rc;
|
|
}
|
|
|
|
return ORTE_SUCCESS;
|
|
}
|