2004-12-15 21:36:21 +03:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2006-08-23 07:32:36 +04:00
|
|
|
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
2005-11-05 22:57:48 +03:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2004-12-15 21:36:21 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-12-15 21:36:21 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
/** @file:
|
|
|
|
*
|
|
|
|
* The Open MPI State-of-Health Monitoring Subsystem
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2006-08-16 20:35:09 +04:00
|
|
|
#ifndef ORTE_SMR_H
|
|
|
|
#define ORTE_SMR_H
|
2004-12-15 21:36:21 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* includes
|
|
|
|
*/
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
#include "orte_config.h"
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/orte_constants.h"
|
|
|
|
#include "orte/orte_types.h"
|
2004-12-15 21:36:21 +03:00
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "opal/mca/mca.h"
|
2006-09-15 01:29:51 +04:00
|
|
|
|
|
|
|
#include "orte/mca/gpr/gpr_types.h"
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/mca/ns/ns_types.h"
|
2006-08-16 20:35:09 +04:00
|
|
|
#include "orte/mca/smr/smr_types.h"
|
2006-12-15 05:34:14 +03:00
|
|
|
#include "orte/mca/rmaps/rmaps_types.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2006-08-23 07:32:36 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2004-12-15 21:36:21 +03:00
|
|
|
/*
|
|
|
|
* Component functions - all MUST be provided!
|
|
|
|
*/
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
|
|
|
|
/*
|
2006-08-16 20:35:09 +04:00
|
|
|
* Query a process state
|
2005-03-14 23:57:21 +03:00
|
|
|
*/
|
2006-08-16 20:35:09 +04:00
|
|
|
typedef int (*orte_smr_base_module_get_proc_state_fn_t)(orte_proc_state_t *state,
|
2005-03-14 23:57:21 +03:00
|
|
|
int *status,
|
|
|
|
orte_process_name_t *proc);
|
|
|
|
|
|
|
|
/*
|
2006-08-16 20:35:09 +04:00
|
|
|
* Set a process state
|
2005-03-14 23:57:21 +03:00
|
|
|
*/
|
2006-08-16 20:35:09 +04:00
|
|
|
typedef int (*orte_smr_base_module_set_proc_state_fn_t)(orte_process_name_t *proc,
|
2005-03-14 23:57:21 +03:00
|
|
|
orte_proc_state_t state, int status);
|
|
|
|
|
|
|
|
/*
|
2006-08-16 20:35:09 +04:00
|
|
|
* Query a node state
|
2005-03-14 23:57:21 +03:00
|
|
|
*/
|
2006-08-16 20:35:09 +04:00
|
|
|
typedef int (*orte_smr_base_module_get_node_state_fn_t)(orte_node_state_t *state,
|
2005-03-14 23:57:21 +03:00
|
|
|
orte_cellid_t cell,
|
|
|
|
char *nodename);
|
|
|
|
/*
|
2006-08-16 20:35:09 +04:00
|
|
|
* Set a node state
|
2005-03-14 23:57:21 +03:00
|
|
|
*/
|
2006-08-16 20:35:09 +04:00
|
|
|
typedef int (*orte_smr_base_module_set_node_state_fn_t)(orte_cellid_t cell,
|
2005-03-14 23:57:21 +03:00
|
|
|
char *nodename,
|
|
|
|
orte_node_state_t state);
|
|
|
|
|
Add a job_info segment to the system that holds a container for each job. Within each container is a keyval indicating the job state (i.e., all procs at stage1, finalized, etc.). This provides a rough state-of-health for the job.
This required a little fiddling with a number of areas. Biggest problem was that it uncovered a potential for an infinite loop to be created in the registry. If a callback function modified the registry, the registry checked the triggers to see if anything had fired. Well, if the original callback was due to a trigger firing, that condition hadn't changed - so the trigger fired again....which caused the callback to be called, which modified the registry, which checked the triggers, etc. etc.
Triggers are now checked and then "flagged" as being "in process" so that the registry will NOT recheck that trigger until all callbacks have been processed. Tried doing this with subscriptions as well, but that caused a problem - when we release processes from a stagegate, they (at the moment) immediately place data on the registry that should cause a subscription to fire. Unfortunately, the system will just hang if that subscription doesn't get processed. So, I have left the subscription system alone - any callback function that modifies the registry in a fashion that will fire a subscription will indeed fire that subscription. We'll have to see if this causes problems - it shouldn't, but a careless user could lock things up if the callback generates a callback to itself.
Also fixed the code that placed a process' RML contact info on the registry to eliminate the leading '/' from the string.
This commit was SVN r6684.
2005-07-29 18:11:19 +04:00
|
|
|
/*
|
2006-08-16 20:35:09 +04:00
|
|
|
* Query a job state
|
Add a job_info segment to the system that holds a container for each job. Within each container is a keyval indicating the job state (i.e., all procs at stage1, finalized, etc.). This provides a rough state-of-health for the job.
This required a little fiddling with a number of areas. Biggest problem was that it uncovered a potential for an infinite loop to be created in the registry. If a callback function modified the registry, the registry checked the triggers to see if anything had fired. Well, if the original callback was due to a trigger firing, that condition hadn't changed - so the trigger fired again....which caused the callback to be called, which modified the registry, which checked the triggers, etc. etc.
Triggers are now checked and then "flagged" as being "in process" so that the registry will NOT recheck that trigger until all callbacks have been processed. Tried doing this with subscriptions as well, but that caused a problem - when we release processes from a stagegate, they (at the moment) immediately place data on the registry that should cause a subscription to fire. Unfortunately, the system will just hang if that subscription doesn't get processed. So, I have left the subscription system alone - any callback function that modifies the registry in a fashion that will fire a subscription will indeed fire that subscription. We'll have to see if this causes problems - it shouldn't, but a careless user could lock things up if the callback generates a callback to itself.
Also fixed the code that placed a process' RML contact info on the registry to eliminate the leading '/' from the string.
This commit was SVN r6684.
2005-07-29 18:11:19 +04:00
|
|
|
*/
|
2006-08-16 20:35:09 +04:00
|
|
|
typedef int (*orte_smr_base_module_get_job_state_fn_t)(orte_job_state_t *state,
|
Add a job_info segment to the system that holds a container for each job. Within each container is a keyval indicating the job state (i.e., all procs at stage1, finalized, etc.). This provides a rough state-of-health for the job.
This required a little fiddling with a number of areas. Biggest problem was that it uncovered a potential for an infinite loop to be created in the registry. If a callback function modified the registry, the registry checked the triggers to see if anything had fired. Well, if the original callback was due to a trigger firing, that condition hadn't changed - so the trigger fired again....which caused the callback to be called, which modified the registry, which checked the triggers, etc. etc.
Triggers are now checked and then "flagged" as being "in process" so that the registry will NOT recheck that trigger until all callbacks have been processed. Tried doing this with subscriptions as well, but that caused a problem - when we release processes from a stagegate, they (at the moment) immediately place data on the registry that should cause a subscription to fire. Unfortunately, the system will just hang if that subscription doesn't get processed. So, I have left the subscription system alone - any callback function that modifies the registry in a fashion that will fire a subscription will indeed fire that subscription. We'll have to see if this causes problems - it shouldn't, but a careless user could lock things up if the callback generates a callback to itself.
Also fixed the code that placed a process' RML contact info on the registry to eliminate the leading '/' from the string.
This commit was SVN r6684.
2005-07-29 18:11:19 +04:00
|
|
|
orte_jobid_t jobid);
|
|
|
|
|
|
|
|
/*
|
2006-08-16 20:35:09 +04:00
|
|
|
* Set a job state
|
Add a job_info segment to the system that holds a container for each job. Within each container is a keyval indicating the job state (i.e., all procs at stage1, finalized, etc.). This provides a rough state-of-health for the job.
This required a little fiddling with a number of areas. Biggest problem was that it uncovered a potential for an infinite loop to be created in the registry. If a callback function modified the registry, the registry checked the triggers to see if anything had fired. Well, if the original callback was due to a trigger firing, that condition hadn't changed - so the trigger fired again....which caused the callback to be called, which modified the registry, which checked the triggers, etc. etc.
Triggers are now checked and then "flagged" as being "in process" so that the registry will NOT recheck that trigger until all callbacks have been processed. Tried doing this with subscriptions as well, but that caused a problem - when we release processes from a stagegate, they (at the moment) immediately place data on the registry that should cause a subscription to fire. Unfortunately, the system will just hang if that subscription doesn't get processed. So, I have left the subscription system alone - any callback function that modifies the registry in a fashion that will fire a subscription will indeed fire that subscription. We'll have to see if this causes problems - it shouldn't, but a careless user could lock things up if the callback generates a callback to itself.
Also fixed the code that placed a process' RML contact info on the registry to eliminate the leading '/' from the string.
This commit was SVN r6684.
2005-07-29 18:11:19 +04:00
|
|
|
*/
|
2006-08-16 20:35:09 +04:00
|
|
|
typedef int (*orte_smr_base_module_set_job_state_fn_t)(orte_jobid_t jobid,
|
Add a job_info segment to the system that holds a container for each job. Within each container is a keyval indicating the job state (i.e., all procs at stage1, finalized, etc.). This provides a rough state-of-health for the job.
This required a little fiddling with a number of areas. Biggest problem was that it uncovered a potential for an infinite loop to be created in the registry. If a callback function modified the registry, the registry checked the triggers to see if anything had fired. Well, if the original callback was due to a trigger firing, that condition hadn't changed - so the trigger fired again....which caused the callback to be called, which modified the registry, which checked the triggers, etc. etc.
Triggers are now checked and then "flagged" as being "in process" so that the registry will NOT recheck that trigger until all callbacks have been processed. Tried doing this with subscriptions as well, but that caused a problem - when we release processes from a stagegate, they (at the moment) immediately place data on the registry that should cause a subscription to fire. Unfortunately, the system will just hang if that subscription doesn't get processed. So, I have left the subscription system alone - any callback function that modifies the registry in a fashion that will fire a subscription will indeed fire that subscription. We'll have to see if this causes problems - it shouldn't, but a careless user could lock things up if the callback generates a callback to itself.
Also fixed the code that placed a process' RML contact info on the registry to eliminate the leading '/' from the string.
This commit was SVN r6684.
2005-07-29 18:11:19 +04:00
|
|
|
orte_job_state_t state);
|
|
|
|
|
2006-09-15 01:29:51 +04:00
|
|
|
/*
|
|
|
|
* Define the job-specific standard stage gates
|
|
|
|
* This function creates all of the ORTE-standard stage gates.
|
|
|
|
*/
|
|
|
|
typedef int (*orte_smr_base_module_job_stage_gate_init_fn_t)(orte_jobid_t job,
|
|
|
|
orte_gpr_trigger_cb_fn_t cbfunc,
|
|
|
|
void *user_tag);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Define the orted standard stage gates
|
|
|
|
* This function creates all of the orted-standard stage gates.
|
|
|
|
*/
|
|
|
|
typedef int (*orte_smr_base_module_orted_stage_gate_init_fn_t)(orte_jobid_t job,
|
|
|
|
orte_std_cntr_t num_orteds,
|
|
|
|
orte_gpr_trigger_cb_fn_t cbfunc,
|
|
|
|
void *user_tag);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Define an "alert" monitor
|
|
|
|
* This function will establish an appropriate trigger to notify the specified
|
|
|
|
* callback function when an event takes place. In this case, event is defined
|
|
|
|
* by the specified memory location achieving the specified value - e.g., a
|
|
|
|
* location could be monitored for a value being set to 1, indicating that a
|
|
|
|
* process has aborted.
|
|
|
|
*
|
|
|
|
* @param job The job that is to be monitored.
|
|
|
|
*
|
|
|
|
* @param *trigger_name The name of the trigger to be defined.
|
|
|
|
*
|
|
|
|
* @param *counter_key A string defining the key name of the counter on the registry.
|
|
|
|
*
|
|
|
|
* @param *counter A pointer to a data_value object that contains the initial
|
|
|
|
* value to which the counter should be set.
|
|
|
|
*
|
|
|
|
* @param *alert_value A pointer to a data_value object that contains the value of
|
|
|
|
* the counter that should cause the alert to be sent.
|
|
|
|
*
|
|
|
|
* @param one_shot Whether or not the trigger should be a one-shot
|
|
|
|
*
|
|
|
|
* @param cbfunc A registry callback function to be called when the alert fires.
|
|
|
|
*
|
|
|
|
* @param *user_tag Whatever data the user would like to have passed back to them
|
|
|
|
* when the alert is received
|
|
|
|
*
|
|
|
|
* NOTE: alerts are intended solely for purposes of alerting the caller when
|
|
|
|
* an event happens. Thus, they do not convey any information beyond the fact that
|
|
|
|
* they fired.
|
|
|
|
*/
|
|
|
|
typedef int (*orte_smr_base_module_define_alert_monitor_fn_t)(orte_jobid_t job,
|
|
|
|
char *trigger_name,
|
|
|
|
char *counter_key,
|
|
|
|
orte_std_cntr_t counter,
|
|
|
|
orte_std_cntr_t alert_value,
|
|
|
|
bool one_shot,
|
|
|
|
orte_gpr_trigger_cb_fn_t cbfunc,
|
|
|
|
void *user_tag);
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
/*
|
|
|
|
* Initiate monitoring of a job
|
2006-08-16 20:35:09 +04:00
|
|
|
* This function notifies the smr that it should initiate monitoring of the specified
|
2006-12-15 05:34:14 +03:00
|
|
|
* jobid. It is called by a PLS component at an appropriate point in the launch procedure. Calling
|
|
|
|
* the function allows smr components (e.g., the BProc component that monitors daemons
|
2005-03-14 23:57:21 +03:00
|
|
|
* via the BProc-provided centralized alerting system) to make the necessary connections
|
|
|
|
* for monitoring the job.
|
|
|
|
*/
|
2006-12-15 05:34:14 +03:00
|
|
|
typedef int (*orte_smr_base_module_begin_monitoring_fn_t)(orte_job_map_t *map,
|
|
|
|
orte_gpr_trigger_cb_fn_t cbfunc,
|
|
|
|
void *user_tag);
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2006-09-15 01:29:51 +04:00
|
|
|
/*
|
|
|
|
* Subscribe to a job stage gate
|
|
|
|
*/
|
|
|
|
typedef int (*orte_smr_base_module_job_stage_gate_subscribe_fn_t)(orte_jobid_t job,
|
|
|
|
orte_gpr_notify_cb_fn_t cbfunc, void* cbdata,
|
|
|
|
orte_proc_state_t cb_conditions);
|
|
|
|
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
/* Shutdown the module nicely
|
2004-12-15 21:36:21 +03:00
|
|
|
*/
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2006-08-16 20:35:09 +04:00
|
|
|
typedef int (*orte_smr_base_module_finalize_fn_t)(void);
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2004-12-15 21:36:21 +03:00
|
|
|
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
/* below are the prototypes needed by the MCA */
|
|
|
|
|
2004-12-15 21:36:21 +03:00
|
|
|
/*
|
2006-08-16 20:35:09 +04:00
|
|
|
* Ver 1.3.0
|
|
|
|
*/
|
|
|
|
struct orte_smr_base_module_1_3_0_t {
|
2006-09-15 01:29:51 +04:00
|
|
|
orte_smr_base_module_get_proc_state_fn_t get_proc_state;
|
|
|
|
orte_smr_base_module_set_proc_state_fn_t set_proc_state;
|
|
|
|
orte_smr_base_module_get_node_state_fn_t get_node_state;
|
|
|
|
orte_smr_base_module_set_node_state_fn_t set_node_state;
|
|
|
|
orte_smr_base_module_get_job_state_fn_t get_job_state;
|
|
|
|
orte_smr_base_module_set_job_state_fn_t set_job_state;
|
2006-12-15 22:40:04 +03:00
|
|
|
orte_smr_base_module_begin_monitoring_fn_t begin_monitoring;
|
2006-09-15 01:29:51 +04:00
|
|
|
/* TRIGGER INIT FUNCTIONS */
|
|
|
|
orte_smr_base_module_job_stage_gate_init_fn_t init_job_stage_gates;
|
|
|
|
orte_smr_base_module_orted_stage_gate_init_fn_t init_orted_stage_gates;
|
|
|
|
orte_smr_base_module_define_alert_monitor_fn_t define_alert_monitor;
|
|
|
|
orte_smr_base_module_job_stage_gate_subscribe_fn_t job_stage_gate_subscribe;
|
|
|
|
orte_smr_base_module_finalize_fn_t finalize;
|
2004-12-15 21:36:21 +03:00
|
|
|
};
|
|
|
|
|
2006-08-16 20:35:09 +04:00
|
|
|
typedef struct orte_smr_base_module_1_3_0_t orte_smr_base_module_1_3_0_t;
|
|
|
|
typedef orte_smr_base_module_1_3_0_t orte_smr_base_module_t;
|
2004-12-15 21:36:21 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* SOH Component
|
|
|
|
*/
|
|
|
|
|
2006-08-16 20:35:09 +04:00
|
|
|
typedef orte_smr_base_module_t* (*orte_smr_base_component_init_fn_t)(
|
2004-12-15 21:36:21 +03:00
|
|
|
int *priority);
|
|
|
|
|
2006-08-16 20:35:09 +04:00
|
|
|
typedef int (*orte_smr_base_component_finalize_fn_t)(void);
|
2004-12-15 21:36:21 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* the standard component data structure
|
|
|
|
*/
|
|
|
|
|
2006-08-16 20:35:09 +04:00
|
|
|
struct orte_smr_base_component_1_3_0_t {
|
|
|
|
mca_base_component_t smr_version;
|
|
|
|
mca_base_component_data_1_0_0_t smr_data;
|
|
|
|
orte_smr_base_component_init_fn_t smr_init;
|
|
|
|
orte_smr_base_component_finalize_fn_t smr_finalize;
|
2004-12-15 21:36:21 +03:00
|
|
|
};
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2006-08-16 20:35:09 +04:00
|
|
|
typedef struct orte_smr_base_component_1_3_0_t orte_smr_base_component_1_3_0_t;
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2006-08-16 20:35:09 +04:00
|
|
|
typedef orte_smr_base_component_1_3_0_t orte_smr_base_component_t;
|
2004-12-15 21:36:21 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Macro for use in components that are of type ns v1.0.0
|
|
|
|
*/
|
2006-08-16 20:35:09 +04:00
|
|
|
#define ORTE_SMR_BASE_VERSION_1_3_0 \
|
|
|
|
/* smr v1.3 is chained to MCA v1.0 */ \
|
2004-12-15 21:36:21 +03:00
|
|
|
MCA_BASE_VERSION_1_0_0, \
|
2006-08-16 20:35:09 +04:00
|
|
|
/* smr v1.3 */ \
|
|
|
|
"smr", 1, 3, 0
|
2004-12-15 21:36:21 +03:00
|
|
|
|
2006-08-20 19:54:04 +04:00
|
|
|
ORTE_DECLSPEC extern orte_smr_base_module_t orte_smr; /* holds selected module's function pointers */
|
2005-05-13 01:44:23 +04:00
|
|
|
|
2006-08-23 07:32:36 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2006-08-16 20:35:09 +04:00
|
|
|
#endif /* ORTE_SMR_H */
|