Revert r31926 and replace it with a more complete checking of availability and accessibility of the required freq control paths.
This commit was SVN r31927. The following SVN revision numbers were found above: r31926 --> open-mpi/ompi@9779084352
Этот коммит содержится в:
родитель
9779084352
Коммит
03234f2a33
@ -1,7 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
||||||
* Copyright (c) 2014 Research Organization for Information Science
|
|
||||||
* and Technology (RIST). All rights reserved.
|
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -69,9 +67,6 @@ int orte_rtc_base_select(void)
|
|||||||
component->mca_component_name );
|
component->mca_component_name );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (0 == priority) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
nmodule = (orte_rtc_base_module_t*) module;
|
nmodule = (orte_rtc_base_module_t*) module;
|
||||||
|
|
||||||
/* give the module a chance to init */
|
/* give the module a chance to init */
|
||||||
|
@ -184,14 +184,22 @@ static int init(void)
|
|||||||
|
|
||||||
/* read/save the current settings */
|
/* read/save the current settings */
|
||||||
filename = opal_os_path(false, trk->directory, "scaling_governor", NULL);
|
filename = opal_os_path(false, trk->directory, "scaling_governor", NULL);
|
||||||
fp = fopen(filename, "r");
|
if (NULL == (fp = fopen(filename, "rw"))) {
|
||||||
|
free(filename);
|
||||||
|
OBJ_RELEASE(trk);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
trk->system_governor = orte_getline(fp);
|
trk->system_governor = orte_getline(fp);
|
||||||
trk->current_governor = strdup(trk->system_governor);
|
trk->current_governor = strdup(trk->system_governor);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
free(filename);
|
free(filename);
|
||||||
|
|
||||||
filename = opal_os_path(false, trk->directory, "scaling_max_freq", NULL);
|
filename = opal_os_path(false, trk->directory, "scaling_max_freq", NULL);
|
||||||
fp = fopen(filename, "r");
|
if (NULL == (fp = fopen(filename, "rw"))) {
|
||||||
|
free(filename);
|
||||||
|
OBJ_RELEASE(trk);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
tmp = orte_getline(fp);
|
tmp = orte_getline(fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
trk->system_max_freq = strtoul(tmp, NULL, 10) / 1000000.0;
|
trk->system_max_freq = strtoul(tmp, NULL, 10) / 1000000.0;
|
||||||
@ -200,7 +208,11 @@ static int init(void)
|
|||||||
free(tmp);
|
free(tmp);
|
||||||
|
|
||||||
filename = opal_os_path(false, trk->directory, "scaling_min_freq", NULL);
|
filename = opal_os_path(false, trk->directory, "scaling_min_freq", NULL);
|
||||||
fp = fopen(filename, "r");
|
if (NULL == (fp = fopen(filename, "rw"))) {
|
||||||
|
free(filename);
|
||||||
|
OBJ_RELEASE(trk);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
tmp = orte_getline(fp);
|
tmp = orte_getline(fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
trk->system_min_freq = strtoul(tmp, NULL, 10) / 1000000.0;
|
trk->system_min_freq = strtoul(tmp, NULL, 10) / 1000000.0;
|
||||||
@ -210,47 +222,54 @@ static int init(void)
|
|||||||
|
|
||||||
/* get the list of available governors */
|
/* get the list of available governors */
|
||||||
filename = opal_os_path(false, trk->directory, "scaling_available_governors", NULL);
|
filename = opal_os_path(false, trk->directory, "scaling_available_governors", NULL);
|
||||||
if (NULL != (fp = fopen(filename, "r"))) {
|
if (NULL == (fp = fopen(filename, "r"))) {
|
||||||
tmp = orte_getline(fp);
|
|
||||||
fclose(fp);
|
|
||||||
free(filename);
|
free(filename);
|
||||||
if (NULL != tmp) {
|
OBJ_RELEASE(trk);
|
||||||
vals = opal_argv_split(tmp, ' ');
|
continue;
|
||||||
free(tmp);
|
}
|
||||||
for (k=0; NULL != vals[k]; k++) {
|
tmp = orte_getline(fp);
|
||||||
kv = OBJ_NEW(opal_value_t);
|
fclose(fp);
|
||||||
kv->type = OPAL_STRING;
|
free(filename);
|
||||||
kv->data.string = strdup(vals[k]);
|
if (NULL != tmp) {
|
||||||
opal_list_append(&trk->governors, &kv->super);
|
vals = opal_argv_split(tmp, ' ');
|
||||||
}
|
free(tmp);
|
||||||
opal_argv_free(vals);
|
for (k=0; NULL != vals[k]; k++) {
|
||||||
|
kv = OBJ_NEW(opal_value_t);
|
||||||
|
kv->type = OPAL_STRING;
|
||||||
|
kv->data.string = strdup(vals[k]);
|
||||||
|
opal_list_append(&trk->governors, &kv->super);
|
||||||
}
|
}
|
||||||
|
opal_argv_free(vals);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the list of available frequencies */
|
/* get the list of available frequencies */
|
||||||
filename = opal_os_path(false, trk->directory, "scaling_available_frequencies", NULL);
|
filename = opal_os_path(false, trk->directory, "scaling_available_frequencies", NULL);
|
||||||
if (NULL != (fp = fopen(filename, "r"))) {
|
if (NULL == (fp = fopen(filename, "r"))) {
|
||||||
tmp = orte_getline(fp);
|
|
||||||
fclose(fp);
|
|
||||||
free(filename);
|
free(filename);
|
||||||
if (NULL != tmp) {
|
OBJ_RELEASE(trk);
|
||||||
vals = opal_argv_split(tmp, ' ');
|
continue;
|
||||||
free(tmp);
|
}
|
||||||
for (k=0; NULL != vals[k]; k++) {
|
tmp = orte_getline(fp);
|
||||||
kv = OBJ_NEW(opal_value_t);
|
fclose(fp);
|
||||||
kv->type = OPAL_FLOAT;
|
free(filename);
|
||||||
kv->data.fval = strtoul(vals[k], NULL, 10) / 1000000.0;
|
if (NULL != tmp) {
|
||||||
opal_list_append(&trk->frequencies, &kv->super);
|
vals = opal_argv_split(tmp, ' ');
|
||||||
}
|
free(tmp);
|
||||||
opal_argv_free(vals);
|
for (k=0; NULL != vals[k]; k++) {
|
||||||
|
kv = OBJ_NEW(opal_value_t);
|
||||||
|
kv->type = OPAL_FLOAT;
|
||||||
|
kv->data.fval = strtoul(vals[k], NULL, 10) / 1000000.0;
|
||||||
|
opal_list_append(&trk->frequencies, &kv->super);
|
||||||
}
|
}
|
||||||
|
opal_argv_free(vals);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* see if setspeed is supported */
|
/* see if setspeed is supported */
|
||||||
filename = opal_os_path(false, trk->directory, "scaling_setspeed", NULL);
|
filename = opal_os_path(false, trk->directory, "scaling_setspeed", NULL);
|
||||||
if (access(filename, W_OK)) {
|
if (NULL != (fp = fopen(filename, "rw"))) {
|
||||||
trk->setspeed = true;
|
trk->setspeed = true;
|
||||||
}
|
}
|
||||||
|
fclose(fp);
|
||||||
free(filename);
|
free(filename);
|
||||||
|
|
||||||
/* add to our list */
|
/* add to our list */
|
||||||
@ -260,8 +279,10 @@ static int init(void)
|
|||||||
|
|
||||||
if (0 == opal_list_get_size(&tracking)) {
|
if (0 == opal_list_get_size(&tracking)) {
|
||||||
/* nothing to read */
|
/* nothing to read */
|
||||||
orte_show_help("help-orcm-sensor-freq.txt", "no-cores-found",
|
if (0 < opal_output_get_verbosity(orte_rtc_base_framework.framework_output)) {
|
||||||
true, orte_process_info.nodename);
|
orte_show_help("help-orcm-sensor-freq.txt", "no-cores-found",
|
||||||
|
true, orte_process_info.nodename);
|
||||||
|
}
|
||||||
OPAL_LIST_DESTRUCT(&tracking);
|
OPAL_LIST_DESTRUCT(&tracking);
|
||||||
return ORTE_ERROR;
|
return ORTE_ERROR;
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user