Skip to content

Commit 929c167

Browse files
committed
Use session_dir_finalize to preserve output files
Don't hard-destroy the session dir tree - ensure we preserve any output files. Signed-off-by: Ralph Castain <[email protected]>
1 parent bd4118d commit 929c167

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/prted/prte.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,7 @@ static void abort_signal_callback(int fd)
15411541
second = false;
15421542
} else {
15431543
surekill(); // ensure we attempt to kill everything
1544-
pmix_os_dirpath_destroy(prte_process_info.top_session_dir, true, NULL);
1544+
prte_job_session_dir_finalize(NULL);
15451545
exit(1);
15461546
}
15471547
}

src/runtime/prte_finalize.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ int prte_finalize(void)
7979
prte_finalizing = true;
8080

8181
// we always must cleanup the session directory tree
82-
pmix_os_dirpath_destroy(prte_process_info.top_session_dir, true, NULL);
82+
prte_job_session_dir_finalize(NULL);
8383

8484
#ifdef PRTE_PICKY_COMPILERS
8585
/* release the cache */

src/util/session_dir.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Copyright (c) 2015 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
1515
* Copyright (c) 2015-2020 Intel, Inc. All rights reserved.
16-
* Copyright (c) 2021-2025 Nanook Consulting All rights reserved.
16+
* Copyright (c) 2021-2026 Nanook Consulting All rights reserved.
1717
* $COPYRIGHT$
1818
*
1919
* Additional copyrights may follow
@@ -293,6 +293,7 @@ void prte_job_session_dir_finalize(prte_job_t *jdata)
293293
if (prte_finalizing) {
294294
if (NULL != prte_process_info.top_session_dir) {
295295
pmix_os_dirpath_destroy(prte_process_info.top_session_dir, true, _check_file);
296+
/* if the top session dir is now empty, remove it */
296297
rmdir(prte_process_info.top_session_dir);
297298
free(prte_process_info.top_session_dir);
298299
prte_process_info.top_session_dir = NULL;

0 commit comments

Comments
 (0)