2004-08-15 03:33:13 +00:00
|
|
|
/* -*- C -*-
|
2005-09-01 01:07:30 +00:00
|
|
|
*
|
2005-11-05 19:57:48 +00:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2005-09-01 01:07:30 +00:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2004-11-28 20:09:25 +00:00
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 12:43:37 +00:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 01:38:40 +00:00
|
|
|
* $COPYRIGHT$
|
2005-09-01 01:07:30 +00:00
|
|
|
*
|
2004-11-22 01:38:40 +00:00
|
|
|
* Additional copyrights may follow
|
2005-09-01 01:07:30 +00:00
|
|
|
*
|
2004-08-15 03:33:13 +00:00
|
|
|
* $HEADER$
|
|
|
|
*
|
|
|
|
*/
|
2005-03-14 20:57:21 +00:00
|
|
|
#ifndef ORTE_GPR_PROXY_H
|
|
|
|
#define ORTE_GPR_PROXY_H
|
2004-08-15 03:33:13 +00:00
|
|
|
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
#include "orte_config.h"
|
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte/orte_types.h"
|
2005-07-03 16:06:07 +00:00
|
|
|
#include "opal/class/opal_object.h"
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte/class/orte_pointer_array.h"
|
|
|
|
#include "orte/dss/dss_types.h"
|
|
|
|
#include "orte/util/proc_info.h"
|
2004-09-16 04:14:35 +00:00
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte/mca/gpr/base/base.h"
|
2004-08-15 03:33:13 +00:00
|
|
|
|
2005-05-11 20:21:10 +00:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2004-08-15 03:33:13 +00:00
|
|
|
/*
|
|
|
|
* Module open / close
|
|
|
|
*/
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_gpr_proxy_open(void);
|
|
|
|
int orte_gpr_proxy_close(void);
|
2004-08-15 03:33:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Startup / Shutdown
|
|
|
|
*/
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_gpr_base_module_t*
|
|
|
|
orte_gpr_proxy_component_init(bool *allow_multi_user_threads, bool *have_hidden_threads, int *priority);
|
|
|
|
int orte_gpr_proxy_module_init(void);
|
2004-11-20 19:12:43 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_gpr_proxy_finalize(void);
|
2004-08-15 03:33:13 +00:00
|
|
|
|
2004-08-27 05:23:04 +00:00
|
|
|
/*
|
|
|
|
* proxy-local types
|
|
|
|
*/
|
2005-03-14 20:57:21 +00:00
|
|
|
typedef struct {
|
2005-07-03 16:06:07 +00:00
|
|
|
opal_object_t super; /**< Allows this to be an object */
|
2005-06-24 16:59:37 +00:00
|
|
|
orte_gpr_subscription_id_t id; /**< id of this subscription */
|
2005-09-01 01:07:30 +00:00
|
|
|
size_t index; /**< location of this subscription in array */
|
2005-08-01 16:38:15 +00:00
|
|
|
char *name;
|
2005-06-24 16:59:37 +00:00
|
|
|
orte_gpr_notify_cb_fn_t callback; /**< Function to be called for notificaiton */
|
|
|
|
void *user_tag; /**< User-provided tag for callback function */
|
2005-03-14 20:57:21 +00:00
|
|
|
} orte_gpr_proxy_subscriber_t;
|
2004-08-27 05:23:04 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
OBJ_CLASS_DECLARATION(orte_gpr_proxy_subscriber_t);
|
|
|
|
|
|
|
|
|
2005-07-18 18:49:00 +00:00
|
|
|
typedef struct {
|
|
|
|
opal_object_t super; /**< Allows this to be an object */
|
|
|
|
orte_gpr_trigger_id_t id; /**< id of this trigger */
|
2005-09-01 01:07:30 +00:00
|
|
|
size_t index; /**< location of this trigger in array */
|
2005-08-01 16:38:15 +00:00
|
|
|
char *name;
|
2005-07-18 18:49:00 +00:00
|
|
|
orte_gpr_trigger_cb_fn_t callback; /**< Function to be called for notification */
|
|
|
|
void *user_tag; /**< User-provided tag for callback function */
|
|
|
|
} orte_gpr_proxy_trigger_t;
|
|
|
|
|
|
|
|
OBJ_CLASS_DECLARATION(orte_gpr_proxy_trigger_t);
|
2004-11-20 19:12:43 +00:00
|
|
|
|
|
|
|
|
2004-08-15 03:33:13 +00:00
|
|
|
/*
|
|
|
|
* globals used within proxy component
|
|
|
|
*/
|
2005-03-14 20:57:21 +00:00
|
|
|
typedef struct {
|
|
|
|
int debug;
|
2005-06-24 16:59:37 +00:00
|
|
|
orte_gpr_subscription_id_t num_subs;
|
|
|
|
orte_pointer_array_t *subscriptions;
|
2005-07-18 18:49:00 +00:00
|
|
|
orte_gpr_trigger_id_t num_trigs;
|
|
|
|
orte_pointer_array_t *triggers;
|
2005-07-03 22:45:48 +00:00
|
|
|
opal_mutex_t mutex;
|
2005-03-14 20:57:21 +00:00
|
|
|
bool compound_cmd_mode;
|
|
|
|
orte_buffer_t *compound_cmd;
|
2005-07-03 22:45:48 +00:00
|
|
|
opal_mutex_t wait_for_compound_mutex;
|
|
|
|
opal_condition_t compound_cmd_condition;
|
2005-03-14 20:57:21 +00:00
|
|
|
int compound_cmd_waiting;
|
|
|
|
} orte_gpr_proxy_globals_t;
|
|
|
|
|
2004-08-15 03:33:13 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
extern orte_gpr_proxy_globals_t orte_gpr_proxy_globals;
|
2005-02-10 19:08:35 +00:00
|
|
|
|
2004-08-15 03:33:13 +00:00
|
|
|
/*
|
2004-11-20 19:12:43 +00:00
|
|
|
* Compound cmd functions
|
2004-08-15 03:33:13 +00:00
|
|
|
*/
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_gpr_proxy_begin_compound_cmd(void);
|
2004-11-20 19:12:43 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_gpr_proxy_stop_compound_cmd(void);
|
2004-08-15 03:33:13 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_gpr_proxy_exec_compound_cmd(void);
|
2005-09-01 01:07:30 +00:00
|
|
|
|
2004-08-15 03:33:13 +00:00
|
|
|
/*
|
2005-03-14 20:57:21 +00:00
|
|
|
* Arithmetic operations
|
2004-08-15 03:33:13 +00:00
|
|
|
*/
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_gpr_proxy_increment_value(orte_gpr_value_t *value);
|
2004-11-20 19:12:43 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_gpr_proxy_decrement_value(orte_gpr_value_t *value);
|
2004-08-15 03:33:13 +00:00
|
|
|
|
|
|
|
/*
|
2004-11-20 19:12:43 +00:00
|
|
|
* Delete-index functions
|
2004-08-15 03:33:13 +00:00
|
|
|
*/
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_gpr_proxy_delete_segment(char *segment);
|
|
|
|
|
|
|
|
int orte_gpr_proxy_delete_segment_nb(char *segment,
|
|
|
|
orte_gpr_notify_cb_fn_t cbfunc, void *user_tag);
|
2004-11-20 19:12:43 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_gpr_proxy_delete_entries(orte_gpr_addr_mode_t mode,
|
2005-09-01 01:07:30 +00:00
|
|
|
char *segment, char **tokens, char **keys);
|
2004-08-15 03:33:13 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_gpr_proxy_delete_entries_nb(
|
|
|
|
orte_gpr_addr_mode_t addr_mode,
|
|
|
|
char *segment, char **tokens, char **keys,
|
|
|
|
orte_gpr_notify_cb_fn_t cbfunc, void *user_tag);
|
2005-09-01 01:07:30 +00:00
|
|
|
|
2005-07-20 18:07:46 +00:00
|
|
|
int orte_gpr_proxy_index(char *segment, size_t *cnt, char ***index);
|
2004-11-20 19:12:43 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_gpr_proxy_index_nb(char *segment,
|
|
|
|
orte_gpr_notify_cb_fn_t cbfunc, void *user_tag);
|
2004-11-20 19:12:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Cleanup functions
|
|
|
|
*/
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_gpr_proxy_cleanup_job(orte_jobid_t jobid);
|
2004-11-20 19:12:43 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_gpr_proxy_cleanup_proc(orte_process_name_t *proc);
|
2004-11-20 19:12:43 +00:00
|
|
|
|
|
|
|
|
2004-08-15 03:33:13 +00:00
|
|
|
/*
|
2004-11-20 19:12:43 +00:00
|
|
|
* Put-get functions
|
2004-08-15 03:33:13 +00:00
|
|
|
*/
|
2005-05-01 00:53:00 +00:00
|
|
|
int orte_gpr_proxy_put(size_t cnt, orte_gpr_value_t **values);
|
2004-11-20 19:12:43 +00:00
|
|
|
|
2005-05-01 00:53:00 +00:00
|
|
|
int orte_gpr_proxy_put_nb(size_t cnt, orte_gpr_value_t **values,
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_gpr_notify_cb_fn_t cbfunc, void *user_tag);
|
2005-09-01 01:07:30 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_gpr_proxy_get(orte_gpr_addr_mode_t addr_mode,
|
2005-10-28 00:30:58 +00:00
|
|
|
char *segment, char **tokens, char **keys,
|
|
|
|
size_t *cnt, orte_gpr_value_t ***values);
|
|
|
|
|
|
|
|
int orte_gpr_proxy_get_conditional(orte_gpr_addr_mode_t addr_mode,
|
|
|
|
char *segment, char **tokens, char **keys,
|
|
|
|
size_t num_conditions, orte_gpr_keyval_t **conditions,
|
|
|
|
size_t *cnt, orte_gpr_value_t ***values);
|
2004-11-20 19:12:43 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_gpr_proxy_get_nb(orte_gpr_addr_mode_t addr_mode,
|
2005-10-28 00:30:58 +00:00
|
|
|
char *segment, char **tokens, char **keys,
|
|
|
|
orte_gpr_notify_cb_fn_t cbfunc, void *user_tag);
|
2004-08-15 03:33:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
2004-11-20 19:12:43 +00:00
|
|
|
* Subscribe functions
|
2004-08-15 03:33:13 +00:00
|
|
|
*/
|
2005-06-24 16:59:37 +00:00
|
|
|
int orte_gpr_proxy_subscribe(size_t num_subs,
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_gpr_subscription_t **subscriptions,
|
2005-05-01 00:53:00 +00:00
|
|
|
size_t num_trigs,
|
2005-06-24 16:59:37 +00:00
|
|
|
orte_gpr_trigger_t **trigs);
|
|
|
|
|
|
|
|
int orte_gpr_proxy_unsubscribe(orte_gpr_subscription_id_t sub_number);
|
2004-08-15 03:33:13 +00:00
|
|
|
|
2005-06-24 16:59:37 +00:00
|
|
|
int orte_gpr_proxy_cancel_trigger(orte_gpr_trigger_id_t trig);
|
2004-11-20 19:12:43 +00:00
|
|
|
|
2004-08-15 03:33:13 +00:00
|
|
|
|
2004-11-20 19:12:43 +00:00
|
|
|
/*
|
2005-03-14 20:57:21 +00:00
|
|
|
* Diagnostic functions
|
2004-11-20 19:12:43 +00:00
|
|
|
*/
|
2006-04-04 11:05:52 +00:00
|
|
|
int orte_gpr_proxy_dump_all(void);
|
2004-08-27 05:23:04 +00:00
|
|
|
|
2006-04-04 11:05:52 +00:00
|
|
|
int orte_gpr_proxy_dump_segments(char *segment);
|
2004-11-20 19:12:43 +00:00
|
|
|
|
2006-04-04 11:05:52 +00:00
|
|
|
int orte_gpr_proxy_dump_triggers(orte_gpr_trigger_id_t start);
|
2005-09-01 01:07:30 +00:00
|
|
|
|
2006-04-04 11:05:52 +00:00
|
|
|
int orte_gpr_proxy_dump_subscriptions(orte_gpr_subscription_id_t start);
|
2004-11-16 22:53:33 +00:00
|
|
|
|
2005-09-01 01:07:30 +00:00
|
|
|
int orte_gpr_proxy_dump_a_trigger(char *name,
|
2006-04-04 11:05:52 +00:00
|
|
|
orte_gpr_trigger_id_t id);
|
2005-09-01 01:07:30 +00:00
|
|
|
|
|
|
|
int orte_gpr_proxy_dump_a_subscription(char *name,
|
2006-04-04 11:05:52 +00:00
|
|
|
orte_gpr_subscription_id_t id);
|
2005-08-01 16:38:15 +00:00
|
|
|
|
2006-04-04 11:05:52 +00:00
|
|
|
int orte_gpr_proxy_dump_local_triggers(void);
|
2005-08-01 16:38:15 +00:00
|
|
|
|
2006-04-04 11:05:52 +00:00
|
|
|
int orte_gpr_proxy_dump_local_subscriptions(void);
|
2005-06-24 16:59:37 +00:00
|
|
|
|
2006-04-04 11:05:52 +00:00
|
|
|
int orte_gpr_proxy_dump_callbacks(void);
|
2005-03-28 22:37:54 +00:00
|
|
|
|
2006-04-04 11:05:52 +00:00
|
|
|
int orte_gpr_proxy_dump_notify_msg(orte_gpr_notify_message_t *msg);
|
2005-03-28 22:37:54 +00:00
|
|
|
|
2006-04-04 11:05:52 +00:00
|
|
|
int orte_gpr_proxy_dump_notify_data(orte_gpr_notify_data_t *data);
|
2005-03-28 22:37:54 +00:00
|
|
|
|
2006-04-04 11:05:52 +00:00
|
|
|
int orte_gpr_proxy_dump_value(orte_gpr_value_t *value);
|
2004-11-16 22:53:33 +00:00
|
|
|
|
2006-04-04 11:05:52 +00:00
|
|
|
int orte_gpr_proxy_dump_segment_size(char *segment);
|
2006-02-07 03:32:36 +00:00
|
|
|
|
2004-11-20 19:12:43 +00:00
|
|
|
/*
|
2005-03-14 20:57:21 +00:00
|
|
|
* General operations
|
2004-11-20 19:12:43 +00:00
|
|
|
*/
|
2005-05-01 00:53:00 +00:00
|
|
|
int orte_gpr_proxy_preallocate_segment(char *name, size_t num_slots);
|
2004-11-20 19:12:43 +00:00
|
|
|
|
2005-09-01 01:07:30 +00:00
|
|
|
int orte_gpr_proxy_deliver_notify_msg(orte_gpr_notify_message_t *msg);
|
|
|
|
|
2004-11-20 19:12:43 +00:00
|
|
|
/*
|
|
|
|
* Functions that interface to the replica
|
|
|
|
*/
|
2005-03-14 20:57:21 +00:00
|
|
|
void orte_gpr_proxy_notify_recv(int status, orte_process_name_t* sender,
|
2005-09-01 01:07:30 +00:00
|
|
|
orte_buffer_t *buffer, orte_rml_tag_t tag,
|
|
|
|
void* cbdata);
|
2004-08-27 05:23:04 +00:00
|
|
|
|
2004-09-23 14:37:27 +00:00
|
|
|
|
2004-11-20 19:12:43 +00:00
|
|
|
/*
|
|
|
|
* Internal functions
|
|
|
|
*/
|
2004-09-23 14:37:27 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
int
|
2005-06-24 16:59:37 +00:00
|
|
|
orte_gpr_proxy_enter_subscription(size_t cnt, orte_gpr_subscription_t **subscriptions);
|
|
|
|
|
|
|
|
int
|
2005-09-01 01:07:30 +00:00
|
|
|
orte_gpr_proxy_remove_subscription(orte_gpr_proxy_subscriber_t *sub);
|
2004-09-23 14:37:27 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
int
|
2005-06-24 16:59:37 +00:00
|
|
|
orte_gpr_proxy_enter_trigger(size_t cnt, orte_gpr_trigger_t **triggers);
|
2004-09-23 14:37:27 +00:00
|
|
|
|
2005-02-10 19:08:35 +00:00
|
|
|
|
2005-07-18 18:49:00 +00:00
|
|
|
int
|
2005-09-01 01:07:30 +00:00
|
|
|
orte_gpr_proxy_remove_trigger(orte_gpr_proxy_trigger_t *trig);
|
2005-07-18 18:49:00 +00:00
|
|
|
|
2005-05-11 20:21:10 +00:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-08-15 03:33:13 +00:00
|
|
|
#endif
|