diff --git a/orte/mca/ras/base/base.h b/orte/mca/ras/base/base.h index 10c1724725..fe5e5be5e2 100644 --- a/orte/mca/ras/base/base.h +++ b/orte/mca/ras/base/base.h @@ -40,6 +40,7 @@ typedef struct orte_ras_base_t { int ras_output; opal_list_t ras_opened; bool allocation_read; + bool display_alloc; orte_ras_base_module_t *active_module; } orte_ras_base_t; diff --git a/orte/mca/ras/base/ras_base_allocate.c b/orte/mca/ras/base/ras_base_allocate.c index dbf2dfa8ad..465e85c8c2 100644 --- a/orte/mca/ras/base/ras_base_allocate.c +++ b/orte/mca/ras/base/ras_base_allocate.c @@ -44,7 +44,7 @@ int orte_ras_base_allocate(orte_job_t *jdata) { int rc; opal_list_t nodes; - orte_node_t *node; + orte_node_t *node, **alloc; orte_std_cntr_t i; bool override_oversubscribed; orte_app_context_t **apps; @@ -281,5 +281,18 @@ int orte_ras_base_allocate(orte_job_t *jdata) return rc; } OBJ_DESTRUCT(&nodes); + + /* shall we display the results? */ + if (orte_ras_base.display_alloc) { + alloc = (orte_node_t**)orte_node_pool->addr; + opal_output(0, "*** NODE ALLOCATION FOR JOB %s ***", ORTE_JOBID_PRINT(jdata->jobid)); + for (i=0; i < orte_node_pool->size; i++) { + if (NULL == alloc[i]) { + break; + } + opal_dss.dump(0, alloc[i], ORTE_NODE); + } + } + return ORTE_SUCCESS; } diff --git a/orte/mca/ras/base/ras_base_open.c b/orte/mca/ras/base/ras_base_open.c index 7c8036df5c..42ec972e33 100644 --- a/orte/mca/ras/base/ras_base_open.c +++ b/orte/mca/ras/base/ras_base_open.c @@ -63,10 +63,18 @@ orte_ras_base_t orte_ras_base; */ int orte_ras_base_open(void) { + int value; + /* set default flags */ orte_ras_base.active_module = NULL; orte_ras_base.allocation_read = false; + /* should we display the allocation after determining it? */ + mca_base_param_reg_int_name("ras", "base_display_alloc", + "Whether to display the allocation after it is determined", + false, false, (int)false, &value); + orte_ras_base.display_alloc = OPAL_INT_TO_BOOL(value); + /* Debugging / verbose output. Always have stream open, with verbose set by the mca open system... */ orte_ras_base.ras_output = opal_output_open(NULL); diff --git a/orte/mca/rmaps/base/rmaps_base_map_job.c b/orte/mca/rmaps/base/rmaps_base_map_job.c index d14ee082e1..8872ef6d9c 100644 --- a/orte/mca/rmaps/base/rmaps_base_map_job.c +++ b/orte/mca/rmaps/base/rmaps_base_map_job.c @@ -28,6 +28,7 @@ #include "opal/dss/dss.h" #include "orte/mca/errmgr/errmgr.h" #include "orte/runtime/orte_globals.h" +#include "orte/util/name_fns.h" #include "orte/mca/rmaps/base/base.h" #include "orte/mca/rmaps/base/rmaps_private.h" @@ -82,6 +83,7 @@ int orte_rmaps_base_map_job(orte_job_t *jdata) /* if we wanted to display the map, now is the time to do it */ if (jdata->map->display_map) { + opal_output(0, "*** JOB MAP FOR JOB %s ***", ORTE_JOBID_PRINT(jdata->jobid)); opal_dss.dump(0, jdata->map, ORTE_JOB_MAP); } diff --git a/orte/tools/orterun/orterun.c b/orte/tools/orterun/orterun.c index 9561269a24..82c66c11b6 100644 --- a/orte/tools/orterun/orterun.c +++ b/orte/tools/orterun/orterun.c @@ -219,6 +219,10 @@ static opal_cmd_line_init_t cmd_line_init[] = { NULL, OPAL_CMD_LINE_TYPE_BOOL, "Display the process map just before launch"}, + { "ras", "base", "display_alloc", '\0', "display-allocation", "display-allocation", 0, + NULL, OPAL_CMD_LINE_TYPE_BOOL, + "Display the allocation being used by this job"}, + /* mpiexec-like arguments */ { NULL, NULL, NULL, '\0', "wdir", "wdir", 1, &orterun_globals.wdir, OPAL_CMD_LINE_TYPE_STRING,