1
1

Fix the newly added FT event state when compiling --with-ft

This commit was SVN r30988.
Этот коммит содержится в:
Adrian Reber 2014-03-11 13:20:08 +00:00
родитель ec3957ddde
Коммит 7304b700e1
4 изменённых файлов: 28 добавлений и 9 удалений

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

@ -30,6 +30,10 @@
#include "orte/mca/rml/base/base.h"
#include "orte/mca/oob/base/base.h"
#if OPAL_ENABLE_FT_CR == 1
#include "orte/mca/state/state.h"
#endif
/*
* The following file was created by configure. It contains extern
* statements and the definition of an array of pointers to each
@ -88,8 +92,10 @@ static int orte_oob_base_open(mca_base_open_flag_t flags)
OBJ_CONSTRUCT(&orte_oob_base.actives, opal_list_t);
#if OPAL_ENABLE_FT_CR == 1
/* register the FT event callback */
orte_state.add_job_state(ORTE_JOB_STATE_FT_EVENT, orte_oob_ft_event, ORTE_ERROR_PRI);
/* register the FT events callback */
orte_state.add_job_state(ORTE_JOB_STATE_FT_CHECKPOINT, orte_oob_base_ft_event, ORTE_ERROR_PRI);
orte_state.add_job_state(ORTE_JOB_STATE_FT_CONTINUE, orte_oob_base_ft_event, ORTE_ERROR_PRI);
orte_state.add_job_state(ORTE_JOB_STATE_FT_RESTART, orte_oob_base_ft_event, ORTE_ERROR_PRI);
#endif
/* Open up all available components */

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

@ -383,17 +383,22 @@ static void process_uri(char *uri)
void orte_oob_base_ft_event(int sd, short argc, void *cbdata)
{
int rc;
mca_oob_module_t *mod;
mca_base_component_list_item_t *cli;
mca_oob_base_component_t *component;
orte_state_caddy_t *state = (orte_state_caddy_t*)cbdata;
/* loop across all available modules in priority order
* and call each one's ft_event handler
*/
OPAL_LIST_FOREACH(mod, &mca_oob_base_modules, mca_oob_module_t) {
if (NULL != mod->ft_event) {
if (ORTE_SUCCESS != (rc = mod->ft_event(state))) {
ORTE_ERROR_LOG(rc);
}
OPAL_LIST_FOREACH(cli, &orte_oob_base.actives, mca_base_component_list_item_t) {
component = (mca_oob_base_component_t*)cli->cli_component;
if (NULL == component->ft_event) {
/* doesn't support this ability */
continue;
}
if (ORTE_SUCCESS != (rc = component->ft_event(state->job_state))) {
ORTE_ERROR_LOG(rc);
}
}
OBJ_RELEASE(state);

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

@ -55,6 +55,9 @@ typedef int (*mca_oob_base_component_set_addr_fn_t)(orte_process_name_t *peer,
char **uris);
typedef bool (*mca_oob_base_component_is_reachable_fn_t)(orte_process_name_t *peer);
typedef void (*mca_oob_ping_callback_fn_t)(int status, void *cbdata);
#if OPAL_ENABLE_FT_CR == 1
typedef int (*mca_oob_base_component_ft_event_fn_t)(int state);
#endif
typedef struct {
mca_base_component_t oob_base;
@ -68,6 +71,9 @@ typedef struct {
mca_oob_base_component_get_addr_fn_t get_addr;
mca_oob_base_component_set_addr_fn_t set_addr;
mca_oob_base_component_is_reachable_fn_t is_reachable;
#if OPAL_ENABLE_FT_CR == 1
mca_oob_base_component_ft_event_fn_t ft_event;
#endif
} mca_oob_base_component_t;
/**

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

@ -174,7 +174,9 @@ typedef int32_t orte_job_state_t;
#define ORTE_JOB_STATE_ALLOC_FAILED (ORTE_JOB_STATE_ERROR + 18) /* job failed to obtain an allocation */
/* define an FT event */
#define ORTE_JOB_STATE_FT_EVENT (ORTE_JOB_STATE_ERROR + 19)
#define ORTE_JOB_STATE_FT_CHECKPOINT (ORTE_JOB_STATE_ERROR + 19)
#define ORTE_JOB_STATE_FT_CONTINUE (ORTE_JOB_STATE_ERROR + 20)
#define ORTE_JOB_STATE_FT_RESTART (ORTE_JOB_STATE_ERROR + 21)
/* Define a boundary so that external developers