1
1

Change to a single init() selection process (vs. query() and init())

This commit was SVN r569.
Этот коммит содержится в:
Jeff Squyres 2004-01-29 02:42:30 +00:00
родитель 2d8649edb9
Коммит ae76544956
4 изменённых файлов: 17 добавлений и 33 удалений

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

@ -45,19 +45,19 @@ int mca_pcm_base_select(void)
module = (mca_pcm_base_module_t *) mli->mli_module;
lam_output_verbose(10, mca_pcm_base_output,
"select: querying %s module %s",
"select: initializing %s module %s",
module->pcmm_version.mca_type_name,
module->pcmm_version.mca_module_name);
if (NULL == module->pcmm_query) {
if (NULL == module->pcmm_init) {
lam_output_verbose(10, mca_pcm_base_output,
"select: no querying function; ignoring module");
"select: no init function; ignoring module");
} else {
if (MCA_SUCCESS != module->pcmm_query(&priority)) {
if (MCA_SUCCESS != module->pcmm_init(&priority)) {
lam_output_verbose(10, mca_pcm_base_output,
"select: query returned failure");
"select: init returned failure");
} else {
lam_output_verbose(10, mca_pcm_base_output,
"select: query returned priority %d", priority);
"select: init returned priority %d", priority);
if (priority > best_priority) {
best_priority = priority;
best_module = module;
@ -106,13 +106,8 @@ int mca_pcm_base_select(void)
mca_base_modules_close(mca_pcm_base_output, &mca_pcm_base_modules_available,
(mca_base_module_t *) best_module);
/* Invoke init on the selected module */
/* Save the winner */
actions = best_module->pcmm_init();
if (NULL == actions) {
/* JMS replace with show_help */
lam_abort(1, "PCM module init function returned NULL. This shouldn't happen.");
}
mca_pcm_base_selected_module = *best_module;
mca_pcm = *actions;
lam_output_verbose(10, mca_pcm_base_output,

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

@ -17,8 +17,7 @@ int mca_pcm_cofs_close(void);
/*
* Startup / Shutdown
*/
int mca_pcm_cofs_query(int *priority);
struct mca_pcm_1_0_0_t* mca_pcm_cofs_init(void);
struct mca_pcm_1_0_0_t* mca_pcm_cofs_init(int *priority);
int mca_pcm_cofs_finalize(void);

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

@ -35,7 +35,6 @@ mca_pcm_base_module_1_0_0_t mca_pcm_cofs_module = {
{
false /* checkpoint / restart */
},
mca_pcm_cofs_query, /* module query */
mca_pcm_cofs_init, /* module init */
mca_pcm_cofs_finalize
};
@ -83,9 +82,12 @@ mca_pcm_cofs_close(void)
}
int
mca_pcm_cofs_query(int *priority)
struct mca_pcm_1_0_0_t*
mca_pcm_cofs_init(int *priority)
{
char *tmp;
FILE *fp;
char *test_ret;
*priority = 0;
@ -94,31 +96,21 @@ mca_pcm_cofs_query(int *priority)
test_ret = getenv("MCA_common_lam_cofs_my_vpid");
if (test_ret == NULL) {
printf("COFS PCM will not be running because MCA_common_lam_cofs_my_vpid not set\n");
return LAM_ERROR;
return NULL;
}
test_ret = getenv("MCA_common_lam_cofs_job_handle");
if (test_ret == NULL) {
printf("COFS PCM will not be running because MCA_common_lam_cofs_job_handle not set\n");
return LAM_ERROR;
return NULL;
}
test_ret = getenv("MCA_common_lam_cofs_num_procs");
if (test_ret == NULL) {
printf("COFS PCM will not be running because MCA_common_lam_cofs_num_procs not set\n");
return LAM_ERROR;
return NULL;
}
return LAM_SUCCESS;
}
struct mca_pcm_1_0_0_t*
mca_pcm_cofs_init(void)
{
char *tmp;
FILE *fp;
/*
* BWB - fix me, make register the "right" way...
*/

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

@ -87,8 +87,7 @@ typedef struct mca_pcm_proc_t mca_pcm_proc_t;
* functions every module must provide
*/
typedef int (*mca_pcm_base_query_fn_t)(int *priority);
typedef struct mca_pcm_1_0_0_t* (*mca_pcm_base_init_fn_t)(void);
typedef struct mca_pcm_1_0_0_t* (*mca_pcm_base_init_fn_t)(int *priority);
/**
* \func mca_pcm_query_get_nodes
@ -377,7 +376,6 @@ struct mca_pcm_base_module_1_0_0_t {
mca_base_module_t pcmm_version;
mca_base_module_data_1_0_0_t pcmm_data;
mca_pcm_base_query_fn_t pcmm_query;
mca_pcm_base_init_fn_t pcmm_init;
mca_pcm_base_finalize_fn_t pcmm_finalize;
};