The CM ess module needs to open the sysinfo framework and select modules prior to when others need it. Thus, setup a flag to avoid multiple open/select within that framework.
This commit was SVN r22393.
Этот коммит содержится в:
родитель
2bdcb2a979
Коммит
b35486d945
@ -64,6 +64,7 @@ OPAL_DECLSPEC int opal_sysinfo_base_select(void);
|
||||
OPAL_DECLSPEC extern int opal_sysinfo_base_output;
|
||||
OPAL_DECLSPEC extern opal_list_t opal_sysinfo_base_components_opened;
|
||||
OPAL_DECLSPEC extern opal_list_t opal_sysinfo_avail_modules;
|
||||
OPAL_DECLSPEC extern bool opal_sysinfo_initialized;
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
|
@ -36,6 +36,7 @@ static int opal_sysinfo_base_query(char **keys, opal_list_t *values);
|
||||
int opal_sysinfo_base_output = -1;
|
||||
opal_list_t opal_sysinfo_base_components_opened;
|
||||
opal_list_t opal_sysinfo_avail_modules;
|
||||
bool opal_sysinfo_initialized=false;
|
||||
|
||||
opal_sysinfo_API_module_t opal_sysinfo = {
|
||||
opal_sysinfo_base_query
|
||||
@ -48,6 +49,11 @@ opal_sysinfo_API_module_t opal_sysinfo = {
|
||||
*/
|
||||
int opal_sysinfo_base_open(void)
|
||||
{
|
||||
if (opal_sysinfo_initialized) {
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
opal_sysinfo_initialized = true;
|
||||
|
||||
opal_sysinfo_base_output = opal_output_open(NULL);
|
||||
|
||||
/* init the list of available modules */
|
||||
|
@ -33,6 +33,10 @@ int opal_sysinfo_base_select(void)
|
||||
mca_base_component_t *component;
|
||||
opal_list_item_t *item;
|
||||
|
||||
if (opal_sysinfo_initialized) {
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Select all available components
|
||||
*/
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "opal/mca/paffinity/paffinity.h"
|
||||
#if ORTE_ENABLE_BOOTSTRAP
|
||||
#include "opal/mca/sysinfo/sysinfo.h"
|
||||
#include "opal/mca/sysinfo/base/base.h"
|
||||
#endif
|
||||
|
||||
#include "orte/mca/rmcast/base/base.h"
|
||||
@ -108,12 +109,33 @@ static int rte_init(void)
|
||||
error = "orte_rmcast_base_select";
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
||||
#if ORTE_ENABLE_BOOTSTRAP
|
||||
/* open and setup the local resource discovery framework */
|
||||
if (ORTE_SUCCESS != (ret = opal_sysinfo_base_open())) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
error = "opal_sysinfo_base_open";
|
||||
goto error;
|
||||
}
|
||||
if (ORTE_SUCCESS != (ret = opal_sysinfo_base_select())) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
error = "opal_sysinfo_base_select";
|
||||
goto error;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* get a name for ourselves */
|
||||
if (ORTE_SUCCESS != (ret = cm_set_name())) {
|
||||
error = "set_name";
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
/* if we were given an HNP, then we must have also
|
||||
* been given a vpid - we can get the jobid from
|
||||
* the HNP's name
|
||||
*/
|
||||
ORTE_PROC_MY_NAME->jobid = orte_process_info.my_hnp.jobid;
|
||||
|
||||
}
|
||||
|
||||
/* get the list of nodes used for this job */
|
||||
@ -500,7 +522,7 @@ static int cm_set_name(void)
|
||||
/* add them to the buffer */
|
||||
while (NULL != (item = opal_list_remove_first(&resources))) {
|
||||
info = (opal_sysinfo_value_t*)item;
|
||||
opal_dss.pack(&buf, &info, 1, OPAL_STRING);
|
||||
opal_dss.pack(&buf, &info->key, 1, OPAL_STRING);
|
||||
opal_dss.pack(&buf, &info->type, 1, OPAL_DATA_TYPE_T);
|
||||
if (OPAL_INT64 == info->type) {
|
||||
opal_dss.pack(&buf, &(info->data.i64), 1, OPAL_INT64);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user