diff --git a/orte/mca/ras/base/ras_base_node.c b/orte/mca/ras/base/ras_base_node.c index 3fa55569a2..a227fce0bc 100644 --- a/orte/mca/ras/base/ras_base_node.c +++ b/orte/mca/ras/base/ras_base_node.c @@ -116,8 +116,18 @@ int orte_ras_base_node_insert(opal_list_t* nodes, orte_job_t *jdata) */ hnp_node->slots_alloc = node->slots; /* use the local name for our node - don't trust what - * we got from an RM + * we got from an RM. If requested, display the resolved + * nodename info */ + if (orte_show_resolved_nodenames && + 0 != strcmp(node->name, hnp_node->name)) { + if (orte_xml_output) { + opal_output(0, "", node->name, hnp_node->name); + } else { + opal_output(0, "node name %s resolved to %s", node->name, hnp_node->name); + } + } + /* update the total slots in the job */ jdata->total_slots_alloc += hnp_node->slots; /* don't keep duplicate copy */ diff --git a/orte/runtime/orte_globals.c b/orte/runtime/orte_globals.c index b56b171bb5..eaf89a3a1e 100644 --- a/orte/runtime/orte_globals.c +++ b/orte/runtime/orte_globals.c @@ -53,6 +53,7 @@ bool orted_spin_flag = false; bool orte_static_ports = false; bool orte_keep_fqdn_hostnames = false; bool orte_tag_output; +bool orte_show_resolved_nodenames; int orted_debug_failure; int orted_debug_failure_delay; bool orte_homogeneous_nodes = false; diff --git a/orte/runtime/orte_globals.h b/orte/runtime/orte_globals.h index 27c4c3b7a0..b07123d571 100644 --- a/orte/runtime/orte_globals.h +++ b/orte/runtime/orte_globals.h @@ -47,10 +47,10 @@ BEGIN_C_DECLS -ORTE_DECLSPEC extern int orte_debug_verbosity; -ORTE_DECLSPEC extern char *orte_prohibited_session_dirs; -ORTE_DECLSPEC extern bool orte_xml_output; -ORTE_DECLSPEC extern bool orte_help_want_aggregate; +ORTE_DECLSPEC extern int orte_debug_verbosity; /* instantiated in orte/runtime/orte_init.c */ +ORTE_DECLSPEC extern char *orte_prohibited_session_dirs; /* instantiated in orte/runtime/orte_init.c */ +ORTE_DECLSPEC extern bool orte_xml_output; /* instantiated in orte/runtime/orte_globals.c */ +ORTE_DECLSPEC extern bool orte_help_want_aggregate; /* instantiated in orte/util/show_help.c */ /* Shortcut for some commonly used names */ #define ORTE_NAME_WILDCARD (&orte_name_wildcard) @@ -398,8 +398,7 @@ ORTE_DECLSPEC extern bool orte_static_ports; ORTE_DECLSPEC extern int32_t orte_contiguous_nodes; ORTE_DECLSPEC extern bool orte_keep_fqdn_hostnames; ORTE_DECLSPEC extern bool orte_tag_output; -ORTE_DECLSPEC extern bool orte_xml_output; -ORTE_DECLSPEC extern int orte_debug_verbosity; +ORTE_DECLSPEC extern bool orte_show_resolved_nodenames; ORTE_DECLSPEC extern int orted_debug_failure; ORTE_DECLSPEC extern int orted_debug_failure_delay; ORTE_DECLSPEC extern bool orte_homogeneous_nodes; diff --git a/orte/runtime/orte_mca_params.c b/orte/runtime/orte_mca_params.c index b28e131407..a927150e27 100644 --- a/orte/runtime/orte_mca_params.c +++ b/orte/runtime/orte_mca_params.c @@ -181,6 +181,11 @@ int orte_register_params(void) false, false, (int) false, &value); orte_xml_output = OPAL_INT_TO_BOOL(value); + mca_base_param_reg_int_name("orte", "show_resolved_nodenames", + "Display any node names that are resolved to a different name (default: false)", + false, false, (int) false, &value); + orte_show_resolved_nodenames = OPAL_INT_TO_BOOL(value); + mca_base_param_reg_int_name("orte", "hetero_apps", "Indicates that multiple app_contexts are being provided that are a mix of 32/64 bit binaries (default: false)", false, false, (int) false, &value); diff --git a/orte/util/dash_host/dash_host.c b/orte/util/dash_host/dash_host.c index 9fa3b273f3..182a270fcd 100644 --- a/orte/util/dash_host/dash_host.c +++ b/orte/util/dash_host/dash_host.c @@ -32,6 +32,15 @@ #include "dash_host.h" +static void show_resolved_hostname(char *name, char *resolved) +{ + if (orte_xml_output) { + opal_output(0, "", name, resolved); + } else { + opal_output(0, "node name %s resolved to %s", name, resolved); + } +} + /* we can only enter this routine if no other allocation * was found, so we only need to know that finding any * relative node syntax should generate an immediate error @@ -110,6 +119,10 @@ int orte_util_add_dash_host_nodes(opal_list_t *nodes, /* it is local, so use the local nodename to avoid * later confusion */ + if (orte_show_resolved_nodenames && + 0 != strcmp(mapped_nodes[i], orte_process_info.nodename)) { + show_resolved_hostname(mapped_nodes[i], orte_process_info.nodename); + } node->name = strdup(orte_process_info.nodename); } else { /* not local - use the given name */ diff --git a/orte/util/hostfile/hostfile.c b/orte/util/hostfile/hostfile.c index 688ec1ce1f..77d0ff7061 100644 --- a/orte/util/hostfile/hostfile.c +++ b/orte/util/hostfile/hostfile.c @@ -49,6 +49,15 @@ static const char *cur_hostfile_name = NULL; +static void show_resolved_hostname(char *name, char *resolved) +{ + if (orte_xml_output) { + opal_output(0, "", name, resolved); + } else { + opal_output(0, "node name %s resolved to %s", name, resolved); + } +} + static void hostfile_parse_error(int token) { switch (token) { @@ -181,6 +190,10 @@ static int hostfile_parse_line(int token, opal_list_t* updates, opal_list_t* exc /* convert this into something globally unique */ if (strcmp(node_name, "localhost") == 0 || opal_ifislocal(node_name)) { /* Nodename has been allocated, that is for sure */ + if (orte_show_resolved_nodenames && + 0 != strcmp(node_name, orte_process_info.nodename)) { + show_resolved_hostname(node_name, orte_process_info.nodename); + } free (node_name); node_name = strdup(orte_process_info.nodename); } @@ -202,6 +215,10 @@ static int hostfile_parse_line(int token, opal_list_t* updates, opal_list_t* exc /* convert this into something globally unique */ if (strcmp(node_name, "localhost") == 0 || opal_ifislocal(node_name)) { /* Nodename has been allocated, that is for sure */ + if (orte_show_resolved_nodenames && + 0 != strcmp(node_name, orte_process_info.nodename)) { + show_resolved_hostname(node_name, orte_process_info.nodename); + } free (node_name); node_name = strdup(orte_process_info.nodename); }