1
1

Some param changes:

- Change orte_base_infrastructre to orte_infrastructre to conform with 
  ompi_info's needs
- Move MCA Param registration in ORTE to a centralized function that is 
  called first in orte_init_stage1
- Set the infrastructre flag as an argument to orte_init
- Adjust initalization functions to properly pass down the infrastructre
  flag.

This commit was SVN r7053.
This commit is contained in:
Josh Hursey 2005-08-26 20:13:35 +00:00
parent f7638f0884
commit 4eefb33182
14 changed files with 87 additions and 48 deletions

View File

@ -98,9 +98,9 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
goto error;
}
/* Setup ORTE stage 1 */
/* Setup ORTE stage 1, note that we are not infrastructre */
if (ORTE_SUCCESS != (ret = orte_init_stage1())) {
if (ORTE_SUCCESS != (ret = orte_init_stage1(false))) {
error = "ompi_mpi_init: orte_init_stage1 failed";
goto error;
}

View File

@ -141,6 +141,10 @@ void ompi_info::open_components()
mca_base_open();
// Register the ORTE layer's MCA parameters
orte_register_params(false);
// Register the MPI layer's MCA parameters
ompi_mpi_register_params();

View File

@ -128,12 +128,7 @@ orte_sds_base_seed_set_name(void)
/* 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_base", NULL, "infrastructure");
if (-1 == id) {
id = mca_base_param_reg_int_name("orte_base", "infrastructure",
"Whether we are ORTE infrastructure or an ORTE application",
false, false, (int)false, NULL);;
}
id = mca_base_param_find("orte", NULL, "infrastructure");
mca_base_param_lookup_int(id, &flag);
if (!flag) {
orte_process_info.singleton = true;

View File

@ -55,12 +55,7 @@ orte_sds_singleton_set_name(void)
orte_process_info.vpid_start = vpid;
/* only set the singleton flag is we are NOT infrastructure,
and it has not been previously set. */
id = mca_base_param_find("orte_base", NULL, "infrastructure");
if (-1 == id) {
id = mca_base_param_reg_int_name("orte_base", "infrastructure",
"Whether we are ORTE infrastructure or an ORTE application",
false, false, (int)false, NULL);;
}
id = mca_base_param_find("orte", NULL, "infrastructure");
mca_base_param_lookup_int(id, &flag);
if (!flag) {
orte_process_info.singleton = true;

View File

@ -35,6 +35,7 @@ libruntime_la_SOURCES = \
orte_abort.c \
orte_finalize.c \
orte_init.c \
orte_params.c \
orte_init_stage1.c \
orte_init_stage2.c \
orte_monitor.c \

View File

@ -36,7 +36,7 @@ int orte_debug_flag=(int)false;
static const char * orte_err2str(int errnum);
int orte_init(void)
int orte_init(bool infrastructure)
{
int rc;
@ -48,7 +48,7 @@ int orte_init(void)
/* register handler for errnum -> string converstion */
opal_error_register(orte_err2str);
if (ORTE_SUCCESS != (rc = orte_system_init())) {
if (ORTE_SUCCESS != (rc = orte_system_init(infrastructure))) {
ORTE_ERROR_LOG(rc);
return rc;
}

View File

@ -57,7 +57,7 @@
#include "runtime/runtime_internal.h"
#include "runtime/orte_wait.h"
int orte_init_stage1(void)
int orte_init_stage1(bool infrastructure)
{
int ret;
char *jobid_str = NULL;
@ -66,6 +66,12 @@ int orte_init_stage1(void)
orte_jobid_t my_jobid;
orte_cellid_t my_cellid;
/* Register all MCA Params */
if (ORTE_SUCCESS != (ret = orte_register_params(infrastructure))) {
ORTE_ERROR_LOG(ret);
return ret;
}
/* Ensure the system_info structure is instantiated and initialized */
if (ORTE_SUCCESS != (ret = orte_sys_info())) {
return ret;

View File

@ -0,0 +1,35 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "orte_config.h"
#include "include/orte_constants.h"
#include "opal/mca/base/mca_base_param.h"
#include "runtime/runtime.h"
int orte_register_params(bool infrastructure)
{
int id;
id = mca_base_param_reg_int_name("orte", "infrastructure",
"Whether we are ORTE infrastructure or an ORTE application",
true, true, (int)infrastructure, NULL);
return ORTE_SUCCESS;
}

View File

@ -111,6 +111,7 @@ int orte_setup_hnp(char *target_cluster, char *headnode, char *username)
char *keys[4], *tokens[3], *cellname;
struct timeval tv;
struct timespec ts;
bool infrastructure = true;
/* get the nodename for the headnode of the target cluster */
if (NULL == headnode) { /* not provided, so try to look it up */
@ -478,6 +479,13 @@ MOVEON:
OPAL_THREAD_UNLOCK(&orte_setup_hnp_mutex);
if (ORTE_SUCCESS == orte_setup_hnp_rc) {
/* Remember if we were infrastructre or not */
id = mca_base_param_find("orte", NULL, "infrastructure");
mca_base_param_lookup_int(id, &intparam);
if ( ((int)true) != intparam) {
infrastructure = false;
}
/* need to restart the local system so it can connect to the remote daemon.
* we only want to clear the run-time itself - we cannot close the OPAL
* utilities, though, or we will lose all of our MCA parameters
@ -513,7 +521,7 @@ MOVEON:
/*
* ...re-init ourselves...
*/
rc = orte_system_init();
rc = orte_system_init(infrastructure);
if (ORTE_SUCCESS != rc) {
ORTE_ERROR_LOG(rc);
return rc;

View File

@ -31,11 +31,11 @@
* @retval ORTE_ERROR Upon failure.
*/
int orte_system_init(void)
int orte_system_init(bool infrastructure)
{
int rc;
if (ORTE_SUCCESS != (rc = orte_init_stage1())) {
if (ORTE_SUCCESS != (rc = orte_init_stage1(infrastructure))) {
ORTE_ERROR_LOG(rc);
return rc;
}

View File

@ -82,20 +82,30 @@ OMPI_DECLSPEC int orte_abort(int status, char *fmt, ...);
/**
* Initialize the Open run time environment
* Initialize the Open Run Time Environment
*
* Initlize the Open MPI run time environment, including process
* Initlize the Open Run Time Environment, including process
* control, malloc debugging and threads, and out of band messaging.
* This function should be
* called exactly once. This function should
* This function should be called exactly once. This function should
* be called by every application using the RTE interface, including
* MPI applications and mpirun.
*
* @param infrastructure Whether we are ORTE infrastructure or an ORTE
* application
*/
OMPI_DECLSPEC int orte_init(void);
OMPI_DECLSPEC int orte_system_init(void);
OMPI_DECLSPEC int orte_init_stage1(void);
OMPI_DECLSPEC int orte_init(bool infrastructure);
OMPI_DECLSPEC int orte_system_init(bool infrastructure);
OMPI_DECLSPEC int orte_init_stage1(bool infrastructure);
OMPI_DECLSPEC int orte_init_stage2(void);
/**
* Initialize parameters for ORTE.
*
* @retval ORTE_SUCCESS Upon success.
* @retval ORTE_ERROR Upon failure.
*/
OMPI_DECLSPEC int orte_register_params(bool infrastructure);
/**
* Re-init the Open run time environment.
*

View File

@ -281,19 +281,13 @@ int main(int argc, char *argv[])
/*
* Intialize the ORTE environment
*/
/* first, set the flag telling orte_init that I am NOT a
/* Set the flag telling orte_init that I am NOT a
* singleton, but am "infrastructure" - prevents setting
* up incorrect infrastructure that only a singleton would
* require
*/
ret = mca_base_param_reg_int_name("orte_base", "infrastructure",
"Whether we are ORTE infrastructure or an ORTE application",
false, false, (int)false, NULL);
mca_base_param_set_int(ret, (int)true);
daemon_is_active = false;
if (OMPI_SUCCESS != (ret = orte_init()) ) {
if (OMPI_SUCCESS != (ret = orte_init(true)) ) {
opal_show_help("help-orteconsole.txt", "orteconsole:init-failure", false,
"orte_init()", ret);
return ret;

View File

@ -270,15 +270,12 @@ int main(int argc, char *argv[])
}
/* Intialize the Open RTE */
/* first, set the flag telling orte_init that I am NOT a
/* Set the flag telling orte_init that I am NOT a
* singleton, but am "infrastructure" - prevents setting
* up incorrect infrastructure that only a singleton would
* require
*/
ret = mca_base_param_register_int("orte", "base", "infrastructure", NULL, (int)false);
mca_base_param_set_int(ret, (int)true);
if (ORTE_SUCCESS != (ret = orte_init())) {
if (ORTE_SUCCESS != (ret = orte_init(true))) {
opal_show_help("help-orted.txt", "orted:init-failure", false,
"orte_init()", ret);
return ret;

View File

@ -277,18 +277,12 @@ int main(int argc, char *argv[])
}
/* Intialize our Open RTE environment */
/* first, set the flag telling orte_init that I am NOT a
/* Set the flag telling orte_init that I am NOT a
* singleton, but am "infrastructure" - prevents setting
* up incorrect infrastructure that only a singleton would
* require
*/
id = mca_base_param_reg_int_name("orte_base", "infrastructure",
"Whether we are ORTE infrastructure or an ORTE application",
false, false, (int)true, NULL);
/* now call orte_init and setup the RTE */
if (ORTE_SUCCESS != (rc = orte_init())) {
if (ORTE_SUCCESS != (rc = orte_init(true))) {
opal_show_help("help-orterun.txt", "orterun:init-failure", true,
"orte_init()", rc);
return rc;