From 112f8eedb1361c26d2649ca750ad5b394efc1b05 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Tue, 29 Jan 2013 20:37:58 +0000 Subject: [PATCH] Handle the case where rankfile is providing the allocation This commit was SVN r27971. --- orte/mca/rmaps/base/rmaps_base_support_fns.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/orte/mca/rmaps/base/rmaps_base_support_fns.c b/orte/mca/rmaps/base/rmaps_base_support_fns.c index 99ddaa3958..2a2dd6d635 100644 --- a/orte/mca/rmaps/base/rmaps_base_support_fns.c +++ b/orte/mca/rmaps/base/rmaps_base_support_fns.c @@ -170,6 +170,24 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr ORTE_ERROR_LOG(rc); return rc; } + } else if (NULL != orte_rankfile) { + /* use the rankfile, if provided */ + OPAL_OUTPUT_VERBOSE((5, orte_rmaps_base.rmaps_output, + "%s using rankfile %s", + ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), + orte_rankfile)); + if (ORTE_SUCCESS != (rc = orte_util_add_hostfile_nodes(&nodes, + orte_rankfile))) { + ORTE_ERROR_LOG(rc); + return rc; + } + if (0 == opal_list_get_size(&nodes)) { + OPAL_OUTPUT_VERBOSE((5, orte_rmaps_base.rmaps_output, + "%s nothing found in given rankfile", + ORTE_NAME_PRINT(ORTE_PROC_MY_NAME))); + OBJ_DESTRUCT(&nodes); + return ORTE_ERR_BAD_PARAM; + } } else if (NULL != orte_default_hostfile) { /* fall back to the default hostfile, if provided */ OPAL_OUTPUT_VERBOSE((5, orte_rmaps_base.rmaps_output,