1
1

per conversation with Ralph and Jeff take out the opal_init_only logic.

This commit moves the initalization/finalization of opal_event and opal_progress
to opal_init/finalize. These were previously init/final in ORTE which is an
abstraction violation. After talking about it we concluded that there are no
ordering issues that require these to be init/final in ORTE instead of OPAL.

I ran the IBM test suite against this commit and it didn't turn up any new
failures so I think it is good to go.

Let us know if this causes problems.

This commit was SVN r14773.
Этот коммит содержится в:
Josh Hursey 2007-05-24 21:54:58 +00:00
родитель d627918678
Коммит 1e678c3f55
9 изменённых файлов: 50 добавлений и 84 удалений

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

@ -226,12 +226,6 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
int num_processors; int num_processors;
#endif #endif
/*
* ORTE takes the responsibility of starting the progress and event
* (and other) engines.
*/
opal_init_only = false;
/* Join the run-time environment - do the things that don't hit /* Join the run-time environment - do the things that don't hit
the registry */ the registry */

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

@ -27,17 +27,6 @@
extern "C" { extern "C" {
#endif #endif
/**
* Determine if this is an OPAL level applicaiton or something else.
* If something else (e.g., ORTE) then we don't want to start the
* event and progress engines since ORTE does that during it's init.
*
* So if we are only doing opal_init, and not someone elses as well.
* See the opal_init() function for the components that needed to be
* called if you are going to set this value to 'false'.
*/
OPAL_DECLSPEC extern bool opal_init_only;
/** /**
* Initialize the OPAL layer, including the MCA system. * Initialize the OPAL layer, including the MCA system.
* *

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

@ -130,6 +130,8 @@ int opal_cr_set_enabled(bool en)
return OPAL_SUCCESS; return OPAL_SUCCESS;
} }
int opal_cr_initalized = 0;
int opal_cr_init(void ) int opal_cr_init(void )
{ {
int ret, exit_status = OPAL_SUCCESS; int ret, exit_status = OPAL_SUCCESS;
@ -137,6 +139,13 @@ int opal_cr_init(void )
opal_cr_coord_callback_fn_t prev_coord_func; opal_cr_coord_callback_fn_t prev_coord_func;
int val; int val;
if( ++opal_cr_initalized != 1 ) {
if( opal_cr_initalized < 1 ) {
return OPAL_ERROR;
}
return OPAL_SUCCESS;
}
/* /*
* Some startup MCA parameters * Some startup MCA parameters
*/ */
@ -298,6 +307,13 @@ int opal_cr_finalize(void)
{ {
int exit_status = OPAL_SUCCESS; int exit_status = OPAL_SUCCESS;
if( --opal_cr_initalized != 0 ) {
if( opal_cr_initalized < 0 ) {
return OPAL_ERROR;
}
return OPAL_SUCCESS;
}
if( !opal_cr_is_tool ) { if( !opal_cr_is_tool ) {
#if OPAL_ENABLE_FT_THREAD == 1 #if OPAL_ENABLE_FT_THREAD == 1
/* /*

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

@ -88,14 +88,12 @@ opal_finalize(void)
return OPAL_SUCCESS; return OPAL_SUCCESS;
} }
if( opal_init_only ) {
/* close the checkpoint and restart service */ /* close the checkpoint and restart service */
opal_cr_finalize(); opal_cr_finalize();
opal_progress_finalize(); opal_progress_finalize();
opal_event_fini(); opal_event_fini();
}
/* close high resolution timers */ /* close high resolution timers */
opal_timer_base_close(); opal_timer_base_close();

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

@ -48,7 +48,6 @@
#include "opal/util/sys_limits.h" #include "opal/util/sys_limits.h"
bool opal_init_only = true;
int opal_initialized = 0; int opal_initialized = 0;
static const char * static const char *
@ -260,7 +259,6 @@ opal_init(void)
goto return_error; goto return_error;
} }
if( opal_init_only ) {
/* /*
* Need to start the event and progress engines if noone else is. * Need to start the event and progress engines if noone else is.
* opal_cr_init uses the progress engine, so it is lumped together * opal_cr_init uses the progress engine, so it is lumped together
@ -294,7 +292,6 @@ opal_init(void)
error = "opal_cr_init() failed"; error = "opal_cr_init() failed";
goto return_error; goto return_error;
} }
}
return OPAL_SUCCESS; return OPAL_SUCCESS;

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

@ -39,12 +39,6 @@ int orte_init(bool infrastructure, bool barrier)
{ {
int rc; int rc;
/*
* ORTE takes the responsibility of starting the progress and event
* (and other) engines.
*/
opal_init_only = false;
if (orte_initialized) { if (orte_initialized) {
return ORTE_SUCCESS; return ORTE_SUCCESS;
} }

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

@ -145,23 +145,6 @@ int orte_init_stage1(bool infrastructure)
/***** ERROR LOGGING NOW AVAILABLE *****/ /***** ERROR LOGGING NOW AVAILABLE *****/
/*
* Initialize the event library
*/
if (ORTE_SUCCESS != (ret = opal_event_init())) {
ORTE_ERROR_LOG(ret);
error = "opal_event_init";
goto error;
}
/*
* Intialize the general progress engine
*/
if (ORTE_SUCCESS != (ret = opal_progress_init())) {
ORTE_ERROR_LOG(ret);
error = "opal_progress_init";
goto error;
}
/* we want to tick the event library whenever possible */ /* we want to tick the event library whenever possible */
opal_progress_event_users_increment(); opal_progress_event_users_increment();

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

@ -107,10 +107,6 @@ int orte_system_finalize(void)
orte_rml_base_close(); orte_rml_base_close();
orte_dss_close(); orte_dss_close();
opal_progress_finalize();
opal_event_fini();
orte_session_dir_finalize(orte_process_info.my_name); orte_session_dir_finalize(orte_process_info.my_name);
/* clean out the global structures */ /* clean out the global structures */

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

@ -534,7 +534,6 @@ static int ckpt_init(int argc, char *argv[]) {
* Note: This must happen before opal_init(). * Note: This must happen before opal_init().
*/ */
opal_cr_set_enabled(false); opal_cr_set_enabled(false);
opal_init_only = false;
/* Select the none component, since we don't actually use a checkpointer */ /* Select the none component, since we don't actually use a checkpointer */
opal_setenv(mca_base_param_env_var("crs"), opal_setenv(mca_base_param_env_var("crs"),