![Ralph Castain](/assets/img/avatar_default.png)
The primary change that underlies all this is in the OOB. Specifically, the problem in the code until now has been that the OOB attempts to resolve an address when we call the "send" to an unknown recipient. The OOB would then wait forever if that recipient never actually started (and hence, never reported back its OOB contact info). In the case of an orted that failed to start, we would correctly detect that the orted hadn't started, but then we would attempt to order all orteds (including the one that failed to start) to die. This would cause the OOB to "hang" the system. Unfortunately, revising how the OOB resolves addresses introduced a number of additional problems. Specifically, and most troublesome, was the fact that comm_spawn involved the immediate transmission of the rendezvous point from parent-to-child after the child was spawned. The current code used the OOB address resolution as a "barrier" - basically, the parent would attempt to send the info to the child, and then "hold" there until the child's contact info had arrived (meaning the child had started) and the send could be completed. Note that this also caused comm_spawn to "hang" the entire system if the child never started... The app-failed-to-start helped improve that behavior - this code provides additional relief. With this change, the OOB will return an ADDRESSEE_UNKNOWN error if you attempt to send to a recipient whose contact info isn't already in the OOB's hash tables. To resolve comm_spawn issues, we also now force the cross-sharing of connection info between parent and child jobs during spawn. Finally, to aid in setting triggers to the right values, we introduce the "arith" API for the GPR. This function allows you to atomically change the value in a registry location (either divide, multiply, add, or subtract) by the provided operand. It is equivalent to first fetching the value using a "get", then modifying it, and then putting the result back into the registry via a "put". This commit was SVN r14711.
264 строки
7.7 KiB
C
264 строки
7.7 KiB
C
/* -*- C -*-
|
|
*
|
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
|
* University Research and Technology
|
|
* Corporation. All rights reserved.
|
|
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
|
* of Tennessee Research Foundation. All rights
|
|
* reserved.
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
* University of Stuttgart. All rights reserved.
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
* All rights reserved.
|
|
* $COPYRIGHT$
|
|
*
|
|
* Additional copyrights may follow
|
|
*
|
|
* $HEADER$
|
|
*
|
|
*/
|
|
#ifndef ORTE_GPR_PROXY_H
|
|
#define ORTE_GPR_PROXY_H
|
|
|
|
|
|
#include "orte_config.h"
|
|
|
|
#include "orte/orte_types.h"
|
|
#include "opal/class/opal_object.h"
|
|
#include "opal/threads/mutex.h"
|
|
#include "opal/threads/condition.h"
|
|
#include "orte/class/orte_pointer_array.h"
|
|
#include "orte/dss/dss_types.h"
|
|
#include "orte/util/proc_info.h"
|
|
|
|
#include "orte/mca/gpr/base/base.h"
|
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
* Module open / close
|
|
*/
|
|
int orte_gpr_proxy_open(void);
|
|
int orte_gpr_proxy_close(void);
|
|
|
|
|
|
/*
|
|
* Startup / Shutdown
|
|
*/
|
|
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);
|
|
|
|
int orte_gpr_proxy_finalize(void);
|
|
|
|
/*
|
|
* proxy-local types
|
|
*/
|
|
typedef struct {
|
|
opal_object_t super; /**< Allows this to be an object */
|
|
orte_gpr_subscription_id_t id; /**< id of this subscription */
|
|
orte_std_cntr_t index; /**< location of this subscription in array */
|
|
char *name;
|
|
orte_gpr_notify_cb_fn_t callback; /**< Function to be called for notificaiton */
|
|
void *user_tag; /**< User-provided tag for callback function */
|
|
} orte_gpr_proxy_subscriber_t;
|
|
|
|
OBJ_CLASS_DECLARATION(orte_gpr_proxy_subscriber_t);
|
|
|
|
|
|
typedef struct {
|
|
opal_object_t super; /**< Allows this to be an object */
|
|
orte_gpr_trigger_id_t id; /**< id of this trigger */
|
|
orte_std_cntr_t index; /**< location of this trigger in array */
|
|
char *name;
|
|
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);
|
|
|
|
|
|
/*
|
|
* globals used within proxy component
|
|
*/
|
|
typedef struct {
|
|
int debug;
|
|
orte_gpr_subscription_id_t num_subs;
|
|
orte_pointer_array_t *subscriptions;
|
|
orte_gpr_trigger_id_t num_trigs;
|
|
orte_pointer_array_t *triggers;
|
|
opal_mutex_t mutex;
|
|
bool compound_cmd_mode;
|
|
orte_buffer_t *compound_cmd;
|
|
opal_mutex_t wait_for_compound_mutex;
|
|
opal_condition_t compound_cmd_condition;
|
|
int compound_cmd_waiting;
|
|
bool timing;
|
|
} orte_gpr_proxy_globals_t;
|
|
|
|
extern orte_gpr_proxy_globals_t orte_gpr_proxy_globals;
|
|
|
|
/*
|
|
* Compound cmd functions
|
|
*/
|
|
int orte_gpr_proxy_begin_compound_cmd(void);
|
|
|
|
int orte_gpr_proxy_stop_compound_cmd(void);
|
|
|
|
int orte_gpr_proxy_exec_compound_cmd(void);
|
|
|
|
/*
|
|
* Arithmetic operations
|
|
*/
|
|
int orte_gpr_proxy_arith(orte_gpr_addr_mode_t addr_mode,
|
|
char *segment, char **tokens, char **keys,
|
|
orte_dss_arith_op_t operation,
|
|
orte_data_value_t *value);
|
|
|
|
int orte_gpr_proxy_increment_value(orte_gpr_value_t *value);
|
|
|
|
int orte_gpr_proxy_decrement_value(orte_gpr_value_t *value);
|
|
|
|
/*
|
|
* Delete-index functions
|
|
*/
|
|
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);
|
|
|
|
int orte_gpr_proxy_delete_entries(orte_gpr_addr_mode_t mode,
|
|
char *segment, char **tokens, char **keys);
|
|
|
|
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);
|
|
|
|
int orte_gpr_proxy_index(char *segment, orte_std_cntr_t *cnt, char ***index);
|
|
|
|
int orte_gpr_proxy_index_nb(char *segment,
|
|
orte_gpr_notify_cb_fn_t cbfunc, void *user_tag);
|
|
|
|
|
|
/*
|
|
* Cleanup functions
|
|
*/
|
|
int orte_gpr_proxy_cleanup_job(orte_jobid_t jobid);
|
|
|
|
int orte_gpr_proxy_cleanup_proc(orte_process_name_t *proc);
|
|
|
|
|
|
/*
|
|
* Put-get functions
|
|
*/
|
|
int orte_gpr_proxy_put(orte_std_cntr_t cnt, orte_gpr_value_t **values);
|
|
|
|
int orte_gpr_proxy_put_nb(orte_std_cntr_t cnt, orte_gpr_value_t **values,
|
|
orte_gpr_notify_cb_fn_t cbfunc, void *user_tag);
|
|
|
|
int orte_gpr_proxy_get(orte_gpr_addr_mode_t addr_mode,
|
|
char *segment, char **tokens, char **keys,
|
|
orte_std_cntr_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,
|
|
orte_std_cntr_t num_conditions, orte_gpr_keyval_t **conditions,
|
|
orte_std_cntr_t *cnt, orte_gpr_value_t ***values);
|
|
|
|
int orte_gpr_proxy_get_nb(orte_gpr_addr_mode_t addr_mode,
|
|
char *segment, char **tokens, char **keys,
|
|
orte_gpr_notify_cb_fn_t cbfunc, void *user_tag);
|
|
|
|
|
|
/*
|
|
* Subscribe functions
|
|
*/
|
|
int orte_gpr_proxy_subscribe(orte_std_cntr_t num_subs,
|
|
orte_gpr_subscription_t **subscriptions,
|
|
orte_std_cntr_t num_trigs,
|
|
orte_gpr_trigger_t **trigs);
|
|
|
|
int orte_gpr_proxy_unsubscribe(orte_gpr_subscription_id_t sub_number);
|
|
|
|
int orte_gpr_proxy_cancel_trigger(orte_gpr_trigger_id_t trig);
|
|
|
|
|
|
/*
|
|
* Diagnostic functions
|
|
*/
|
|
int orte_gpr_proxy_dump_all(void);
|
|
|
|
int orte_gpr_proxy_dump_segments(char *segment);
|
|
|
|
int orte_gpr_proxy_dump_triggers(orte_gpr_trigger_id_t start);
|
|
|
|
int orte_gpr_proxy_dump_subscriptions(orte_gpr_subscription_id_t start);
|
|
|
|
int orte_gpr_proxy_dump_a_trigger(char *name,
|
|
orte_gpr_trigger_id_t id);
|
|
|
|
int orte_gpr_proxy_dump_a_subscription(char *name,
|
|
orte_gpr_subscription_id_t id);
|
|
|
|
int orte_gpr_proxy_dump_local_triggers(void);
|
|
|
|
int orte_gpr_proxy_dump_local_subscriptions(void);
|
|
|
|
int orte_gpr_proxy_dump_callbacks(void);
|
|
|
|
int orte_gpr_proxy_dump_notify_msg(orte_gpr_notify_message_t *msg);
|
|
|
|
int orte_gpr_proxy_dump_notify_data(orte_gpr_notify_data_t *data);
|
|
|
|
int orte_gpr_proxy_dump_value(orte_gpr_value_t *value);
|
|
|
|
int orte_gpr_proxy_dump_segment_size(char *segment);
|
|
|
|
/*
|
|
* General operations
|
|
*/
|
|
int orte_gpr_proxy_preallocate_segment(char *name, orte_std_cntr_t num_slots);
|
|
|
|
int orte_gpr_proxy_deliver_notify_msg(orte_gpr_notify_message_t *msg);
|
|
|
|
/*
|
|
* Functions that interface to the replica
|
|
*/
|
|
void orte_gpr_proxy_notify_recv(int status, orte_process_name_t* sender,
|
|
orte_buffer_t *buffer, orte_rml_tag_t tag,
|
|
void* cbdata);
|
|
|
|
|
|
int orte_gpr_proxy_ft_event(int state);
|
|
|
|
/*
|
|
* Internal functions
|
|
*/
|
|
|
|
int
|
|
orte_gpr_proxy_enter_subscription(orte_std_cntr_t cnt, orte_gpr_subscription_t **subscriptions);
|
|
|
|
int
|
|
orte_gpr_proxy_remove_subscription(orte_gpr_proxy_subscriber_t *sub);
|
|
|
|
int
|
|
orte_gpr_proxy_enter_trigger(orte_std_cntr_t cnt, orte_gpr_trigger_t **triggers);
|
|
|
|
|
|
int
|
|
orte_gpr_proxy_remove_trigger(orte_gpr_proxy_trigger_t *trig);
|
|
|
|
/*
|
|
*
|
|
*/
|
|
ORTE_MODULE_DECLSPEC extern mca_gpr_base_component_t mca_gpr_proxy_component;
|
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
}
|
|
#endif
|
|
|
|
#endif
|