1
1

Merge pull request #7933 from artpol84/fix/4.1.x/schizo_slurm

v4.1.x: schizo/slurm: Fix binding detection
Этот коммит содержится в:
Jeff Squyres 2020-07-14 11:19:07 -04:00 коммит произвёл GitHub
родитель 91c28f136b 8b5b0c5a2a
Коммит dfac9fae16
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23

Просмотреть файл

@ -93,33 +93,12 @@ static orte_schizo_launch_environ_t check_launch_environment(void)
opal_argv_append_nosize(&pushed_envs, OPAL_MCA_PREFIX"ess"); opal_argv_append_nosize(&pushed_envs, OPAL_MCA_PREFIX"ess");
opal_argv_append_nosize(&pushed_vals, "pmi"); opal_argv_append_nosize(&pushed_vals, "pmi");
/* if we are direct launched by SLURM, then we want /* if we are direct-launched by SLURM, then disable binding */
* to ensure that we do not override their binding opal_argv_append_nosize(&pushed_envs, OPAL_MCA_PREFIX"hwloc_base_binding_policy");
* options, so set that envar */ opal_argv_append_nosize(&pushed_vals, "none");
if (NULL != (bind = getenv("SLURM_CPU_BIND_TYPE"))) { /* indicate we are externally bound so we won't try to do it ourselves */
if (0 == strcmp(bind, "none")) { opal_argv_append_nosize(&pushed_envs, OPAL_MCA_PREFIX"orte_externally_bound");
opal_argv_append_nosize(&pushed_envs, OPAL_MCA_PREFIX"hwloc_base_binding_policy"); opal_argv_append_nosize(&pushed_vals, "1");
opal_argv_append_nosize(&pushed_vals, "none");
/* indicate we are externally bound so we won't try to do it ourselves */
opal_argv_append_nosize(&pushed_envs, OPAL_MCA_PREFIX"orte_externally_bound");
opal_argv_append_nosize(&pushed_vals, "1");
} else if (bind == strstr(bind, "mask_cpu")) {
/* if the bind list is all F's, then the
* user didn't specify anything */
if (NULL != (list = getenv("SLURM_CPU_BIND_LIST")) &&
NULL != (ptr = strchr(list, 'x'))) {
++ptr; // step over the 'x'
for (i=0; '\0' != *ptr; ptr++) {
if ('F' != *ptr) {
/* indicate we are externally bound */
opal_argv_append_nosize(&pushed_envs, OPAL_MCA_PREFIX"orte_externally_bound");
opal_argv_append_nosize(&pushed_vals, "1");
break;
}
}
}
}
}
setup: setup:
opal_output_verbose(1, orte_schizo_base_framework.framework_output, opal_output_verbose(1, orte_schizo_base_framework.framework_output,