Skip to content

Commit bd4118d

Browse files
committed
Stop PMIx progress thread at beginning of finalize
Check for PMIx support for PMIx_Progress_thread_stop API. If found, then stop the progress thread at the beginning of PRRTE's finalize. Unless we are in devel-check mode, skip teardown of PRRTE infrastructure - just ensure we cleanup the session directory and exit. Signed-off-by: Ralph Castain <[email protected]>
1 parent 43e3afd commit bd4118d

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

config/prte_setup_pmix.m4

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# Copyright (c) 2014-2019 Research Organization for Information Science
1818
# and Technology (RIST). All rights reserved.
1919
# Copyright (c) 2016 IBM Corporation. All rights reserved.
20-
# Copyright (c) 2021-2025 Nanook Consulting All rights reserved.
20+
# Copyright (c) 2021-2026 Nanook Consulting All rights reserved.
2121
# Copyright (c) 2021-2022 Amazon.com, Inc. or its affiliates.
2222
# All Rights reserved.
2323
# Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
@@ -180,6 +180,16 @@ AC_DEFUN([PRTE_CHECK_PMIX],[
180180
PRTE_FLAGS_APPEND_UNIQ(LDFLAGS, $PRTE_FINAL_LDFLAGS)
181181
PRTE_FLAGS_APPEND_UNIQ(LIBS, $PRTE_FINAL_LIBS)
182182
183+
AC_MSG_CHECKING([for support of stop progress thread API])
184+
PRTE_CHECK_PMIX_CAP([STOP_PRGTHRD],
185+
[AC_MSG_RESULT([yes])
186+
prte_pmix_stop_progress_thread=1],
187+
[AC_MSG_RESULT([no])
188+
prte_pmix_stop_progress_thread=0])
189+
AC_DEFINE_UNQUOTED([PRTE_PMIX_STOP_PRGTHRD],
190+
[$prte_pmix_stop_progress_thread],
191+
[Whether or not PMIx supports the stop progress thread API])
192+
183193
AC_MSG_CHECKING([for support of version 2 server upcalls])
184194
PRTE_CHECK_PMIX_CAP([UPCALLS2],
185195
[AC_MSG_RESULT([yes])

src/runtime/prte_finalize.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Copyright (c) 2017 Research Organization for Information Science
1717
* and Technology (RIST). All rights reserved.
1818
* Copyright (c) 2020 IBM Corporation. All rights reserved.
19-
* Copyright (c) 2021-2024 Nanook Consulting. All rights reserved.
19+
* Copyright (c) 2021-2026 Nanook Consulting All rights reserved.
2020
* Copyright (c) 2021 Amazon.com, Inc. or its affiliates. All Rights
2121
* reserved.
2222
* $COPYRIGHT$
@@ -33,6 +33,7 @@
3333

3434
#include "src/mca/base/pmix_mca_base_framework.h"
3535
#include "src/util/pmix_argv.h"
36+
#include "src/util/pmix_os_dirpath.h"
3637
#include "src/util/pmix_output.h"
3738

3839
#include "src/mca/base/pmix_mca_base_alias.h"
@@ -68,9 +69,19 @@ int prte_finalize(void)
6869
return PRTE_SUCCESS;
6970
}
7071

72+
#ifdef PRTE_PMIX_STOP_PRGTHRD
73+
/* Stop the PMIx server's internal progress thread and wait here
74+
* until all active events have been processed */
75+
PMIx_Progress_thread_stop(NULL, 0);
76+
#endif
77+
7178
/* flag that we are finalizing */
7279
prte_finalizing = true;
7380

81+
// we always must cleanup the session directory tree
82+
pmix_os_dirpath_destroy(prte_process_info.top_session_dir, true, NULL);
83+
84+
#ifdef PRTE_PICKY_COMPILERS
7485
/* release the cache */
7586
PMIX_RELEASE(prte_cache);
7687

@@ -142,6 +153,7 @@ int prte_finalize(void)
142153
prte_proc_info_finalize();
143154

144155
pmix_output_finalize();
156+
#endif
145157

146158
/* now shutdown PMIx - need to do this last as it finalizes
147159
* the utilities and class system we depend upon */

0 commit comments

Comments
 (0)