From 81a8e2193936e36d11fc6456c8b9d73cb5447471 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Thu, 3 Jan 2013 02:16:57 +0000 Subject: [PATCH] Need to have the event thread running during init/finalize, but we still have a problem with cleanup - so comment out the event_base_free for now. This commit was SVN r27738. --- orte/runtime/orte_finalize.c | 24 ++++++++++++------------ orte/runtime/orte_init.c | 20 ++++++++------------ 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/orte/runtime/orte_finalize.c b/orte/runtime/orte_finalize.c index b0a3ec87b3..6a867d29ae 100644 --- a/orte/runtime/orte_finalize.c +++ b/orte/runtime/orte_finalize.c @@ -63,18 +63,6 @@ int orte_finalize(void) /* set the flag indicating we are finalizing */ orte_finalizing = true; -#if ORTE_ENABLE_PROGRESS_THREADS - /* stop the progress thread */ - orte_event_base_active = false; - /* break the event loop */ - opal_event_base_loopbreak(orte_event_base); - /* wait for thread to exit */ - opal_thread_join(&orte_progress_thread, NULL); - OBJ_DESTRUCT(&orte_progress_thread); - /* release the event base */ - opal_event_base_free(orte_event_base); -#endif - /* close the orte_show_help system */ orte_show_help_finalize(); @@ -84,6 +72,18 @@ int orte_finalize(void) /* close the ess itself */ orte_ess_base_close(); +#if ORTE_ENABLE_PROGRESS_THREADS + /* stop the progress thread */ + orte_event_base_active = false; + /* break the event loop */ + opal_event_base_loopbreak(orte_event_base); + /* wait for thread to exit */ + opal_thread_join(&orte_progress_thread, NULL); + OBJ_DESTRUCT(&orte_progress_thread); + /* release the event base */ +/* opal_event_base_free(orte_event_base); */ +#endif + /* cleanup the process info */ orte_proc_info_finalize(); diff --git a/orte/runtime/orte_init.c b/orte/runtime/orte_init.c index 2874a1f64c..84e1403107 100644 --- a/orte/runtime/orte_init.c +++ b/orte/runtime/orte_init.c @@ -141,6 +141,14 @@ int orte_init(int* pargc, char*** pargv, orte_proc_type_t flags) #if OPAL_EVENT_HAVE_THREAD_SUPPORT /* get a separate orte event base */ orte_event_base = opal_event_base_create(); + /* construct the thread object */ + OBJ_CONSTRUCT(&orte_progress_thread, opal_thread_t); + /* fork off a thread to progress it */ + orte_progress_thread.t_run = orte_progress_thread_engine; + if (OPAL_SUCCESS != (ret = opal_thread_start(&orte_progress_thread))) { + error = "orte progress thread start"; + goto error; + } #else error = "event thread support is not configured"; ret = ORTE_ERROR; @@ -157,18 +165,6 @@ int orte_init(int* pargc, char*** pargv, orte_proc_type_t flags) goto error; } - /* start the event thread, if required */ -#if ORTE_ENABLE_PROGRESS_THREADS - /* construct the thread object */ - OBJ_CONSTRUCT(&orte_progress_thread, opal_thread_t); - /* fork off a thread to progress it */ - orte_progress_thread.t_run = orte_progress_thread_engine; - if (OPAL_SUCCESS != (ret = opal_thread_start(&orte_progress_thread))) { - error = "orte progress thread start"; - goto error; - } -#endif - /* All done */ return ORTE_SUCCESS;