Skip to content

Commit a98d8f4

Browse files
author
Ralph Castain
committed
Update orte-clean so it cleans legacy session directories as well as pmix artifacts
Signed-off-by: Ralph Castain <[email protected]> (cherry picked from commit 2aa286c)
1 parent 58895df commit a98d8f4

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

orte/tools/orte-clean/orte-clean.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Copyright (c) 2011-2013 Cisco Systems, Inc. All rights reserved.
1717
* Copyright (c) 2015 Research Organization for Information Science
1818
* and Technology (RIST). All rights reserved.
19-
* Copyright (c) 2015 Intel, Inc. All rights reserved.
19+
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
2020
* Copyright (c) 2017 UT-Battelle, LLC. All rights reserved.
2121
* $COPYRIGHT$
2222
*
@@ -128,6 +128,7 @@ main(int argc, char *argv[])
128128
#if OPAL_ENABLE_FT_CR == 1
129129
char *tmp_env_var;
130130
#endif
131+
char *legacy;
131132

132133
/* This is needed so we can print the help message */
133134
if (ORTE_SUCCESS != (ret = opal_init_util(&argc, &argv))) {
@@ -174,6 +175,18 @@ main(int argc, char *argv[])
174175
}
175176
opal_os_dirpath_destroy(orte_process_info.top_session_dir, true, NULL);
176177

178+
/* also get rid of any legacy session directories */
179+
asprintf(&legacy, "%s/openmpi-sessions-%d@%s_0",
180+
orte_process_info.tmpdir_base,
181+
(int)geteuid(), orte_process_info.nodename);
182+
opal_os_dirpath_destroy(legacy, true, NULL);
183+
free(legacy);
184+
185+
/* and finally get rid of any lingering pmix-related artifacts */
186+
asprintf(&legacy, "rm -f %s/pmix*", orte_process_info.tmpdir_base);
187+
system(legacy);
188+
free(legacy);
189+
177190
/* now kill any lingering procs, if we can */
178191
kill_procs();
179192

@@ -415,7 +428,7 @@ void kill_procs(void) {
415428
}
416429
}
417430
free(inputline);
418-
free(procname);
431+
free(procname);
419432
}
420433
free(this_user);
421434
pclose(psfile);

0 commit comments

Comments
 (0)