Skip to content

Commit 7dad740

Browse files
jdhayesjsquyres
authored andcommitted
plm_slurm_module: adjust for new SLURM CLI options
SLURM 19 discontinued the use of --cpu_bind (and changed it to --cpu-bind). There's no easy way to test at run time which one is accepted, so set the environment variable SLURM_CPU_BIND to "none", which should do the same thing as the srun CLI parameter. Signed-off-by: Jordan Hayes <[email protected]> Signed-off-by: Jeff Squyres <[email protected]>
1 parent db07759 commit 7dad740

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

orte/mca/plm/slurm/plm_slurm_module.c

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* University of Stuttgart. All rights reserved.
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
12-
* Copyright (c) 2006-2018 Cisco Systems, Inc. All rights reserved
12+
* Copyright (c) 2006-2019 Cisco Systems, Inc. All rights reserved
1313
* Copyright (c) 2007-2015 Los Alamos National Security, LLC. All rights
1414
* reserved.
1515
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
@@ -272,14 +272,6 @@ static void launch_daemons(int fd, short args, void *cbdata)
272272
opal_argv_append(&argc, &argv, "--kill-on-bad-exit");
273273
}
274274

275-
/* ensure the orteds are not bound to a single processor,
276-
* just in case the TaskAffinity option is set by default.
277-
* This will *not* release the orteds from any cpu-set
278-
* constraint, but will ensure it doesn't get
279-
* bound to only one processor
280-
*/
281-
opal_argv_append(&argc, &argv, "--cpu_bind=none");
282-
283275
#if SLURM_CRAY_ENV
284276
/*
285277
* If in a SLURM/Cray env. make sure that Cray PMI is not pulled in,
@@ -420,6 +412,23 @@ static void launch_daemons(int fd, short args, void *cbdata)
420412
/* setup environment */
421413
env = opal_argv_copy(orte_launch_environ);
422414

415+
/* ensure the orteds are not bound to a single processor,
416+
* just in case the TaskAffinity option is set by default.
417+
* This will *not* release the orteds from any cpu-set
418+
* constraint, but will ensure it doesn't get
419+
* bound to only one processor
420+
*
421+
* NOTE: We used to pass --cpu_bind=none on the command line. But
422+
* SLURM 19 changed this to --cpu-bind. There is no easy way to
423+
* test at run time which of these two parameters is used (see
424+
* https://github.com/open-mpi/ompi/pull/6654). There was
425+
* discussion of using --test-only to see which one works, but
426+
* --test-only is only effective if you're not already inside a
427+
* SLURM allocation. Instead, set the env var SLURM_CPU_BIND to
428+
* "none", which should do the same thing as --cpu*bind=none.
429+
*/
430+
opal_setenv("SLURM_CPU_BIND", "none", true, &env);
431+
423432
if (0 < opal_output_get_verbosity(orte_plm_base_framework.framework_output)) {
424433
param = opal_argv_join(argv, ' ');
425434
opal_output(orte_plm_base_framework.framework_output,

0 commit comments

Comments
 (0)