diff --git a/opal/mca/hwloc/base/hwloc_base_frame.c b/opal/mca/hwloc/base/hwloc_base_frame.c index 40dbd237bd1..570c575501f 100644 --- a/opal/mca/hwloc/base/hwloc_base_frame.c +++ b/opal/mca/hwloc/base/hwloc_base_frame.c @@ -42,6 +42,7 @@ hwloc_cpuset_t opal_hwloc_base_given_cpus=NULL; opal_hwloc_base_map_t opal_hwloc_base_map = OPAL_HWLOC_BASE_MAP_NONE; opal_hwloc_base_mbfa_t opal_hwloc_base_mbfa = OPAL_HWLOC_BASE_MBFA_WARN; opal_binding_policy_t opal_hwloc_binding_policy=0; +bool opal_hwloc_base_bind_direct_launched = false; char *opal_hwloc_base_slot_list=NULL; char *opal_hwloc_base_cpu_set=NULL; bool opal_hwloc_report_bindings=false; @@ -165,6 +166,12 @@ static int opal_hwloc_base_register(mca_base_register_flag_t flags) MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0, OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY, &opal_hwloc_base_topo_file); + opal_hwloc_base_bind_direct_launched = true; + (void) mca_base_var_register("opal", "hwloc", "base", "bind_direct_launched", + "bind processes when direct launched ", + MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0, OPAL_INFO_LVL_9, + MCA_BASE_VAR_SCOPE_READONLY, &opal_hwloc_base_bind_direct_launched); + /* register parameters */ return OPAL_SUCCESS; } diff --git a/opal/mca/hwloc/hwloc.h b/opal/mca/hwloc/hwloc.h index a074be86e03..688671b1e7d 100644 --- a/opal/mca/hwloc/hwloc.h +++ b/opal/mca/hwloc/hwloc.h @@ -217,6 +217,7 @@ OPAL_DECLSPEC extern hwloc_cpuset_t opal_hwloc_my_cpuset; OPAL_DECLSPEC extern bool opal_hwloc_report_bindings; OPAL_DECLSPEC extern hwloc_obj_type_t opal_hwloc_levels[]; OPAL_DECLSPEC extern bool opal_hwloc_use_hwthreads_as_cpus; +OPAL_DECLSPEC extern bool opal_hwloc_base_bind_direct_launched; END_C_DECLS diff --git a/orte/mca/ess/base/ess_base_fns.c b/orte/mca/ess/base/ess_base_fns.c index ab121720431..feb39e41223 100644 --- a/orte/mca/ess/base/ess_base_fns.c +++ b/orte/mca/ess/base/ess_base_fns.c @@ -68,6 +68,14 @@ int orte_ess_base_proc_binding(void) } } + /* direct launched: use whatever the extarnal launcher has set */ + if ((NULL == orte_process_info.my_daemon_uri) && !opal_hwloc_base_bind_direct_launched) { + OPAL_OUTPUT_VERBOSE((5, orte_ess_base_framework.framework_output, + "%s Process externally launched -- use their binding", + ORTE_NAME_PRINT(ORTE_PROC_MY_NAME))); + goto MOVEON; + } + /* see if we were bound when launched */ if (!orte_proc_is_bound) { OPAL_OUTPUT_VERBOSE((5, orte_ess_base_framework.framework_output,