1
1

Rename an mca param to something more intuitive and set its default to 0 so the module only runs if a non-zero value is provided

This commit was SVN r23609.
Этот коммит содержится в:
Ralph Castain 2010-08-13 15:03:45 +00:00
родитель a2f349167e
Коммит ace1f60429
3 изменённых файлов: 7 добавлений и 7 удалений

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

@ -168,7 +168,7 @@ static void start(orte_jobid_t jobid)
}
/* setup the send */
time = mca_sensor_heartbeat_component.beat * 1000; /* convert to microsecs */
time = mca_sensor_heartbeat_component.rate * 1000; /* convert to microsecs */
send_ev = (opal_event_t*)malloc(sizeof(opal_event_t));
opal_evtimer_set(send_ev, send_heartbeat, send_ev);
send_time.tv_sec = time / 1000000;

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

@ -23,7 +23,7 @@ BEGIN_C_DECLS
struct orte_sensor_heartbeat_component_t {
orte_sensor_base_component_t super;
int beat;
int rate;
int check;
int missed;
};

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

@ -58,10 +58,10 @@ static int orte_sensor_heartbeat_open(void)
int tmp;
/* lookup parameters */
mca_base_param_reg_int(c, "beat",
"Heartbeat rate in milliseconds (default=100)",
false, false, 100, &tmp);
mca_sensor_heartbeat_component.beat = tmp;
mca_base_param_reg_int(c, "rate",
"Heartbeat rate in milliseconds (default=0)",
false, false, 0, &tmp);
mca_sensor_heartbeat_component.rate = tmp;
mca_base_param_reg_int(c, "check",
"Check for failure rate in milliseconds (default=500)",
@ -80,7 +80,7 @@ static int orte_sensor_heartbeat_open(void)
static int orte_sensor_heartbeat_query(mca_base_module_t **module, int *priority)
{
/* only usable by daemons and HNPs */
if (0 < mca_sensor_heartbeat_component.beat &&
if (0 < mca_sensor_heartbeat_component.rate &&
(ORTE_PROC_IS_DAEMON || ORTE_PROC_IS_HNP)) {
*priority = 10; /* use if we were built */
*module = (mca_base_module_t *)&orte_sensor_heartbeat_module;