[Top] | [Contents] | [Index] | [ ? ] |
Grid Engine Mirror Interface
Grid Engine Mirror Interface
version SGE pre6.0 (Maintrunk).
Copyright © The Grid Engine Team
Function Index
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Eventmirror -- mirroring of master lists through event client interface |
The event mirror interface provides a means to easily implement Grid Engine components that need to have access to the masters object lists and therefore have to mirror them. Such components can be schedulers, proxies, monitoring tools etc. It is designed as a layer above the event client interface. Mirroring can be restricted to certain event types / object types. Callback functions can be installed to perform actions additional to pure mirroring. |
Not yet operable on the usermapping related objects and lists. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Eventmirror -- mirroring of master lists through event client interface |
typedef enum { ... } sge_event_type; typedef enum { ... } sge_event_action; typedef enum { ... } sge_mirror_error; typedef int (*sge_mirror_callback)(sge_event_type type, sge_event_action action, lListElem *event, void *clientdata); |
The following types are defined for use with the event mirroring interface: The enumeration sge_event_type defines different classes of events. These classes mostly reflect the different object types defined in libgdi, e.g. job, host, queue ... The following event_types are defined: SGE_EMT_ADMINHOST SGE_EMT_CALENDAR SGE_EMT_CKPT SGE_EMT_COMPLEX SGE_EMT_CONFIG SGE_EMT_GLOBAL_CONFIG SGE_EMT_EXECHOST SGE_EMT_JATASK SGE_EMT_PETASK SGE_EMT_JOB SGE_EMT_JOB_SCHEDD_INFO SGE_EMT_MANAGER SGE_EMT_OPERATOR SGE_EMT_SHARETREE SGE_EMT_PE SGE_EMT_PROJECT SGE_EMT_QUEUE SGE_EMT_SCHEDD_CONF SGE_EMT_SCHEDD_MONITOR SGE_EMT_SHUTDOWN SGE_EMT_QMASTER_GOES_DOWN SGE_EMT_SUBMITHOST SGE_EMT_USER SGE_EMT_USERSET If usermapping is enabled, two additional event types are defined: SGE_EMT_USERMAPPING SGE_EMT_HOSTGROUP The last value defined as event type is SGE_EMT_ALL. It can be used to subscribe all event types. Different event actions are defined in the enumeration sge_event_action: SGE_EMA_LIST - the whole master list has been sent (used at initialization) SGE_EMA_ADD - a new object has been created SGE_EMA_MOD - an object has been modified SGE_EMA_DEL - an object has been deleted SGE_EMA_TRIGGER - a certain action has been triggered, e.g. a scheduling run or a shutdown. Most functions of the event mirroring interface return error codes that are defined in the enumeration sge_mirror_error: SGE_EM_OK - action performed successfully SGE_EM_NOT_INITIALIZED - the interface is not yet initialized SGE_EM_BAD_ARG - some input parameter was incorrect SGE_EM_TIMEOUT - a timeout occured SGE_EM_DUPLICATE_KEY - an object should be added, but an object with the same unique identifier already exists. SGE_EM_KEY_NOT_FOUND - an object with the given key was not found. SGE_EM_CALLBACK_FAILED - a callback function failed SGE_EM_PROCESS_ERRORS - an error occured during event processing The event mirroring interface allows to install callback funktions for actions on certain event types. These callback functions have to have the same prototype as given by the function typedef sge_mirror_callback. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
host_update_master_list() -- update the master hostlists |
bool host_update_master_list(sge_event_type type, sge_event_action action, lListElem *event, void *clientdata) |
Update the global master lists of hosts based on an event. The function is called from the event mirroring interface. Updates admin, submit or execution host list depending on the event received. |
sge_event_type type - event type sge_event_action action - action to perform lListElem *event - the raw event void *clientdata - client data |
bool - true, if update is successfull, else false |
The function should only be called from the event mirror interface. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
ja_task_update_master_list() -- update array tasks of a job |
bool ja_task_update_master_list(sge_event_type type, sge_event_action action, lListElem *event, void *clientdata) |
Update the list of array tasks of a job based on an event. The function is called from the event mirroring interface. An array tasks list of parallel tasks and the scaled usage list are not updated in this function, as this data is maintained by separate events. |
sge_event_type type - event type sge_event_action action - action to perform lListElem *event - the raw event void *clientdata - client data |
bool - true, if update is successfull, else false |
The function should only be called from the event mirror interface. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
ja_task_update_master_list_usage() -- update an array tasks usage |
bool ja_task_update_master_list_usage(lListElem *event) |
Updates the scaled usage of an array task (also task data structure of a non array job). |
lListElem *event - event object containing the new usage list |
bool - true, if the operation succeeds, else false |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
job_update_master_list() -- update the master list of jobs |
bool job_update_master_list(sge_event_type type, sge_event_action action, lListElem *event, void *clientdata) |
Update the global master list of jobs based on an event. The function is called from the event mirroring interface. A jobs array tasks are not updated by this function, as they are maintained by separate events. In addition, some scheduler specific attributes, that are only used in scheduler, are not updated. |
sge_event_type type - event type sge_event_action action - action to perform lListElem *event - the raw event void *clientdata - client data |
bool - true, if update is successfull, else false |
The function should only be called from the event mirror interface. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
job_update_master_list_usage() -- update usage for a jobs tasks |
int job_update_master_list_usage(lListElem *event) |
Events containing usage reports are sent for a jobs tasks. This can be array tasks (where a non array job has a single array task) or tasks of a parallel job. This function decides which type of task has to receive the updated usage report and passes the event information to the corresponding update functions. |
lListElem *event - event object containing the new usage list |
int - true, if the operation succeeds, else false |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
pe_task_update_master_list() -- update parallel tasks of an array task |
bool pe_task_update_master_list(sge_event_type type, sge_event_action action, lListElem *event, void *clientdata) |
Update the list of parallel tasks of an array task based on an event. The function is called from the event mirroring interface. The scaled usage list of a parallel task is not updated by this function, as this data is maintained by a separate event. |
sge_event_type type - event type sge_event_action action - action to perform lListElem *event - the raw event void *clientdata - client data |
bool - true, if update is successfull, else false |
The function should only be called from the event mirror interface. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
pe_task_update_master_list_usage() -- update a parallel tasks usage |
bool pe_task_update_master_list_usage(lListElem *event) |
Updates the scaled usage of a parallel task. |
lListElem *event - event object containing the new usage list |
bool - true, if the operation succeeds, else false |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
queue_update_master_list() -- update the master list of queues |
bool queue_update_master_list(sge_event_type type, sge_event_action action, lListElem *event, void *clientdata) |
Update the global master list of queues based on an event. The function is called from the event mirroring interface. |
sge_event_type type - event type sge_event_action action - action to perform lListElem *event - the raw event void *clientdata - client data |
int - true, if update is successfull, else false |
The function should only be called from the event mirror interface. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
schedd_conf_update_master_list() -- update the scheduler configuration |
bool schedd_conf_update_master_list(sge_event_type type, sge_event_action action, lListElem *event, void *clientdata) |
Update the global master list of scheduler configurations based on an event. The function is called from the event mirroring interface. The list only contains one element that is replaced when a modify event arrives. |
sge_event_type type - event type sge_event_action action - action to perform lListElem *event - the raw event void *clientdata - client data |
bool - true, if update is successfull, else false |
The function should only be called from the event mirror interface. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
sge_mirror_get_type_descr() -- get the descriptor for an event type |
const lDescr* sge_mirror_get_type_descr(const sge_event_type type) |
Returns the CULL element descriptor for the object type associated with the given event. |
const sge_event_type type - the event type |
const lDescr* - the descriptor, or NULL, if no descriptor is associated with the type |
sge_mirror_get_type_descr(SGE_EMT_JOB) will return the descriptor JB_Type, sge_mirror_get_type_descr(SGE_EMT_SHUTDOWN) will return NULL |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
sge_mirror_get_type_key_nm() -- get the primary key attribute for a type |
int sge_mirror_get_type_key_nm(const sge_event_type type) |
Returns the primary key attribute for the object type associated with the given event type. |
const sge_event_type type - event type |
int - the key number (struct element nm of the descriptor), or -1, if no object type is associated with the event type |
sge_mirror_get_type_key_nm(SGE_EMT_JOB) will return JB_job_number sge_mirror_get_type_key_nm(SGE_EMT_SHUTDOWN) will return -1 |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
sge_mirror_get_type_master_list() -- get master list for an event type |
lList** sge_mirror_get_type_master_list(const sge_event_type type) |
Returns a pointer to the master list holding objects that are manipulated by events of the given type. |
const sge_event_type type - the event type |
lList** - the corresponding master list, or NULL, if the event type has no associated master list |
sge_mirror_get_type_master_list(SGE_EMT_JOB) will return a pointer to the Master_Job_List. sge_mirror_get_type_master_list(SGE_EMT_SHUTDOWN) will return NULL, as this event type has no associated master list. |
This and the following utility functions should be moved to some more general object type handling. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
sge_mirror_get_type_name() -- get a printable name for an event type |
const char* sge_mirror_get_type_name(const sge_event_type type) |
Returns a printable name for an event type. |
const sge_event_type type - the event type |
const char* - string describing the type |
sge_mirror_get_type_name(SGE_EMT_JOB) will return "JOB" |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
sge_mirror_initialize() -- initialize the event mirror interface |
sge_mirror_error sge_mirror_initialize(ev_registration_id id, const char *name) |
Initializes internal data structures and registers with qmaster using the event client mechanisms. Events covering shutdown requests and qmaster shutdown notification are subscribed. |
ev_registration_id id - id used to register with qmaster const char *name - name used to register with qmaster |
sge_mirror_error - SGE_EM_OK or an error code |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
sge_mirror_process_events() -- retrieve and process events |
sge_mirror_error sge_mirror_process_events(void) |
Retrieves new events from qmaster. If new events have arrived from qmaster, they are processed, that means, for each event - if installed, a "before mirroring" callback is called - the event is mirrored into the corresponding master list - if installed, a "after mirroring" callback is called If retrieving new events from qmaster fails over a time period of 10 times the configured event delivery interval (see event client interface, function ec_get_edtime), a timeout warning is generated and a new registration of the event client is prepared. |
sge_mirror_error - SGE_EM_OK or an error code |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
sge_mirror_shutdown() -- shutdown mirroring |
sge_mirror_error sge_mirror_shutdown(void) |
Shuts down the event mirroring mechanism: Unsubscribes all events, deletes contents of the corresponding object lists and deregisteres from qmaster. |
sge_mirror_error - SGE_EM_OK or error code |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
sge_mirror_strerror() -- map errorcode to error message |
const char* sge_mirror_strerror(sge_mirror_error num) |
Returns a string describing a given error number. This function can be used to output error messages if a function of the event mirror interface fails. |
sge_mirror_error num - error number |
const char* - corresponding error message |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
sge_mirror_subscribe() -- subscribe certain event types |
sge_mirror_error sge_mirror_subscribe(sge_event_type type, sge_mirror_callback callback_before, sge_mirror_callback callback_after, void *clientdata) |
Subscribe a certain event type. Callback functions can be specified, that can be executed before the mirroring action and/or after the mirroring action. The corresponding data structures are initialized, the events associated with the event type are subscribed with the event client interface. |
sge_event_type type - event type to subscribe or SGE_EMT_ALL sge_mirror_callback callback_before - callback to be executed before mirroring sge_mirror_callback callback_after - callback to be executed after mirroring void *clientdata - clientdata to be passed to the callback functions |
sge_mirror_error - SGE_EM_OK or an error code |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
sge_mirror_unsubscribe() -- unsubscribe event types |
sge_mirror_error sge_mirror_unsubscribe(sge_event_type type) |
Unsubscribes a certain event type or all if SGE_EMT_ALL is given as type. Unsubscribes the corresponding events in the underlying event client interface and frees data stored in the corresponding mirrored list(s).@end smallexample
1.19 sge_mirror_update_master_list
1.20 sge_mirror_update_master_list_host_key
1.21 sge_mirror_update_master_list_str_key
1.22 sharetree
1.22.1 sharetree_update_master_list
Function Index
Table of Contents1. Eventmirror
Short Table of Contents1. Eventmirror
About this documentThis document was generated using texi2html The buttons in the navigation panels have the following meaning:
This document was generated by Joachim Gabler on February, 24 2003 using texi2html |