From a95731fc68dcbba32d08b00ea8a8ae42ea9d7a12 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Sat, 30 May 2009 20:42:23 +0000 Subject: [PATCH] Minor update to let apps set their own component selections if desired, while preserving slave behavior This commit was SVN r21332. --- orte/mca/plm/base/plm_base_rsh_support.c | 23 +++++++++++++---------- orte/mca/plm/base/plm_private.h | 2 +- orte/mca/plm/rshd/plm_rshd_module.c | 2 +- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/orte/mca/plm/base/plm_base_rsh_support.c b/orte/mca/plm/base/plm_base_rsh_support.c index 5905471253..ad49f154a6 100644 --- a/orte/mca/plm/base/plm_base_rsh_support.c +++ b/orte/mca/plm/base/plm_base_rsh_support.c @@ -201,7 +201,7 @@ int orte_plm_base_local_slave_launch(orte_job_t *jdata) /* add the bootproxy cmd line options */ if (ORTE_SUCCESS != (rc = orte_plm_base_append_bootproxy_args(app, &argv, jdata->jobid, 0, - 1, 1, 0, 1, 1))) { + 1, 1, 0, 1, 1, true))) { ORTE_ERROR_LOG(rc); return rc; } @@ -1100,7 +1100,7 @@ PRELOAD_FILES: int orte_plm_base_append_bootproxy_args(orte_app_context_t *app, char ***argv, orte_jobid_t jobid, orte_vpid_t vpid, int num_nodes, orte_vpid_t num_procs, orte_local_rank_t lrank, - orte_vpid_t nlocal, int nslots) + orte_vpid_t nlocal, int nslots, bool overwrite) { char *param, *path, *tmp, *cmd, *basename, *dest_dir; int i; @@ -1135,21 +1135,29 @@ int orte_plm_base_append_bootproxy_args(orte_app_context_t *app, char ***argv, /* add MCA params required for launch */ + /*** OVERRIDE WHAT THE APP PROVIDED ONLY IF DIRECTED TO DO SO ***/ /* tell ESS to select the "slave" component */ param = mca_base_param_environ_variable("ess",NULL,NULL); - opal_setenv(param, "slave", true, argv); + opal_setenv(param, "slave", overwrite, argv); free(param); /* tell ROUTED to select the "slave" component */ param = mca_base_param_environ_variable("routed",NULL,NULL); - opal_setenv(param, "slave", true, argv); + opal_setenv(param, "slave", overwrite, argv); free(param); /* tell GRPCOMM to select the "hier" component */ param = mca_base_param_environ_variable("grpcomm",NULL,NULL); - opal_setenv(param, "hier", true, argv); + opal_setenv(param, "hier", overwrite, argv); + free(param); + + /* setup yield schedule to be aggressive */ + param = mca_base_param_environ_variable("mpi", NULL, "yield_when_idle"); + opal_setenv(param, "0", overwrite, argv); free(param); + + /*** OVERWRITE ANY PRE-EXISTING VALUES ***/ /* must pass the number of nodes */ param = mca_base_param_environ_variable("orte","num","nodes"); asprintf(&cmd, "%d", num_nodes); @@ -1173,11 +1181,6 @@ int orte_plm_base_append_bootproxy_args(orte_app_context_t *app, char ***argv, free(param); free(path); - /* setup yield schedule to be aggressive */ - param = mca_base_param_environ_variable("mpi", NULL, "yield_when_idle"); - opal_setenv(param, "0", true, argv); - free(param); - /* set the app_context number */ param = mca_base_param_environ_variable("orte","app","num"); opal_setenv(param, "1", true, argv); diff --git a/orte/mca/plm/base/plm_private.h b/orte/mca/plm/base/plm_private.h index 252f392cea..fbe85bb3b5 100644 --- a/orte/mca/plm/base/plm_private.h +++ b/orte/mca/plm/base/plm_private.h @@ -116,7 +116,7 @@ ORTE_DECLSPEC int orte_plm_base_setup_rsh_launch(char *nodename, orte_app_contex ORTE_DECLSPEC int orte_plm_base_append_bootproxy_args(orte_app_context_t *app, char ***argv, orte_jobid_t jobid, orte_vpid_t vpid, int num_nodes, orte_vpid_t num_procs, orte_local_rank_t lrank, - orte_vpid_t nlocal, int nslots); + orte_vpid_t nlocal, int nslots, bool overwrite); /** * Heartbeat support diff --git a/orte/mca/plm/rshd/plm_rshd_module.c b/orte/mca/plm/rshd/plm_rshd_module.c index d5322fe048..4462db877f 100644 --- a/orte/mca/plm/rshd/plm_rshd_module.c +++ b/orte/mca/plm/rshd/plm_rshd_module.c @@ -311,7 +311,7 @@ int orte_plm_rshd_launch(orte_job_t *jdata) proc->name.jobid, proc->name.vpid, jdata->map->num_nodes, jdata->num_procs, proc->local_rank, - node->num_procs, jdata->total_slots_alloc))) { + node->num_procs, jdata->total_slots_alloc, false))) { ORTE_ERROR_LOG(rc); goto cleanup; }