From b9bdb2125e0dce2511655dd4a2136d6131852dd2 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Tue, 4 Apr 2006 11:05:52 +0000 Subject: [PATCH] Fix and upgrade the console to support better debugging. Activate "dump" commands to display registry content. Remove the blasted opal_output default prefix that made the dump output illegible. Properly connect to existing daemons and/or start new ones. This commit was SVN r9528. --- orte/mca/gpr/base/base.h | 4 +- orte/mca/gpr/base/gpr_base_open.c | 16 ++- .../unpack_api_response/gpr_base_print_dump.c | 4 +- orte/mca/gpr/gpr.h | 30 ++--- orte/mca/gpr/null/gpr_null.c | 30 ++--- orte/mca/gpr/proxy/gpr_proxy.h | 28 ++--- orte/mca/gpr/proxy/gpr_proxy_dump.c | 46 ++++--- .../proxy/gpr_proxy_dump_local_trigs_subs.c | 24 ++-- .../gpr/replica/api_layer/gpr_replica_api.h | 28 ++--- .../replica/api_layer/gpr_replica_dump_api.c | 62 +++++----- .../gpr_replica_dump_local_trigs_subs_api.c | 32 ++--- orte/mca/ns/base/base.h | 10 +- orte/mca/ns/base/ns_base_local_fns.c | 12 +- orte/mca/ns/base/ns_base_open.c | 14 ++- orte/mca/ns/ns.h | 8 +- orte/mca/ns/proxy/src/ns_proxy.c | 28 ++--- orte/mca/ns/proxy/src/ns_proxy.h | 8 +- orte/mca/ns/replica/src/ns_replica.c | 16 +-- orte/mca/ns/replica/src/ns_replica.h | 8 +- orte/tools/console/orteconsole.c | 112 ++++++++++++++++-- orte/tools/console/orteconsole.h | 3 +- orte/tools/orterun/orterun.c | 3 + 22 files changed, 307 insertions(+), 219 deletions(-) diff --git a/orte/mca/gpr/base/base.h b/orte/mca/gpr/base/base.h index 19ed6be01a..8a85845f29 100644 --- a/orte/mca/gpr/base/base.h +++ b/orte/mca/gpr/base/base.h @@ -244,7 +244,9 @@ int orte_gpr_base_create_keyval(orte_gpr_keyval_t **keyval, char *name, orte_gpr_subscription_id_t id); OMPI_DECLSPEC int orte_gpr_base_pack_dump_callbacks(orte_buffer_t *cmd); - OMPI_DECLSPEC int orte_gpr_base_print_dump(orte_buffer_t *buffer, int output_id); + + OMPI_DECLSPEC int orte_gpr_base_print_dump(orte_buffer_t *buffer); + OMPI_DECLSPEC int orte_gpr_base_dump_keyval_value(orte_buffer_t *buffer, orte_gpr_keyval_t *iptr); OMPI_DECLSPEC int orte_gpr_base_pack_dump_segment_size(orte_buffer_t *cmd, char *segment); diff --git a/orte/mca/gpr/base/gpr_base_open.c b/orte/mca/gpr/base/gpr_base_open.c index a3371058cb..18b30b5159 100644 --- a/orte/mca/gpr/base/gpr_base_open.c +++ b/orte/mca/gpr/base/gpr_base_open.c @@ -299,20 +299,26 @@ int orte_gpr_base_open(void) { int param, value, rc, id; orte_data_type_t tmp; + opal_output_stream_t kill_prefix; OPAL_TRACE(5); /* Debugging / verbose output */ - + /** setup the structure to kill the blasted prefix that opal_output + * now defaults to including so the output can be legible again! + */ + OBJ_CONSTRUCT(&kill_prefix, opal_output_stream_t); + kill_prefix.lds_want_stderr = true; + kill_prefix.lds_prefix = NULL; + param = mca_base_param_reg_int_name("gpr_base", "verbose", "Verbosity level for the gpr framework", false, false, 0, &value); if (value != 0) { - orte_gpr_base_output = opal_output_open(NULL); - } else { - orte_gpr_base_output = -1; + kill_prefix.lds_verbose_level = value; } - + orte_gpr_base_output = opal_output_open(&kill_prefix); + id = mca_base_param_register_int("gpr", "base", "maxsize", NULL, ORTE_GPR_ARRAY_MAX_SIZE); mca_base_param_lookup_int(id, ¶m); diff --git a/orte/mca/gpr/base/unpack_api_response/gpr_base_print_dump.c b/orte/mca/gpr/base/unpack_api_response/gpr_base_print_dump.c index 62c7992603..e75ebbac39 100644 --- a/orte/mca/gpr/base/unpack_api_response/gpr_base_print_dump.c +++ b/orte/mca/gpr/base/unpack_api_response/gpr_base_print_dump.c @@ -35,7 +35,7 @@ #include "orte/mca/gpr/base/base.h" -int orte_gpr_base_print_dump(orte_buffer_t *buffer, int output_id) +int orte_gpr_base_print_dump(orte_buffer_t *buffer) { char *line; size_t n; @@ -49,7 +49,7 @@ int orte_gpr_base_print_dump(orte_buffer_t *buffer, int output_id) ORTE_ERROR_LOG(rc); return rc; } - opal_output(output_id, "%s", line); + opal_output(orte_gpr_base_output, "%s", line); free(line); n=1; } diff --git a/orte/mca/gpr/gpr.h b/orte/mca/gpr/gpr.h index c30b815ff7..faaa87cd30 100644 --- a/orte/mca/gpr/gpr.h +++ b/orte/mca/gpr/gpr.h @@ -569,41 +569,37 @@ typedef int (*orte_gpr_base_module_cancel_trigger_fn_t)(orte_gpr_trigger_id_t tr * orte_gpr.dump(output_id); * @endcode */ -typedef int (*orte_gpr_base_module_dump_all_fn_t)(int output_id); +typedef int (*orte_gpr_base_module_dump_all_fn_t)(void); -typedef int (*orte_gpr_base_module_dump_segment_fn_t)(char *segment, int output_id); +typedef int (*orte_gpr_base_module_dump_segment_fn_t)(char *segment); typedef int (*orte_gpr_base_module_dump_triggers_fn_t)( - orte_gpr_trigger_id_t tail, - int output_id); + orte_gpr_trigger_id_t tail); typedef int (*orte_gpr_base_module_dump_subscriptions_fn_t)( - orte_gpr_subscription_id_t tail, - int output_id); + orte_gpr_subscription_id_t tail); typedef int (*orte_gpr_base_module_dump_a_trigger_fn_t)( char *name, - orte_gpr_trigger_id_t id, - int output_id); + orte_gpr_trigger_id_t id); typedef int (*orte_gpr_base_module_dump_a_subscription_fn_t)( char *name, - orte_gpr_subscription_id_t id, - int output_id); + orte_gpr_subscription_id_t id); -typedef int (*orte_gpr_base_module_dump_local_triggers_fn_t)(int output_id); +typedef int (*orte_gpr_base_module_dump_local_triggers_fn_t)(void); -typedef int (*orte_gpr_base_module_dump_local_subscriptions_fn_t)(int output_id); +typedef int (*orte_gpr_base_module_dump_local_subscriptions_fn_t)(void); -typedef int (*orte_gpr_base_module_dump_callbacks_fn_t) (int output_id); +typedef int (*orte_gpr_base_module_dump_callbacks_fn_t) (void); -typedef int (*orte_gpr_base_module_dump_notify_msg_fn_t)(orte_gpr_notify_message_t *msg, int output_id); +typedef int (*orte_gpr_base_module_dump_notify_msg_fn_t)(orte_gpr_notify_message_t *msg); -typedef int (*orte_gpr_base_module_dump_notify_data_fn_t)(orte_gpr_notify_data_t *data, int output_id); +typedef int (*orte_gpr_base_module_dump_notify_data_fn_t)(orte_gpr_notify_data_t *data); -typedef int (*orte_gpr_base_module_dump_value_fn_t)(orte_gpr_value_t *value, int output_id); +typedef int (*orte_gpr_base_module_dump_value_fn_t)(orte_gpr_value_t *value); -typedef int (*orte_gpr_base_module_dump_segment_size_fn_t)(char *segment, int output_id); +typedef int (*orte_gpr_base_module_dump_segment_size_fn_t)(char *segment); /* * Increment value diff --git a/orte/mca/gpr/null/gpr_null.c b/orte/mca/gpr/null/gpr_null.c index 222632fc63..a1f74f146d 100644 --- a/orte/mca/gpr/null/gpr_null.c +++ b/orte/mca/gpr/null/gpr_null.c @@ -174,69 +174,67 @@ orte_gpr_null_cancel_trigger(orte_gpr_trigger_id_t trig_number) } static int -orte_gpr_null_dump_all(int output_id) +orte_gpr_null_dump_all(void) { return ORTE_SUCCESS; } static int -orte_gpr_null_dump_segments(char *segment, int output_id) +orte_gpr_null_dump_segments(char *segment) { return ORTE_SUCCESS; } static int -orte_gpr_null_dump_triggers(orte_gpr_trigger_id_t start, int output_id) +orte_gpr_null_dump_triggers(orte_gpr_trigger_id_t start) { return ORTE_SUCCESS; } static int -orte_gpr_null_dump_subscriptions(orte_gpr_subscription_id_t start, int output_id) +orte_gpr_null_dump_subscriptions(orte_gpr_subscription_id_t start) { return ORTE_SUCCESS; } static int -orte_gpr_null_dump_local_triggers(int output_id) +orte_gpr_null_dump_local_triggers(void) { return ORTE_SUCCESS; } static int -orte_gpr_null_dump_local_subscriptions(int output_id) +orte_gpr_null_dump_local_subscriptions(void) { return ORTE_SUCCESS; } static int -orte_gpr_null_dump_callbacks(int output_id) +orte_gpr_null_dump_callbacks(void) { return ORTE_SUCCESS; } static int -orte_gpr_null_dump_notify_msg(orte_gpr_notify_message_t * msg, - int output_id) +orte_gpr_null_dump_notify_msg(orte_gpr_notify_message_t * msg) { return ORTE_SUCCESS; } static int -orte_gpr_null_dump_notify_data(orte_gpr_notify_data_t * data, - int output_id) +orte_gpr_null_dump_notify_data(orte_gpr_notify_data_t * data) { return ORTE_SUCCESS; } static int -orte_gpr_null_dump_value(orte_gpr_value_t * value, int output_id) +orte_gpr_null_dump_value(orte_gpr_value_t * value) { return ORTE_SUCCESS; } static int -orte_gpr_null_dump_segment_size(char *segment, int output_id) +orte_gpr_null_dump_segment_size(char *segment) { return ORTE_SUCCESS; } @@ -336,16 +334,14 @@ static int orte_gpr_null_deliver_notify_msg(orte_gpr_notify_message_t *msg) static int orte_gpr_null_dump_a_trigger( char *name, - orte_gpr_trigger_id_t id, - int output_id) + orte_gpr_trigger_id_t id) { return ORTE_SUCCESS; } static int orte_gpr_null_dump_a_subscription( char *name, - orte_gpr_subscription_id_t id, - int output_id) + orte_gpr_subscription_id_t id) { return ORTE_SUCCESS; } diff --git a/orte/mca/gpr/proxy/gpr_proxy.h b/orte/mca/gpr/proxy/gpr_proxy.h index 010def35b0..24796739b4 100644 --- a/orte/mca/gpr/proxy/gpr_proxy.h +++ b/orte/mca/gpr/proxy/gpr_proxy.h @@ -182,35 +182,33 @@ int orte_gpr_proxy_cancel_trigger(orte_gpr_trigger_id_t trig); /* * Diagnostic functions */ -int orte_gpr_proxy_dump_all(int output_id); +int orte_gpr_proxy_dump_all(void); -int orte_gpr_proxy_dump_segments(char *segment, int output_id); +int orte_gpr_proxy_dump_segments(char *segment); -int orte_gpr_proxy_dump_triggers(orte_gpr_trigger_id_t start, int output_id); +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 output_id); +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 output_id); + orte_gpr_trigger_id_t id); int orte_gpr_proxy_dump_a_subscription(char *name, - orte_gpr_subscription_id_t id, - int output_id); + orte_gpr_subscription_id_t id); -int orte_gpr_proxy_dump_local_triggers(int output_id); +int orte_gpr_proxy_dump_local_triggers(void); -int orte_gpr_proxy_dump_local_subscriptions(int output_id); +int orte_gpr_proxy_dump_local_subscriptions(void); -int orte_gpr_proxy_dump_callbacks(int output_id); +int orte_gpr_proxy_dump_callbacks(void); -int orte_gpr_proxy_dump_notify_msg(orte_gpr_notify_message_t *msg, int output_id); +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 output_id); +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 output_id); +int orte_gpr_proxy_dump_value(orte_gpr_value_t *value); -int orte_gpr_proxy_dump_segment_size(char *segment, int output_id); +int orte_gpr_proxy_dump_segment_size(char *segment); /* * General operations diff --git a/orte/mca/gpr/proxy/gpr_proxy_dump.c b/orte/mca/gpr/proxy/gpr_proxy_dump.c index de60a3935c..9293f729ae 100644 --- a/orte/mca/gpr/proxy/gpr_proxy_dump.c +++ b/orte/mca/gpr/proxy/gpr_proxy_dump.c @@ -47,7 +47,7 @@ #include "gpr_proxy.h" -int orte_gpr_proxy_dump_all(int output_id) +int orte_gpr_proxy_dump_all(void) { orte_gpr_cmd_flag_t command; orte_buffer_t *cmd; @@ -100,7 +100,7 @@ int orte_gpr_proxy_dump_all(int output_id) return ORTE_ERR_COMM_FAILURE; } - if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer))) { ORTE_ERROR_LOG(rc); } @@ -108,7 +108,7 @@ int orte_gpr_proxy_dump_all(int output_id) return rc; } -int orte_gpr_proxy_dump_segments(char *segment, int output_id) +int orte_gpr_proxy_dump_segments(char *segment) { orte_gpr_cmd_flag_t command; orte_buffer_t *cmd; @@ -161,7 +161,7 @@ int orte_gpr_proxy_dump_segments(char *segment, int output_id) return ORTE_ERR_COMM_FAILURE; } - if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer))) { ORTE_ERROR_LOG(rc); } @@ -169,7 +169,7 @@ int orte_gpr_proxy_dump_segments(char *segment, int output_id) return rc; } -int orte_gpr_proxy_dump_triggers(orte_gpr_trigger_id_t start, int output_id) +int orte_gpr_proxy_dump_triggers(orte_gpr_trigger_id_t start) { orte_gpr_cmd_flag_t command; orte_buffer_t *cmd; @@ -222,7 +222,7 @@ int orte_gpr_proxy_dump_triggers(orte_gpr_trigger_id_t start, int output_id) return ORTE_ERR_COMM_FAILURE; } - if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer))) { ORTE_ERROR_LOG(rc); } @@ -230,7 +230,7 @@ int orte_gpr_proxy_dump_triggers(orte_gpr_trigger_id_t start, int output_id) return rc; } -int orte_gpr_proxy_dump_subscriptions(orte_gpr_subscription_id_t start, int output_id) +int orte_gpr_proxy_dump_subscriptions(orte_gpr_subscription_id_t start) { orte_gpr_cmd_flag_t command; orte_buffer_t *cmd; @@ -283,7 +283,7 @@ int orte_gpr_proxy_dump_subscriptions(orte_gpr_subscription_id_t start, int outp return ORTE_ERR_COMM_FAILURE; } - if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer))) { ORTE_ERROR_LOG(rc); } @@ -292,8 +292,7 @@ int orte_gpr_proxy_dump_subscriptions(orte_gpr_subscription_id_t start, int outp } int orte_gpr_proxy_dump_a_trigger(char *name, - orte_gpr_trigger_id_t id, - int output_id) + orte_gpr_trigger_id_t id) { orte_gpr_cmd_flag_t command; orte_buffer_t *cmd; @@ -346,7 +345,7 @@ int orte_gpr_proxy_dump_a_trigger(char *name, return ORTE_ERR_COMM_FAILURE; } - if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer))) { ORTE_ERROR_LOG(rc); } @@ -356,8 +355,7 @@ int orte_gpr_proxy_dump_a_trigger(char *name, int orte_gpr_proxy_dump_a_subscription(char *name, - orte_gpr_subscription_id_t id, - int output_id) + orte_gpr_subscription_id_t id) { orte_gpr_cmd_flag_t command; orte_buffer_t *cmd; @@ -410,7 +408,7 @@ int orte_gpr_proxy_dump_a_subscription(char *name, return ORTE_ERR_COMM_FAILURE; } - if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer))) { ORTE_ERROR_LOG(rc); } @@ -419,7 +417,7 @@ int orte_gpr_proxy_dump_a_subscription(char *name, } -int orte_gpr_proxy_dump_callbacks(int output_id) +int orte_gpr_proxy_dump_callbacks(void) { orte_gpr_cmd_flag_t command; orte_buffer_t *cmd; @@ -472,7 +470,7 @@ int orte_gpr_proxy_dump_callbacks(int output_id) return ORTE_ERR_COMM_FAILURE; } - if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer))) { ORTE_ERROR_LOG(rc); } @@ -480,7 +478,7 @@ int orte_gpr_proxy_dump_callbacks(int output_id) return rc; } -int orte_gpr_proxy_dump_notify_msg(orte_gpr_notify_message_t *msg, int output_id) +int orte_gpr_proxy_dump_notify_msg(orte_gpr_notify_message_t *msg) { orte_buffer_t *answer; int rc; @@ -497,7 +495,7 @@ int orte_gpr_proxy_dump_notify_msg(orte_gpr_notify_message_t *msg, int output_id return rc; } - if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer))) { ORTE_ERROR_LOG(rc); } @@ -506,7 +504,7 @@ int orte_gpr_proxy_dump_notify_msg(orte_gpr_notify_message_t *msg, int output_id } -int orte_gpr_proxy_dump_notify_data(orte_gpr_notify_data_t *data, int output_id) +int orte_gpr_proxy_dump_notify_data(orte_gpr_notify_data_t *data) { orte_buffer_t *answer; int rc; @@ -523,7 +521,7 @@ int orte_gpr_proxy_dump_notify_data(orte_gpr_notify_data_t *data, int output_id) return rc; } - if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer))) { ORTE_ERROR_LOG(rc); } @@ -531,7 +529,7 @@ int orte_gpr_proxy_dump_notify_data(orte_gpr_notify_data_t *data, int output_id) return rc; } -int orte_gpr_proxy_dump_value(orte_gpr_value_t *value, int output_id) +int orte_gpr_proxy_dump_value(orte_gpr_value_t *value) { orte_buffer_t *answer; int rc; @@ -548,7 +546,7 @@ int orte_gpr_proxy_dump_value(orte_gpr_value_t *value, int output_id) return rc; } - if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer))) { ORTE_ERROR_LOG(rc); } @@ -556,7 +554,7 @@ int orte_gpr_proxy_dump_value(orte_gpr_value_t *value, int output_id) return rc; } -int orte_gpr_proxy_dump_segment_size(char *segment, int output_id) +int orte_gpr_proxy_dump_segment_size(char *segment) { orte_gpr_cmd_flag_t command; orte_buffer_t *cmd; @@ -609,7 +607,7 @@ int orte_gpr_proxy_dump_segment_size(char *segment, int output_id) return ORTE_ERR_COMM_FAILURE; } - if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer))) { ORTE_ERROR_LOG(rc); } diff --git a/orte/mca/gpr/proxy/gpr_proxy_dump_local_trigs_subs.c b/orte/mca/gpr/proxy/gpr_proxy_dump_local_trigs_subs.c index c0c0c6172d..4f0ab1f1d4 100644 --- a/orte/mca/gpr/proxy/gpr_proxy_dump_local_trigs_subs.c +++ b/orte/mca/gpr/proxy/gpr_proxy_dump_local_trigs_subs.c @@ -45,50 +45,50 @@ #include "gpr_proxy.h" -int orte_gpr_proxy_dump_local_triggers(int output_id) +int orte_gpr_proxy_dump_local_triggers(void) { orte_gpr_proxy_trigger_t **trigs; size_t j, k; - opal_output(output_id, "DUMP OF LOCAL TRIGGERS for [%lu,%lu,%lu]\n", + opal_output(orte_gpr_base_output, "DUMP OF LOCAL TRIGGERS for [%lu,%lu,%lu]\n", ORTE_NAME_ARGS(orte_process_info.my_name)); - opal_output(output_id, "Number of triggers: %lu\n", (unsigned long) orte_gpr_proxy_globals.num_trigs); + opal_output(orte_gpr_base_output, "Number of triggers: %lu\n", (unsigned long) orte_gpr_proxy_globals.num_trigs); trigs = (orte_gpr_proxy_trigger_t**)(orte_gpr_proxy_globals.triggers)->addr; for (j=0, k=0; k < orte_gpr_proxy_globals.num_trigs && j < (orte_gpr_proxy_globals.triggers)->size; j++) { if (NULL != trigs[j]) { k++; - opal_output(output_id, "Data for trigger %lu", (unsigned long) trigs[j]->id); + opal_output(orte_gpr_base_output, "Data for trigger %lu", (unsigned long) trigs[j]->id); if (NULL == trigs[j]->name) { - opal_output(output_id, "\tNOT a named trigger"); + opal_output(orte_gpr_base_output, "\tNOT a named trigger"); } else { - opal_output(output_id, "\ttrigger name: %s", trigs[j]->name); + opal_output(orte_gpr_base_output, "\ttrigger name: %s", trigs[j]->name); } } } return ORTE_SUCCESS; } -int orte_gpr_proxy_dump_local_subscriptions(int output_id) +int orte_gpr_proxy_dump_local_subscriptions(void) { orte_gpr_proxy_subscriber_t **subs; size_t j, k; - opal_output(output_id, "DUMP OF LOCAL SUBSCRIPTIONS for [%lu,%lu,%lu]\n", + opal_output(orte_gpr_base_output, "DUMP OF LOCAL SUBSCRIPTIONS for [%lu,%lu,%lu]\n", ORTE_NAME_ARGS(orte_process_info.my_name)); - opal_output(output_id, "Number of subscriptions: %lu\n", (unsigned long) orte_gpr_proxy_globals.num_subs); + opal_output(orte_gpr_base_output, "Number of subscriptions: %lu\n", (unsigned long) orte_gpr_proxy_globals.num_subs); subs = (orte_gpr_proxy_subscriber_t**)(orte_gpr_proxy_globals.subscriptions)->addr; for (j=0, k=0; k < orte_gpr_proxy_globals.num_subs && j < (orte_gpr_proxy_globals.subscriptions)->size; j++) { if (NULL != subs[j]) { k++; - opal_output(output_id, "Data for subscription %lu", (unsigned long) subs[j]->id); + opal_output(orte_gpr_base_output, "Data for subscription %lu", (unsigned long) subs[j]->id); if (NULL == subs[j]->name) { - opal_output(output_id, "\tNOT a named subscription"); + opal_output(orte_gpr_base_output, "\tNOT a named subscription"); } else { - opal_output(output_id, "\tsubscription name: %s", subs[j]->name); + opal_output(orte_gpr_base_output, "\tsubscription name: %s", subs[j]->name); } } } diff --git a/orte/mca/gpr/replica/api_layer/gpr_replica_api.h b/orte/mca/gpr/replica/api_layer/gpr_replica_api.h index b856b8798b..5f26a713fb 100644 --- a/orte/mca/gpr/replica/api_layer/gpr_replica_api.h +++ b/orte/mca/gpr/replica/api_layer/gpr_replica_api.h @@ -132,37 +132,35 @@ int orte_gpr_replica_cancel_trigger(orte_gpr_trigger_id_t trig); /* * Diagnostic functions */ -int orte_gpr_replica_dump_all(int output_id); +int orte_gpr_replica_dump_all(void); -int orte_gpr_replica_dump_segments(char *segment, int output_id); +int orte_gpr_replica_dump_segments(char *segment); -int orte_gpr_replica_dump_triggers(orte_gpr_trigger_id_t start, int output_id); +int orte_gpr_replica_dump_triggers(orte_gpr_trigger_id_t start); -int orte_gpr_replica_dump_subscriptions(orte_gpr_subscription_id_t start, int output_id); +int orte_gpr_replica_dump_subscriptions(orte_gpr_subscription_id_t start); int orte_gpr_replica_dump_a_trigger( char *name, - orte_gpr_trigger_id_t id, - int output_id); + orte_gpr_trigger_id_t id); int orte_gpr_replica_dump_a_subscription( char *name, - orte_gpr_subscription_id_t id, - int output_id); + orte_gpr_subscription_id_t id); -int orte_gpr_replica_dump_local_triggers(int output_id); +int orte_gpr_replica_dump_local_triggers(void); -int orte_gpr_replica_dump_local_subscriptions(int output_id); +int orte_gpr_replica_dump_local_subscriptions(void); -int orte_gpr_replica_dump_callbacks(int output_id); +int orte_gpr_replica_dump_callbacks(void); -int orte_gpr_replica_dump_notify_msg(orte_gpr_notify_message_t *msg, int output_id); +int orte_gpr_replica_dump_notify_msg(orte_gpr_notify_message_t *msg); -int orte_gpr_replica_dump_notify_data(orte_gpr_notify_data_t *data, int output_id); +int orte_gpr_replica_dump_notify_data(orte_gpr_notify_data_t *data); -int orte_gpr_replica_dump_value(orte_gpr_value_t *value, int output_id); +int orte_gpr_replica_dump_value(orte_gpr_value_t *value); -int orte_gpr_replica_dump_segment_size(char *segment, int output_id); +int orte_gpr_replica_dump_segment_size(char *segment); /* * General functions diff --git a/orte/mca/gpr/replica/api_layer/gpr_replica_dump_api.c b/orte/mca/gpr/replica/api_layer/gpr_replica_dump_api.c index 7d49432f48..513968d55f 100644 --- a/orte/mca/gpr/replica/api_layer/gpr_replica_dump_api.c +++ b/orte/mca/gpr/replica/api_layer/gpr_replica_dump_api.c @@ -36,14 +36,14 @@ #include "orte/mca/gpr/replica/api_layer/gpr_replica_api.h" -int orte_gpr_replica_dump_all(int output_id) +int orte_gpr_replica_dump_all(void) { orte_buffer_t *buffer; int rc; if (orte_gpr_replica_globals.debug) { - opal_output(0, "[%lu,%lu,%lu] gpr_replica_dump_all: entered for output on %d", - ORTE_NAME_ARGS(orte_process_info.my_name), output_id); + opal_output(0, "[%lu,%lu,%lu] gpr_replica_dump_all: entered", + ORTE_NAME_ARGS(orte_process_info.my_name)); } OPAL_THREAD_LOCK(&orte_gpr_replica_globals.mutex); @@ -59,7 +59,7 @@ int orte_gpr_replica_dump_all(int output_id) } if (ORTE_SUCCESS == rc) { - orte_gpr_base_print_dump(buffer, output_id); + orte_gpr_base_print_dump(buffer); } OBJ_RELEASE(buffer); @@ -68,14 +68,14 @@ int orte_gpr_replica_dump_all(int output_id) return rc; } -int orte_gpr_replica_dump_segments(char *segment, int output_id) +int orte_gpr_replica_dump_segments(char *segment) { orte_buffer_t *buffer; int rc; if (orte_gpr_replica_globals.debug) { - opal_output(0, "[%lu,%lu,%lu] gpr_replica_dump_segments: entered for output on %d", - ORTE_NAME_ARGS(orte_process_info.my_name), output_id); + opal_output(0, "[%lu,%lu,%lu] gpr_replica_dump_segments: entered", + ORTE_NAME_ARGS(orte_process_info.my_name)); } OPAL_THREAD_LOCK(&orte_gpr_replica_globals.mutex); @@ -91,7 +91,7 @@ int orte_gpr_replica_dump_segments(char *segment, int output_id) } if (ORTE_SUCCESS == rc) { - orte_gpr_base_print_dump(buffer, output_id); + orte_gpr_base_print_dump(buffer); } OBJ_RELEASE(buffer); @@ -100,14 +100,14 @@ int orte_gpr_replica_dump_segments(char *segment, int output_id) return rc; } -int orte_gpr_replica_dump_triggers(orte_gpr_trigger_id_t start, int output_id) +int orte_gpr_replica_dump_triggers(orte_gpr_trigger_id_t start) { orte_buffer_t *buffer; int rc; if (orte_gpr_replica_globals.debug) { - opal_output(0, "[%lu,%lu,%lu] gpr_replica_dump_triggers: entered for output on %d", - ORTE_NAME_ARGS(orte_process_info.my_name), output_id); + opal_output(0, "[%lu,%lu,%lu] gpr_replica_dump_triggers: entered", + ORTE_NAME_ARGS(orte_process_info.my_name)); } OPAL_THREAD_LOCK(&orte_gpr_replica_globals.mutex); @@ -123,7 +123,7 @@ int orte_gpr_replica_dump_triggers(orte_gpr_trigger_id_t start, int output_id) } if (ORTE_SUCCESS == rc) { - orte_gpr_base_print_dump(buffer, output_id); + orte_gpr_base_print_dump(buffer); } OBJ_RELEASE(buffer); @@ -132,7 +132,7 @@ int orte_gpr_replica_dump_triggers(orte_gpr_trigger_id_t start, int output_id) return rc; } -int orte_gpr_replica_dump_subscriptions(orte_gpr_subscription_id_t start, int output_id) +int orte_gpr_replica_dump_subscriptions(orte_gpr_subscription_id_t start) { orte_buffer_t *buffer; int rc; @@ -150,7 +150,7 @@ int orte_gpr_replica_dump_subscriptions(orte_gpr_subscription_id_t start, int ou } if (ORTE_SUCCESS == rc) { - orte_gpr_base_print_dump(buffer, output_id); + orte_gpr_base_print_dump(buffer); } OBJ_RELEASE(buffer); @@ -161,8 +161,7 @@ int orte_gpr_replica_dump_subscriptions(orte_gpr_subscription_id_t start, int ou int orte_gpr_replica_dump_a_trigger( char *name, - orte_gpr_trigger_id_t id, - int output_id) + orte_gpr_trigger_id_t id) { orte_buffer_t buffer; orte_gpr_replica_trigger_t **trigs; @@ -213,7 +212,7 @@ int orte_gpr_replica_dump_a_trigger( PROCESS: if (ORTE_SUCCESS == rc) { - orte_gpr_base_print_dump(&buffer, output_id); + orte_gpr_base_print_dump(&buffer); } OBJ_DESTRUCT(&buffer); @@ -224,8 +223,7 @@ PROCESS: int orte_gpr_replica_dump_a_subscription(char *name, - orte_gpr_subscription_id_t id, - int output_id) + orte_gpr_subscription_id_t id) { orte_buffer_t buffer; orte_gpr_replica_subscription_t **subs; @@ -276,7 +274,7 @@ int orte_gpr_replica_dump_a_subscription(char *name, PROCESS: if (ORTE_SUCCESS == rc) { - orte_gpr_base_print_dump(&buffer, output_id); + orte_gpr_base_print_dump(&buffer); } OBJ_DESTRUCT(&buffer); @@ -286,14 +284,14 @@ PROCESS: } -int orte_gpr_replica_dump_callbacks(int output_id) +int orte_gpr_replica_dump_callbacks(void) { orte_buffer_t *buffer; int rc; if (orte_gpr_replica_globals.debug) { - opal_output(0, "[%lu,%lu,%lu] gpr_replica_dump_callbacks: entered for output on %d", - ORTE_NAME_ARGS(orte_process_info.my_name), output_id); + opal_output(0, "[%lu,%lu,%lu] gpr_replica_dump_callbacks: entered", + ORTE_NAME_ARGS(orte_process_info.my_name)); } OPAL_THREAD_LOCK(&orte_gpr_replica_globals.mutex); @@ -309,7 +307,7 @@ int orte_gpr_replica_dump_callbacks(int output_id) } if (ORTE_SUCCESS == rc) { - orte_gpr_base_print_dump(buffer, output_id); + orte_gpr_base_print_dump(buffer); } OBJ_RELEASE(buffer); @@ -318,7 +316,7 @@ int orte_gpr_replica_dump_callbacks(int output_id) return rc; } -int orte_gpr_replica_dump_notify_msg(orte_gpr_notify_message_t *msg, int output_id) +int orte_gpr_replica_dump_notify_msg(orte_gpr_notify_message_t *msg) { orte_buffer_t *answer; int rc; @@ -335,7 +333,7 @@ int orte_gpr_replica_dump_notify_msg(orte_gpr_notify_message_t *msg, int output_ return rc; } - if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer))) { ORTE_ERROR_LOG(rc); } @@ -344,7 +342,7 @@ int orte_gpr_replica_dump_notify_msg(orte_gpr_notify_message_t *msg, int output_ } -int orte_gpr_replica_dump_notify_data(orte_gpr_notify_data_t *data, int output_id) +int orte_gpr_replica_dump_notify_data(orte_gpr_notify_data_t *data) { orte_buffer_t *answer; int rc; @@ -361,7 +359,7 @@ int orte_gpr_replica_dump_notify_data(orte_gpr_notify_data_t *data, int output_i return rc; } - if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer))) { ORTE_ERROR_LOG(rc); } @@ -369,7 +367,7 @@ int orte_gpr_replica_dump_notify_data(orte_gpr_notify_data_t *data, int output_i return rc; } -int orte_gpr_replica_dump_value(orte_gpr_value_t *value, int output_id) +int orte_gpr_replica_dump_value(orte_gpr_value_t *value) { orte_buffer_t *answer; int rc; @@ -386,7 +384,7 @@ int orte_gpr_replica_dump_value(orte_gpr_value_t *value, int output_id) return rc; } - if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_gpr_base_print_dump(answer))) { ORTE_ERROR_LOG(rc); } @@ -394,7 +392,7 @@ int orte_gpr_replica_dump_value(orte_gpr_value_t *value, int output_id) return rc; } -int orte_gpr_replica_dump_segment_size(char *segment, int output_id) +int orte_gpr_replica_dump_segment_size(char *segment) { orte_buffer_t *buffer; int rc; @@ -412,7 +410,7 @@ int orte_gpr_replica_dump_segment_size(char *segment, int output_id) } if (ORTE_SUCCESS == rc) { - orte_gpr_base_print_dump(buffer, output_id); + orte_gpr_base_print_dump(buffer); } OBJ_RELEASE(buffer); diff --git a/orte/mca/gpr/replica/api_layer/gpr_replica_dump_local_trigs_subs_api.c b/orte/mca/gpr/replica/api_layer/gpr_replica_dump_local_trigs_subs_api.c index 04ab7fa37b..7a816e4bde 100644 --- a/orte/mca/gpr/replica/api_layer/gpr_replica_dump_local_trigs_subs_api.c +++ b/orte/mca/gpr/replica/api_layer/gpr_replica_dump_local_trigs_subs_api.c @@ -35,60 +35,60 @@ #include "orte/mca/gpr/replica/api_layer/gpr_replica_api.h" -int orte_gpr_replica_dump_local_triggers(int output_id) +int orte_gpr_replica_dump_local_triggers(void) { orte_gpr_replica_local_trigger_t **trigs; size_t j, k; - opal_output(output_id, "DUMP OF LOCAL TRIGGERS for [%lu,%lu,%lu]\n", + opal_output(orte_gpr_base_output, "DUMP OF LOCAL TRIGGERS for [%lu,%lu,%lu]\n", ORTE_NAME_ARGS(orte_process_info.my_name)); - opal_output(output_id, "Number of triggers: %lu\n", (unsigned long) orte_gpr_replica_globals.num_local_trigs); + opal_output(orte_gpr_base_output, "Number of triggers: %lu\n", (unsigned long) orte_gpr_replica_globals.num_local_trigs); trigs = (orte_gpr_replica_local_trigger_t**)(orte_gpr_replica_globals.local_triggers)->addr; for (j=0, k=0; k < orte_gpr_replica_globals.num_local_trigs && j < (orte_gpr_replica_globals.local_triggers)->size; j++) { if (NULL != trigs[j]) { k++; - opal_output(output_id, "Data for trigger %lu", (unsigned long) trigs[j]->id); + opal_output(orte_gpr_base_output, "Data for trigger %lu", (unsigned long) trigs[j]->id); if (NULL == trigs[j]->name) { - opal_output(output_id, "\tNOT a named trigger"); + opal_output(orte_gpr_base_output, "\tNOT a named trigger"); } else { - opal_output(output_id, "\ttrigger name: %s", trigs[j]->name); + opal_output(orte_gpr_base_output, "\ttrigger name: %s", trigs[j]->name); } if (NULL == trigs[j]->callback) { - opal_output(output_id, "\tNULL callback"); + opal_output(orte_gpr_base_output, "\tNULL callback"); } else { - opal_output(output_id, "\tCallback %0x", trigs[j]->callback); + opal_output(orte_gpr_base_output, "\tCallback %0x", trigs[j]->callback); } } } return ORTE_SUCCESS; } -int orte_gpr_replica_dump_local_subscriptions(int output_id) +int orte_gpr_replica_dump_local_subscriptions(void) { orte_gpr_replica_local_subscriber_t **subs; size_t j, k; - opal_output(output_id, "DUMP OF LOCAL SUBSCRIPTIONS for [%lu,%lu,%lu]\n", + opal_output(orte_gpr_base_output, "DUMP OF LOCAL SUBSCRIPTIONS for [%lu,%lu,%lu]\n", ORTE_NAME_ARGS(orte_process_info.my_name)); - opal_output(output_id, "Number of subscriptions: %lu\n", (unsigned long) orte_gpr_replica_globals.num_local_subs); + opal_output(orte_gpr_base_output, "Number of subscriptions: %lu\n", (unsigned long) orte_gpr_replica_globals.num_local_subs); subs = (orte_gpr_replica_local_subscriber_t**)(orte_gpr_replica_globals.local_subscriptions)->addr; for (j=0, k=0; k < orte_gpr_replica_globals.num_local_subs && j < (orte_gpr_replica_globals.local_subscriptions)->size; j++) { if (NULL != subs[j]) { k++; - opal_output(output_id, "Data for subscription %lu", (unsigned long) subs[j]->id); + opal_output(orte_gpr_base_output, "Data for subscription %lu", (unsigned long) subs[j]->id); if (NULL == subs[j]->name) { - opal_output(output_id, "\tNOT a named subscription"); + opal_output(orte_gpr_base_output, "\tNOT a named subscription"); } else { - opal_output(output_id, "\tsubscription name: %s", subs[j]->name); + opal_output(orte_gpr_base_output, "\tsubscription name: %s", subs[j]->name); } if (NULL == subs[j]->callback) { - opal_output(output_id, "\tNULL callback"); + opal_output(orte_gpr_base_output, "\tNULL callback"); } else { - opal_output(output_id, "\tCallback %0x", subs[j]->callback); + opal_output(orte_gpr_base_output, "\tCallback %0x", subs[j]->callback); } } } return ORTE_SUCCESS; diff --git a/orte/mca/ns/base/base.h b/orte/mca/ns/base/base.h index 3a563bb0e1..4241a5bad6 100644 --- a/orte/mca/ns/base/base.h +++ b/orte/mca/ns/base/base.h @@ -132,7 +132,7 @@ OMPI_DECLSPEC int orte_ns_base_compare(orte_ns_cmp_bitmask_t fields, OMPI_DECLSPEC int orte_ns_base_free_name(orte_process_name_t **name); -OMPI_DECLSPEC int orte_ns_base_print_dump(orte_buffer_t *buffer, int output_id); +OMPI_DECLSPEC int orte_ns_base_print_dump(orte_buffer_t *buffer); /* not available functions */ @@ -165,10 +165,10 @@ OMPI_DECLSPEC int orte_ns_base_create_my_name_not_available(void); OMPI_DECLSPEC int orte_ns_base_get_job_peers_not_available(orte_process_name_t **procs, size_t *num_procs, orte_jobid_t job); -OMPI_DECLSPEC int orte_ns_base_dump_cells_not_available(int output_id); -OMPI_DECLSPEC int orte_ns_base_dump_jobs_not_available(int output_id); -OMPI_DECLSPEC int orte_ns_base_dump_tags_not_available(int output_id); -OMPI_DECLSPEC int orte_ns_base_dump_datatypes_not_available(int output_id); +OMPI_DECLSPEC int orte_ns_base_dump_cells_not_available(void); +OMPI_DECLSPEC int orte_ns_base_dump_jobs_not_available(void); +OMPI_DECLSPEC int orte_ns_base_dump_tags_not_available(void); +OMPI_DECLSPEC int orte_ns_base_dump_datatypes_not_available(void); /* Base functions used everywhere */ OMPI_DECLSPEC int orte_ns_base_get_peers(orte_process_name_t **procs, diff --git a/orte/mca/ns/base/ns_base_local_fns.c b/orte/mca/ns/base/ns_base_local_fns.c index fc2b178e78..8eebd003aa 100644 --- a/orte/mca/ns/base/ns_base_local_fns.c +++ b/orte/mca/ns/base/ns_base_local_fns.c @@ -125,28 +125,28 @@ int orte_ns_base_get_job_peers_not_available(orte_process_name_t **procs, } int -orte_ns_base_dump_cells_not_available(int output_id) +orte_ns_base_dump_cells_not_available(void) { ORTE_ERROR_LOG(ORTE_ERR_UNREACH); return ORTE_ERR_UNREACH; } int -orte_ns_base_dump_jobs_not_available(int output_id) +orte_ns_base_dump_jobs_not_available(void) { ORTE_ERROR_LOG(ORTE_ERR_UNREACH); return ORTE_ERR_UNREACH; } int -orte_ns_base_dump_tags_not_available(int output_id) +orte_ns_base_dump_tags_not_available(void) { ORTE_ERROR_LOG(ORTE_ERR_UNREACH); return ORTE_ERR_UNREACH; } int -orte_ns_base_dump_datatypes_not_available(int output_id) +orte_ns_base_dump_datatypes_not_available(void) { ORTE_ERROR_LOG(ORTE_ERR_UNREACH); return ORTE_ERR_UNREACH; @@ -654,7 +654,7 @@ int orte_ns_base_get_peers(orte_process_name_t **procs, /* * DIAGNOSTIC FUNCTIONS */ -int orte_ns_base_print_dump(orte_buffer_t *buffer, int output_id) +int orte_ns_base_print_dump(orte_buffer_t *buffer) { char *line; size_t n; @@ -668,7 +668,7 @@ int orte_ns_base_print_dump(orte_buffer_t *buffer, int output_id) ORTE_ERROR_LOG(rc); return rc; } - opal_output(output_id, "%s", line); + opal_output(mca_ns_base_output, "%s", line); free(line); n=1; } diff --git a/orte/mca/ns/base/ns_base_open.c b/orte/mca/ns/base/ns_base_open.c index bb7b1edb9e..a7322483d9 100644 --- a/orte/mca/ns/base/ns_base_open.c +++ b/orte/mca/ns/base/ns_base_open.c @@ -130,17 +130,23 @@ int orte_ns_base_open(void) { int param, value, rc; orte_data_type_t tmp; + opal_output_stream_t kill_prefix; /* Debugging / verbose output */ - + /** setup the structure to kill the blasted prefix that opal_output + * now defaults to including so the output can be legible again! + */ + OBJ_CONSTRUCT(&kill_prefix, opal_output_stream_t); + kill_prefix.lds_want_stderr = true; + kill_prefix.lds_prefix = NULL; + param = mca_base_param_reg_int_name("ns_base", "verbose", "Verbosity level for the ns framework", false, false, 0, &value); if (value != 0) { - mca_ns_base_output = opal_output_open(NULL); - } else { - mca_ns_base_output = -1; + kill_prefix.lds_verbose_level = value; } + mca_ns_base_output = opal_output_open(&kill_prefix); /* register the base system types with the DPS */ tmp = ORTE_NAME; diff --git a/orte/mca/ns/ns.h b/orte/mca/ns/ns.h index eef9b4c735..0919b76899 100644 --- a/orte/mca/ns/ns.h +++ b/orte/mca/ns/ns.h @@ -599,13 +599,13 @@ typedef int (*orte_ns_base_module_get_job_peers_fn_t)(orte_process_name_t **proc /* * DIAGNOSTIC INTERFACES */ -typedef int (*orte_ns_base_module_dump_cells_fn_t)(int output_id); +typedef int (*orte_ns_base_module_dump_cells_fn_t)(void); -typedef int (*orte_ns_base_module_dump_jobs_fn_t)(int output_id); +typedef int (*orte_ns_base_module_dump_jobs_fn_t)(void); -typedef int (*orte_ns_base_module_dump_tags_fn_t)(int output_id); +typedef int (*orte_ns_base_module_dump_tags_fn_t)(void); -typedef int (*orte_ns_base_module_dump_datatypes_fn_t)(int output_id); +typedef int (*orte_ns_base_module_dump_datatypes_fn_t)(void); /* diff --git a/orte/mca/ns/proxy/src/ns_proxy.c b/orte/mca/ns/proxy/src/ns_proxy.c index e273eaad5d..a527166927 100644 --- a/orte/mca/ns/proxy/src/ns_proxy.c +++ b/orte/mca/ns/proxy/src/ns_proxy.c @@ -815,7 +815,7 @@ int orte_ns_proxy_create_my_name(void) /* * DIAGNOSTIC functions */ -int orte_ns_proxy_dump_cells(int output_id) +int orte_ns_proxy_dump_cells(void) { orte_buffer_t cmd; orte_buffer_t answer; @@ -854,21 +854,21 @@ int orte_ns_proxy_dump_cells(int output_id) return ORTE_ERR_COMM_FAILURE; } - if (ORTE_SUCCESS != (rc = orte_ns_base_print_dump(&answer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_ns_base_print_dump(&answer))) { ORTE_ERROR_LOG(rc); OBJ_DESTRUCT(&answer); return rc; } /* dump local cell tracker */ - opal_output(output_id, "\n\n[%lu,%lu,%lu] Dump of Local Cell Tracker\n", + opal_output(mca_ns_base_output, "\n\n[%lu,%lu,%lu] Dump of Local Cell Tracker\n", ORTE_NAME_ARGS(orte_process_info.my_name)); ptr = (orte_ns_proxy_cell_info_t**)(orte_ns_proxy.cells)->addr; for (i=0, j=0; j < orte_ns_proxy.num_cells && i < (orte_ns_proxy.cells)->size; i++) { if (NULL != ptr[i]) { j++; - opal_output(output_id, "Num: %lu\tCell: %lu\n", + opal_output(mca_ns_base_output, "Num: %lu\tCell: %lu\n", (unsigned long)j, (unsigned long)ptr[i]->cellid); } } @@ -877,7 +877,7 @@ int orte_ns_proxy_dump_cells(int output_id) } -int orte_ns_proxy_dump_jobs(int output_id) +int orte_ns_proxy_dump_jobs(void) { orte_buffer_t cmd; orte_buffer_t answer; @@ -913,7 +913,7 @@ int orte_ns_proxy_dump_jobs(int output_id) return ORTE_ERR_COMM_FAILURE; } - if (ORTE_SUCCESS != (rc = orte_ns_base_print_dump(&answer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_ns_base_print_dump(&answer))) { ORTE_ERROR_LOG(rc); OBJ_DESTRUCT(&answer); return rc; @@ -923,7 +923,7 @@ int orte_ns_proxy_dump_jobs(int output_id) } -int orte_ns_proxy_dump_tags(int output_id) +int orte_ns_proxy_dump_tags(void) { orte_buffer_t cmd; orte_buffer_t answer; @@ -961,21 +961,21 @@ int orte_ns_proxy_dump_tags(int output_id) return ORTE_ERR_COMM_FAILURE; } - if (ORTE_SUCCESS != (rc = orte_ns_base_print_dump(&answer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_ns_base_print_dump(&answer))) { ORTE_ERROR_LOG(rc); OBJ_DESTRUCT(&answer); return rc; } /* dump local tag tracker */ - opal_output(output_id, "\n\n[%lu,%lu,%lu] Dump of Local Tag Tracker\n", + opal_output(mca_ns_base_output, "\n\n[%lu,%lu,%lu] Dump of Local Tag Tracker\n", ORTE_NAME_ARGS(orte_process_info.my_name)); ptr = (orte_ns_proxy_tagitem_t**)(orte_ns_proxy.tags)->addr; for (i=0, j=0; j < orte_ns_proxy.num_tags && i < (orte_ns_proxy.tags)->size; i++) { if (NULL != ptr[i]) { j++; - opal_output(output_id, "Num: %lu\tTag: %lu\tTag name: %s\n", + opal_output(mca_ns_base_output, "Num: %lu\tTag: %lu\tTag name: %s\n", (unsigned long)j, (unsigned long)ptr[i]->tag, ptr[i]->name); } } @@ -984,7 +984,7 @@ int orte_ns_proxy_dump_tags(int output_id) } -int orte_ns_proxy_dump_datatypes(int output_id) +int orte_ns_proxy_dump_datatypes(void) { orte_buffer_t cmd; orte_buffer_t answer; @@ -1022,21 +1022,21 @@ int orte_ns_proxy_dump_datatypes(int output_id) return ORTE_ERR_COMM_FAILURE; } - if (ORTE_SUCCESS != (rc = orte_ns_base_print_dump(&answer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_ns_base_print_dump(&answer))) { ORTE_ERROR_LOG(rc); OBJ_DESTRUCT(&answer); return rc; } /* dump local datatype tracker */ - opal_output(output_id, "\n\n[%lu,%lu,%lu] Dump of Local Datatype Tracker\n", + opal_output(mca_ns_base_output, "\n\n[%lu,%lu,%lu] Dump of Local Datatype Tracker\n", ORTE_NAME_ARGS(orte_process_info.my_name)); ptr = (orte_ns_proxy_dti_t**)(orte_ns_proxy.dts)->addr; for (i=0, j=0; j < orte_ns_proxy.num_dts && i < (orte_ns_proxy.dts)->size; i++) { if (NULL != ptr[i]) { j++; - opal_output(output_id, "Num: %lu\tDatatype id: %lu\tDatatype name: %s\n", + opal_output(mca_ns_base_output, "Num: %lu\tDatatype id: %lu\tDatatype name: %s\n", (unsigned long)j, (unsigned long)ptr[i]->id, ptr[i]->name); } } diff --git a/orte/mca/ns/proxy/src/ns_proxy.h b/orte/mca/ns/proxy/src/ns_proxy.h index 274659a868..6e30f2be39 100644 --- a/orte/mca/ns/proxy/src/ns_proxy.h +++ b/orte/mca/ns/proxy/src/ns_proxy.h @@ -119,13 +119,13 @@ int orte_ns_proxy_create_my_name(void); /* * Diagnostic functions */ -int orte_ns_proxy_dump_cells(int output_id); +int orte_ns_proxy_dump_cells(void); -int orte_ns_proxy_dump_jobs(int output_id); +int orte_ns_proxy_dump_jobs(void); -int orte_ns_proxy_dump_tags(int output_id); +int orte_ns_proxy_dump_tags(void); -int orte_ns_proxy_dump_datatypes(int output_id); +int orte_ns_proxy_dump_datatypes(void); diff --git a/orte/mca/ns/replica/src/ns_replica.c b/orte/mca/ns/replica/src/ns_replica.c index 82d64fd279..6cf2c3fac2 100644 --- a/orte/mca/ns/replica/src/ns_replica.c +++ b/orte/mca/ns/replica/src/ns_replica.c @@ -250,7 +250,7 @@ PROCESS: /* * DIAGNOSTIC functions */ -int orte_ns_replica_dump_cells(int output_id) +int orte_ns_replica_dump_cells(void) { orte_buffer_t buffer; int rc; @@ -261,7 +261,7 @@ int orte_ns_replica_dump_cells(int output_id) return rc; } - if (ORTE_SUCCESS != (rc = orte_ns_base_print_dump(&buffer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_ns_base_print_dump(&buffer))) { ORTE_ERROR_LOG(rc); OBJ_DESTRUCT(&buffer); return rc; @@ -316,7 +316,7 @@ int orte_ns_replica_dump_cells_fn(orte_buffer_t *buffer) } -int orte_ns_replica_dump_jobs(int output_id) +int orte_ns_replica_dump_jobs(void) { orte_buffer_t buffer; int rc; @@ -328,7 +328,7 @@ int orte_ns_replica_dump_jobs(int output_id) return rc; } - if (ORTE_SUCCESS != (rc = orte_ns_base_print_dump(&buffer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_ns_base_print_dump(&buffer))) { ORTE_ERROR_LOG(rc); OBJ_DESTRUCT(&buffer); return rc; @@ -377,7 +377,7 @@ int orte_ns_replica_dump_jobs_fn(orte_buffer_t *buffer) } -int orte_ns_replica_dump_tags(int output_id) +int orte_ns_replica_dump_tags(void) { orte_buffer_t buffer; int rc; @@ -388,7 +388,7 @@ int orte_ns_replica_dump_tags(int output_id) return rc; } - if (ORTE_SUCCESS != (rc = orte_ns_base_print_dump(&buffer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_ns_base_print_dump(&buffer))) { ORTE_ERROR_LOG(rc); OBJ_DESTRUCT(&buffer); return rc; @@ -436,7 +436,7 @@ int orte_ns_replica_dump_tags_fn(orte_buffer_t *buffer) } -int orte_ns_replica_dump_datatypes(int output_id) +int orte_ns_replica_dump_datatypes(void) { orte_buffer_t buffer; int rc; @@ -447,7 +447,7 @@ int orte_ns_replica_dump_datatypes(int output_id) return rc; } - if (ORTE_SUCCESS != (rc = orte_ns_base_print_dump(&buffer, output_id))) { + if (ORTE_SUCCESS != (rc = orte_ns_base_print_dump(&buffer))) { ORTE_ERROR_LOG(rc); OBJ_DESTRUCT(&buffer); return rc; diff --git a/orte/mca/ns/replica/src/ns_replica.h b/orte/mca/ns/replica/src/ns_replica.h index fc1ab9a18e..80cda04c0f 100644 --- a/orte/mca/ns/replica/src/ns_replica.h +++ b/orte/mca/ns/replica/src/ns_replica.h @@ -158,16 +158,16 @@ int orte_ns_replica_get_job_peers(orte_process_name_t **procs, /* * Diagnostic functions */ -int orte_ns_replica_dump_cells(int output_id); +int orte_ns_replica_dump_cells(void); int orte_ns_replica_dump_cells_fn(orte_buffer_t *buffer); -int orte_ns_replica_dump_jobs(int output_id); +int orte_ns_replica_dump_jobs(void); int orte_ns_replica_dump_jobs_fn(orte_buffer_t *buffer); -int orte_ns_replica_dump_tags(int output_id); +int orte_ns_replica_dump_tags(void); int orte_ns_replica_dump_tags_fn(orte_buffer_t *buffer); -int orte_ns_replica_dump_datatypes(int output_id); +int orte_ns_replica_dump_datatypes(void); int orte_ns_replica_dump_datatypes_fn(orte_buffer_t *buffer); diff --git a/orte/tools/console/orteconsole.c b/orte/tools/console/orteconsole.c index e8e99a75c8..21ef6cdf3f 100644 --- a/orte/tools/console/orteconsole.c +++ b/orte/tools/console/orteconsole.c @@ -81,6 +81,28 @@ opal_cmd_line_init_t cmd_line_opts[] = { &orte_console_globals.hostfile, OPAL_CMD_LINE_TYPE_STRING, "Provide a hostfile" }, + { "orte", "debug", NULL, 'd', NULL, "debug-devel", 0, + NULL, OPAL_CMD_LINE_TYPE_BOOL, + "Enable debugging of OpenRTE" }, + { "orte", "debug", "daemons", '\0', NULL, "debug-daemons", 0, + NULL, OPAL_CMD_LINE_TYPE_INT, + "Enable debugging of any OpenRTE daemons used by this application" }, + { "orte", "debug", "daemons_file", '\0', NULL, "debug-daemons-file", 0, + NULL, OPAL_CMD_LINE_TYPE_BOOL, + "Enable debugging of any OpenRTE daemons used by this application, storing output in files" }, + { "orte", "no_daemonize", NULL, '\0', NULL, "no-daemonize", 0, + NULL, OPAL_CMD_LINE_TYPE_BOOL, + "Do not detach OpenRTE daemons used by this application" }, + { "universe", NULL, NULL, '\0', NULL, "universe", 1, + NULL, OPAL_CMD_LINE_TYPE_STRING, + "Set the universe name as username@hostname:universe_name for this application" }, + { NULL, NULL, NULL, '\0', NULL, "tmpdir", 1, + &orte_process_info.tmpdir_base, OPAL_CMD_LINE_TYPE_STRING, + "Set the root for the session directory tree for orterun ONLY" }, + { "orte", "universe", "exist", '\0', NULL, NULL, (int)false, + NULL, OPAL_CMD_LINE_TYPE_BOOL, + "Report error if universe does not already exist" }, + /* End of list */ { NULL, NULL, NULL, '\0', NULL, NULL, 0, NULL, OPAL_CMD_LINE_TYPE_NULL, @@ -178,8 +200,8 @@ orte_console_command_t console_commands[] = { "mpispawn -np [ <-option name> [option argument] ] ", "Spawn MPI process(es)" }, - { "ps", NULL, 0, ORTE_CONSOLE_TYPE_HIDDEN, - orte_console_not_imp, + { "ps", NULL, 0, ORTE_CONSOLE_TYPE_STD, + orte_console_ps, "ps", "Display process(es) status" }, @@ -223,10 +245,10 @@ orte_console_command_t console_commands[] = { "vmname [name]", "Set or print the current virtual machine name" }, - { "devel", NULL, 0, ORTE_CONSOLE_TYPE_HIDDEN, - orte_console_devel, - "devel [arg1 arg2]", - "Development Debugging function" }, + { "dump", NULL, 0, ORTE_CONSOLE_TYPE_STD, + orte_console_dump, + "dump [arg1 arg2]", + "Dump registry data - [all, segment, triggers, subscriptions] [segment_name]" }, /* End of list */ { NULL, NULL, 0, ORTE_CONSOLE_TYPE_NULL, @@ -288,13 +310,21 @@ int main(int argc, char *argv[]) * up incorrect infrastructure that only a singleton would * require */ - daemon_is_active = false; + daemon_is_active = true; if (ORTE_SUCCESS != (ret = orte_init(true)) ) { - opal_show_help("help-orteconsole.txt", "orteconsole:init-failure", false, - "orte_init()", ret); - return ret; + if (ORTE_ERR_UNREACH == ret) { + opal_output(0, "Specified universe could not be reached - please ensure it has been started\n"); + return ret; + } else { + opal_show_help("help-orteconsole.txt", "orteconsole:init-failure", false, + "orte_init()", ret); + return ret; + } } - + if (orte_process_info.seed) { + daemon_is_active = false; + } + /* * Work Loop */ @@ -414,9 +444,65 @@ static int orte_console_not_imp(orte_console_input_command_t input_command) { return ORTE_ERR_NOT_IMPLEMENTED; } -static int orte_console_devel(orte_console_input_command_t input_command) { +static int orte_console_dump(orte_console_input_command_t input_command) { + int i, j; + if(daemon_is_active) { - orte_gpr.dump_segment(NULL, 0); + if (NULL == input_command.argv[1]) { /** default to dump_all */ + orte_gpr.dump_all(); + } else if (strcmp(input_command.argv[1], "segment") == 0) { + if (2 < input_command.argc) { /** specific segment was requested */ + for (i=2; i < input_command.argc; i++) orte_gpr.dump_segment(input_command.argv[i]); + } else { /** nothing specific - dump them all */ + orte_gpr.dump_segment(NULL); + } + } else if (strcmp(input_command.argv[1], "trigger") == 0) { + if (2 < input_command.argc) { /** specific trigger was requested */ + j = strtol(input_command.argv[2], NULL, 10); + orte_gpr.dump_triggers(j); + } else { /** nothing specific - dump them all */ + orte_gpr.dump_triggers(0); + } + } else if (strcmp(input_command.argv[1], "subs") == 0) { + if (2 < input_command.argc) { /** specific subscription was requested */ + j = strtol(input_command.argv[2], NULL, 10); + orte_gpr.dump_subscriptions(j); + } else { /** nothing specific - dump them all */ + orte_gpr.dump_subscriptions(0); + } + } else if (strcmp(input_command.argv[1], "callbacks") == 0) { + orte_gpr.dump_callbacks(); + } else if (strcmp(input_command.argv[1], "cells") == 0) { + orte_ns.dump_cells(); + } else if (strcmp(input_command.argv[1], "jobs") == 0) { + orte_ns.dump_jobs(); + } else if (strcmp(input_command.argv[1], "tags") == 0) { + orte_ns.dump_tags(); + } else if (strcmp(input_command.argv[1], "datatypes") == 0) { + orte_ns.dump_datatypes(); + } else { + /** let user know that this isn't recognized */ + opal_output(0, "orteconsole: specified dump option not recognized\n"); + } + } else { + /** let user know that this isn't available */ + opal_output(0, "orteconsole: no daemon is active - dump cannot be executed\n"); + } + + return ORTE_SUCCESS; +} + +static int orte_console_ps(orte_console_input_command_t input_command) { + if(daemon_is_active) { + /** find the jobids in the system */ + /** for each jobid, get its status and output the info */ + /** no real way to do this right now - need the 2.0 interface + * so let's just punt for the moment + */ + orte_ns.dump_jobs(); + } else { + /** let user know that this isn't available */ + opal_output(0, "orteconsole: no daemon is active - ps cannot be executed\n"); } return ORTE_SUCCESS; diff --git a/orte/tools/console/orteconsole.h b/orte/tools/console/orteconsole.h index 36f7d20ae9..eca0877bff 100644 --- a/orte/tools/console/orteconsole.h +++ b/orte/tools/console/orteconsole.h @@ -93,7 +93,8 @@ static int orte_console_halt(orte_console_input_command_t); static int orte_console_contactinfo(orte_console_input_command_t); static int orte_console_not_imp(orte_console_input_command_t); -static int orte_console_devel(orte_console_input_command_t); +static int orte_console_dump(orte_console_input_command_t); +static int orte_console_ps(orte_console_input_command_t); /* * Support Functions diff --git a/orte/tools/orterun/orterun.c b/orte/tools/orterun/orterun.c index 989d8087f1..28659e50f9 100644 --- a/orte/tools/orterun/orterun.c +++ b/orte/tools/orterun/orterun.c @@ -230,6 +230,9 @@ opal_cmd_line_init_t cmd_line_init[] = { { NULL, NULL, NULL, '\0', NULL, "tmpdir", 1, &orte_process_info.tmpdir_base, OPAL_CMD_LINE_TYPE_STRING, "Set the root for the session directory tree for orterun ONLY" }, + { "orte", "universe", "exist", '\0', NULL, NULL, (int)false, + NULL, OPAL_CMD_LINE_TYPE_BOOL, + "Report error if universe does not already exist" }, { NULL, NULL, NULL, '\0', NULL, "prefix", 1, NULL, OPAL_CMD_LINE_TYPE_STRING,