From 20e6f41fe2ce13ed1e810a6247cdef954e86a2e8 Mon Sep 17 00:00:00 2001 From: Tim Woodall Date: Thu, 1 Dec 2005 17:44:08 +0000 Subject: [PATCH] allow node number as hostname for bproc This commit was SVN r8357. --- orte/mca/rds/hostfile/rds_hostfile.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/orte/mca/rds/hostfile/rds_hostfile.c b/orte/mca/rds/hostfile/rds_hostfile.c index fffcc6b129..810b22548d 100644 --- a/orte/mca/rds/hostfile/rds_hostfile.c +++ b/orte/mca/rds/hostfile/rds_hostfile.c @@ -106,6 +106,7 @@ static orte_ras_node_t* orte_rds_hostfile_lookup(opal_list_t* nodes, const char* static int orte_rds_hostfile_parse_line(int token, opal_list_t* existing, opal_list_t* updates) { + char buff[64]; int rc; orte_ras_node_t* node; bool update = false; @@ -113,13 +114,22 @@ static int orte_rds_hostfile_parse_line(int token, opal_list_t* existing, opal_l if (ORTE_RDS_HOSTFILE_STRING == token || ORTE_RDS_HOSTFILE_HOSTNAME == token || + ORTE_RDS_HOSTFILE_INT == token || ORTE_RDS_HOSTFILE_IPV4 == token) { - char* value = orte_rds_hostfile_value.sval; - char** argv = opal_argv_split (value, '@'); + char* value; + char** argv; char* node_name = NULL; char* username = NULL; int cnt; + if(ORTE_RDS_HOSTFILE_INT == token) { + sprintf(buff,"%d", orte_rds_hostfile_value.ival); + value = buff; + } else { + value = orte_rds_hostfile_value.sval; + } + argv = opal_argv_split (value, '@'); + cnt = opal_argv_count (argv); if (1 == cnt) { node_name = strdup(argv[0]); @@ -298,6 +308,7 @@ static int orte_rds_hostfile_parse(const char *hostfile, opal_list_t* existing, * hostname.domain and user@hostname.domain */ case ORTE_RDS_HOSTFILE_STRING: + case ORTE_RDS_HOSTFILE_INT: case ORTE_RDS_HOSTFILE_HOSTNAME: case ORTE_RDS_HOSTFILE_IPV4: rc = orte_rds_hostfile_parse_line(token, existing, updates);