1
1
- 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.
Этот коммит содержится в:
Josh Hursey 2005-08-26 20:13:35 +00:00
родитель f7638f0884
Коммит 4eefb33182
14 изменённых файлов: 87 добавлений и 48 удалений

Просмотреть файл

@ -98,9 +98,9 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
goto error; 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"; error = "ompi_mpi_init: orte_init_stage1 failed";
goto error; goto error;
} }

Просмотреть файл

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

Просмотреть файл

@ -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 /* if we're a seed and we're not infrastructure, we're also a
singleton. So set the singleton flag in that case */ singleton. So set the singleton flag in that case */
id = mca_base_param_find("orte_base", NULL, "infrastructure"); id = mca_base_param_find("orte", 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);;
}
mca_base_param_lookup_int(id, &flag); mca_base_param_lookup_int(id, &flag);
if (!flag) { if (!flag) {
orte_process_info.singleton = true; orte_process_info.singleton = true;

Просмотреть файл

@ -55,12 +55,7 @@ orte_sds_singleton_set_name(void)
orte_process_info.vpid_start = vpid; orte_process_info.vpid_start = vpid;
/* only set the singleton flag is we are NOT infrastructure, /* only set the singleton flag is we are NOT infrastructure,
and it has not been previously set. */ and it has not been previously set. */
id = mca_base_param_find("orte_base", NULL, "infrastructure"); id = mca_base_param_find("orte", 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);;
}
mca_base_param_lookup_int(id, &flag); mca_base_param_lookup_int(id, &flag);
if (!flag) { if (!flag) {
orte_process_info.singleton = true; orte_process_info.singleton = true;

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -57,7 +57,7 @@
#include "runtime/runtime_internal.h" #include "runtime/runtime_internal.h"
#include "runtime/orte_wait.h" #include "runtime/orte_wait.h"
int orte_init_stage1(void) int orte_init_stage1(bool infrastructure)
{ {
int ret; int ret;
char *jobid_str = NULL; char *jobid_str = NULL;
@ -66,6 +66,12 @@ int orte_init_stage1(void)
orte_jobid_t my_jobid; orte_jobid_t my_jobid;
orte_cellid_t my_cellid; 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 */ /* Ensure the system_info structure is instantiated and initialized */
if (ORTE_SUCCESS != (ret = orte_sys_info())) { if (ORTE_SUCCESS != (ret = orte_sys_info())) {
return ret; return ret;

35
orte/runtime/orte_params.c Обычный файл
Просмотреть файл

@ -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;
}

Просмотреть файл

@ -111,6 +111,7 @@ int orte_setup_hnp(char *target_cluster, char *headnode, char *username)
char *keys[4], *tokens[3], *cellname; char *keys[4], *tokens[3], *cellname;
struct timeval tv; struct timeval tv;
struct timespec ts; struct timespec ts;
bool infrastructure = true;
/* get the nodename for the headnode of the target cluster */ /* get the nodename for the headnode of the target cluster */
if (NULL == headnode) { /* not provided, so try to look it up */ if (NULL == headnode) { /* not provided, so try to look it up */
@ -478,6 +479,13 @@ MOVEON:
OPAL_THREAD_UNLOCK(&orte_setup_hnp_mutex); OPAL_THREAD_UNLOCK(&orte_setup_hnp_mutex);
if (ORTE_SUCCESS == orte_setup_hnp_rc) { 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. /* 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 * 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 * utilities, though, or we will lose all of our MCA parameters
@ -513,7 +521,7 @@ MOVEON:
/* /*
* ...re-init ourselves... * ...re-init ourselves...
*/ */
rc = orte_system_init(); rc = orte_system_init(infrastructure);
if (ORTE_SUCCESS != rc) { if (ORTE_SUCCESS != rc) {
ORTE_ERROR_LOG(rc); ORTE_ERROR_LOG(rc);
return rc; return rc;

Просмотреть файл

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

Просмотреть файл

@ -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. * control, malloc debugging and threads, and out of band messaging.
* This function should be * This function should be called exactly once. This function should
* called exactly once. This function should
* be called by every application using the RTE interface, including * be called by every application using the RTE interface, including
* MPI applications and mpirun. * 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_init(bool infrastructure);
OMPI_DECLSPEC int orte_system_init(void); OMPI_DECLSPEC int orte_system_init(bool infrastructure);
OMPI_DECLSPEC int orte_init_stage1(void); OMPI_DECLSPEC int orte_init_stage1(bool infrastructure);
OMPI_DECLSPEC int orte_init_stage2(void); 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. * Re-init the Open run time environment.
* *

Просмотреть файл

@ -281,19 +281,13 @@ int main(int argc, char *argv[])
/* /*
* Intialize the ORTE environment * 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 * singleton, but am "infrastructure" - prevents setting
* up incorrect infrastructure that only a singleton would * up incorrect infrastructure that only a singleton would
* require * 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; daemon_is_active = false;
if (OMPI_SUCCESS != (ret = orte_init(true)) ) {
if (OMPI_SUCCESS != (ret = orte_init()) ) {
opal_show_help("help-orteconsole.txt", "orteconsole:init-failure", false, opal_show_help("help-orteconsole.txt", "orteconsole:init-failure", false,
"orte_init()", ret); "orte_init()", ret);
return ret; return ret;

Просмотреть файл

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

Просмотреть файл

@ -277,18 +277,12 @@ int main(int argc, char *argv[])
} }
/* Intialize our Open RTE environment */ /* 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 * singleton, but am "infrastructure" - prevents setting
* up incorrect infrastructure that only a singleton would * up incorrect infrastructure that only a singleton would
* require * require
*/ */
if (ORTE_SUCCESS != (rc = orte_init(true))) {
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())) {
opal_show_help("help-orterun.txt", "orterun:init-failure", true, opal_show_help("help-orterun.txt", "orterun:init-failure", true,
"orte_init()", rc); "orte_init()", rc);
return rc; return rc;