1
1

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
Этот коммит содержится в:
Ralph Castain 2014-06-02 14:34:00 +00:00
родитель 9779084352
Коммит 03234f2a33
2 изменённых файлов: 53 добавлений и 37 удалений

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

@ -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,7 +222,11 @@ 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"))) {
free(filename);
OBJ_RELEASE(trk);
continue;
}
tmp = orte_getline(fp); tmp = orte_getline(fp);
fclose(fp); fclose(fp);
free(filename); free(filename);
@ -225,11 +241,14 @@ static int init(void)
} }
opal_argv_free(vals); 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"))) {
free(filename);
OBJ_RELEASE(trk);
continue;
}
tmp = orte_getline(fp); tmp = orte_getline(fp);
fclose(fp); fclose(fp);
free(filename); free(filename);
@ -244,13 +263,13 @@ static int init(void)
} }
opal_argv_free(vals); 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 */
if (0 < opal_output_get_verbosity(orte_rtc_base_framework.framework_output)) {
orte_show_help("help-orcm-sensor-freq.txt", "no-cores-found", orte_show_help("help-orcm-sensor-freq.txt", "no-cores-found",
true, orte_process_info.nodename); true, orte_process_info.nodename);
}
OPAL_LIST_DESTRUCT(&tracking); OPAL_LIST_DESTRUCT(&tracking);
return ORTE_ERROR; return ORTE_ERROR;
} }