Skip to content

Commit 98082de

Browse files
committed
shell: hwloc: unset HWLOC_COMPONENTS with -o hwloc.xmlfile
Problem: HWLOC_XMLFILE is ignored by libhwloc if HWLOC_COMPONENTS is also set in the environment, causing the hwloc.xmlfile shell option to have no effect. Unset HWLOC_COMPONENTS if set when the hwloc.xmlfile shell option is utilized.
1 parent 76dd4c5 commit 98082de

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/shell/hwloc.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ static int create_xmlfile (flux_shell_t *shell)
6262
shell_log_errno ("failed to set HWLOC_XMLFILE in job environment");
6363
goto error;
6464
}
65+
/* Note: HWLOC_XMLFILE will be ignored if HWLOC_COMPONENTS is also set
66+
* in the environment, so unset that variable here.
67+
*/
68+
if (flux_shell_unsetenv (shell, "HWLOC_COMPONENTS") < 0
69+
&& errno != ENOENT) {
70+
shell_log_errno ("failed to unset HWLOC_COMPONENTS");
71+
goto error;
72+
}
6573
return 0;
6674
error:
6775
if (fd >= 0)

0 commit comments

Comments
 (0)