1
1
openmpi/orte/mca/state/app/state_app.c

79 строки
1.8 KiB
C
Исходник Обычный вид История

/*
* Copyright (c) 2011 Los Alamos National Security, LLC.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "orte_config.h"
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "opal/util/output.h"
#include "orte/mca/state/state.h"
#include "orte/mca/state/base/state_private.h"
#include "state_app.h"
/*
* Module functions: Global
*/
static int init(void);
static int finalize(void);
/******************
* APP module - just uses base functions after
* initializing the proc state machine. Job state
* machine is unused by application procs at this
* time.
******************/
orte_state_base_module_t orte_state_app_module = {
init,
finalize,
orte_state_base_activate_job_state,
orte_state_base_add_job_state,
orte_state_base_set_job_state_callback,
orte_state_base_set_job_state_priority,
orte_state_base_remove_job_state,
orte_state_base_activate_proc_state,
orte_state_base_add_proc_state,
orte_state_base_set_proc_state_callback,
orte_state_base_set_proc_state_priority,
orte_state_base_remove_proc_state
};
/************************
* API Definitions
************************/
static int init(void)
{
/* we don't use the job state machine, so just
* setup the proc state machine
*/
OBJ_CONSTRUCT(&orte_proc_states, opal_list_t);
return ORTE_SUCCESS;
}
static int finalize(void)
{
opal_list_item_t *item;
/* cleanup the proc state machine */
while (NULL != (item = opal_list_remove_first(&orte_proc_states))) {
OBJ_RELEASE(item);
}
OBJ_DESTRUCT(&orte_proc_states);
return ORTE_SUCCESS;
}