diff --git a/src/runtime/prte_finalize.c b/src/runtime/prte_finalize.c index 2d2b6c5a12..0ce7087d3b 100644 --- a/src/runtime/prte_finalize.c +++ b/src/runtime/prte_finalize.c @@ -43,6 +43,7 @@ #include "src/mca/ess/ess.h" #include "src/runtime/prte_globals.h" #include "src/runtime/prte_locks.h" +#include "src/runtime/prte_progress_threads.h" #include "src/runtime/runtime.h" #include "src/util/name_fns.h" #include "src/util/proc_info.h" @@ -79,6 +80,9 @@ int prte_finalize(void) /* flag that we are finalizing */ prte_finalizing = true; + // stop ALL prte progress threads + prte_progress_thread_pause(NULL); + // we always must cleanup the session directory tree prte_job_session_dir_finalize(NULL); diff --git a/src/runtime/prte_progress_threads.c b/src/runtime/prte_progress_threads.c index 07ff28fa94..c92ed26075 100644 --- a/src/runtime/prte_progress_threads.c +++ b/src/runtime/prte_progress_threads.c @@ -1,7 +1,7 @@ /* * Copyright (c) 2014-2020 Intel, Inc. All rights reserved. * Copyright (c) 2015-2020 Cisco Systems, Inc. All rights reserved - * Copyright (c) 2021-2025 Nanook Consulting All rights reserved. + * Copyright (c) 2021-2026 Nanook Consulting All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -378,15 +378,7 @@ int prte_progress_thread_finalize(const char *name) PMIX_LIST_FOREACH(trk, &tracking, prte_progress_tracker_t) { if (0 == strcmp(name, trk->name)) { - /* decrement the refcount */ - --trk->refcount; - - /* If the refcount is still above 0, we're done here */ - if (trk->refcount > 0) { - return PRTE_SUCCESS; - } - - /* If the progress thread is active, stop it */ + /* If the progress thread is active, stop it */ if (trk->ev_active) { stop_progress_engine(trk); } @@ -412,23 +404,20 @@ int prte_progress_thread_pause(const char *name) return PRTE_ERR_NOT_FOUND; } - if (NULL == name) { - name = shared_thread_name; - } - /* find the specified engine */ PMIX_LIST_FOREACH(trk, &tracking, prte_progress_tracker_t) { - if (0 == strcmp(name, trk->name)) { + if (NULL == name || 0 == strcmp(name, trk->name)) { if (trk->ev_active) { stop_progress_engine(trk); } - - return PRTE_SUCCESS; + if (NULL != name) { + break; + } } } - return PRTE_ERR_NOT_FOUND; + return PRTE_SUCCESS; } #if PRTE_HAVE_LIBEV