From 8014e7432c3ccb87f6bd3818383da048487514d4 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Mon, 18 Apr 2011 14:46:42 +0000 Subject: [PATCH] Send recovery defined flag in app_contexts, include recovery flags in debug prints This commit was SVN r24619. --- .../runtime/data_type_support/orte_dt_packing_fns.c | 6 ++++++ orte/runtime/data_type_support/orte_dt_print_fns.c | 13 +++++++++---- .../data_type_support/orte_dt_unpacking_fns.c | 7 +++++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/orte/runtime/data_type_support/orte_dt_packing_fns.c b/orte/runtime/data_type_support/orte_dt_packing_fns.c index bcf3b8f629..aabfbd6746 100644 --- a/orte/runtime/data_type_support/orte_dt_packing_fns.c +++ b/orte/runtime/data_type_support/orte_dt_packing_fns.c @@ -749,6 +749,12 @@ int orte_dt_pack_app_context(opal_buffer_t *buffer, const void *src, } } + /* pack the recovery defined flag */ + if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer, + (void*)(&(app_context[i]->recovery_defined)), 1, OPAL_BOOL))) { + ORTE_ERROR_LOG(rc); + return rc; + } /* pack the restart limit */ if (ORTE_SUCCESS != (rc = opal_dss_pack_buffer(buffer, (void*)(&(app_context[i]->max_restarts)), 1, OPAL_INT32))) { diff --git a/orte/runtime/data_type_support/orte_dt_print_fns.c b/orte/runtime/data_type_support/orte_dt_print_fns.c index 52851ed43b..7d350c50fd 100644 --- a/orte/runtime/data_type_support/orte_dt_print_fns.c +++ b/orte/runtime/data_type_support/orte_dt_print_fns.c @@ -218,10 +218,13 @@ int orte_dt_print_job(char **output, char *prefix, orte_job_t *src, opal_data_ty asprintf(&pfx2, "%s", prefix); } - asprintf(&tmp, "\n%sData for job: %s\tName: %s\tInstance: %s\n%s\tNum apps: %ld\tControls: %0x\tStdin target: %s\tState: %s\tAbort: %s", pfx2, + asprintf(&tmp, "\n%sData for job: %s\tName: %s\tInstance: %s\tRecovery: %s(%s)\n%s\tNum apps: %ld\tControls: %0x\tStdin target: %s\tState: %s\tAbort: %s", pfx2, ORTE_JOBID_PRINT(src->jobid), (NULL != src->name) ? src->name : "NULL", - (NULL != src->instance) ? src->instance : "NULL", pfx2, + (NULL != src->instance) ? src->instance : "NULL", + (src->enable_recovery) ? "ENABLED" : "DISABLED", + (src->recovery_defined) ? "DEFINED" : "DEFAULT", + pfx2, (long)src->num_apps, src->controls, ORTE_VPID_PRINT(src->stdin_target), orte_job_state_to_str(src->state), src->abort ? "True" : "False"); asprintf(&pfx, "%s\t", pfx2); @@ -529,11 +532,13 @@ int orte_dt_print_app_context(char **output, char *prefix, orte_app_context_t *s asprintf(&pfx2, "%s", prefix); } - asprintf(&tmp, "\n%sData for app_context: name: %s\t index %lu\tuid: %d\tgid: %d\tapp: %s\n%s\tNum procs: %lu\tMax Restarts: %d", + asprintf(&tmp, "\n%sData for app_context: name: %s\t index %lu\tuid: %d\tgid: %d\tapp: %s\n%s\tNum procs: %lu\tRecovery: %s\tMax Restarts: %d", pfx2, (NULL == src->name) ? "NULL" : src->name, (unsigned long)src->idx, src->uid, src->gid, (NULL == src->app) ? "NULL" : src->app, - pfx2, (unsigned long)src->num_procs, src->max_restarts); + pfx2, (unsigned long)src->num_procs, + (src->recovery_defined) ? "DEFINED" : "DEFAULT", + src->max_restarts); count = opal_argv_count(src->argv); for (i=0; i < count; i++) { diff --git a/orte/runtime/data_type_support/orte_dt_unpacking_fns.c b/orte/runtime/data_type_support/orte_dt_unpacking_fns.c index 9c345ae31e..db10b8acd5 100644 --- a/orte/runtime/data_type_support/orte_dt_unpacking_fns.c +++ b/orte/runtime/data_type_support/orte_dt_unpacking_fns.c @@ -825,6 +825,13 @@ int orte_dt_unpack_app_context(opal_buffer_t *buffer, void *dest, app_context[i]->preload_files_src_dir = NULL; } + /* Unpack the recovery_defined flag */ + max_n=1; + if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &(app_context[i]->recovery_defined), + &max_n, OPAL_BOOL))) { + ORTE_ERROR_LOG(rc); + return rc; + } /* unpack the restart limit */ max_n=1; if (ORTE_SUCCESS != (rc = opal_dss_unpack_buffer(buffer, &app_context[i]->max_restarts,