Skip to content

Commit c72f295

Browse files
committed
schizo/slurm: Disable binding in case of Slurm direct launch
Signed-off-by: Artem Polyakov <[email protected]>
1 parent a81a297 commit c72f295

File tree

1 file changed

+6
-27
lines changed

1 file changed

+6
-27
lines changed

orte/mca/schizo/slurm/schizo_slurm.c

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -93,33 +93,12 @@ static orte_schizo_launch_environ_t check_launch_environment(void)
9393
opal_argv_append_nosize(&pushed_envs, OPAL_MCA_PREFIX"ess");
9494
opal_argv_append_nosize(&pushed_vals, "pmi");
9595

96-
/* if we are direct launched by SLURM, then we want
97-
* to ensure that we do not override their binding
98-
* options, so set that envar */
99-
if (NULL != (bind = getenv("SLURM_CPU_BIND_TYPE"))) {
100-
if (0 == strcmp(bind, "none")) {
101-
opal_argv_append_nosize(&pushed_envs, OPAL_MCA_PREFIX"hwloc_base_binding_policy");
102-
opal_argv_append_nosize(&pushed_vals, "none");
103-
/* indicate we are externally bound so we won't try to do it ourselves */
104-
opal_argv_append_nosize(&pushed_envs, OPAL_MCA_PREFIX"orte_externally_bound");
105-
opal_argv_append_nosize(&pushed_vals, "1");
106-
} else if (bind == strstr(bind, "mask_cpu")) {
107-
/* if the bind list is all F's, then the
108-
* user didn't specify anything */
109-
if (NULL != (list = getenv("SLURM_CPU_BIND_LIST")) &&
110-
NULL != (ptr = strchr(list, 'x'))) {
111-
++ptr; // step over the 'x'
112-
for (i=0; '\0' != *ptr; ptr++) {
113-
if ('F' != *ptr) {
114-
/* indicate we are externally bound */
115-
opal_argv_append_nosize(&pushed_envs, OPAL_MCA_PREFIX"orte_externally_bound");
116-
opal_argv_append_nosize(&pushed_vals, "1");
117-
break;
118-
}
119-
}
120-
}
121-
}
122-
}
96+
/* if we are direct-launched by SLURM, then disable binding */
97+
opal_argv_append_nosize(&pushed_envs, OPAL_MCA_PREFIX"hwloc_base_binding_policy");
98+
opal_argv_append_nosize(&pushed_vals, "none");
99+
/* indicate we are externally bound so we won't try to do it ourselves */
100+
opal_argv_append_nosize(&pushed_envs, OPAL_MCA_PREFIX"orte_externally_bound");
101+
opal_argv_append_nosize(&pushed_vals, "1");
123102

124103
setup:
125104
opal_output_verbose(1, orte_schizo_base_framework.framework_output,

0 commit comments

Comments
 (0)