No need for ORTE tools to use orte progress thread
This commit was SVN r28445.
This commit is contained in:
parent
422331b4da
commit
27e3e382d5
@ -811,19 +811,9 @@ int orte_daemon(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* loop the event lib until an exit event is detected */
|
||||
#if ORTE_ENABLE_PROGRESS_THREADS
|
||||
while (orte_event_base_active) {
|
||||
/* provide a very short quiet period so we
|
||||
* don't hammer the cpu while
|
||||
*/
|
||||
struct timespec tp = {0, 100};
|
||||
nanosleep(&tp, NULL);
|
||||
}
|
||||
#else
|
||||
while (orte_event_base_active) {
|
||||
opal_event_loop(orte_event_base, OPAL_EVLOOP_ONCE);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* ensure all local procs are dead */
|
||||
orte_odls.kill_local_procs(NULL);
|
||||
|
@ -71,18 +71,20 @@ int orte_finalize(void)
|
||||
|
||||
/* close the ess itself */
|
||||
(void) mca_base_framework_close(&orte_ess_base_framework);
|
||||
|
||||
|
||||
if (ORTE_PROC_IS_APP) {
|
||||
#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); */
|
||||
/* 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();
|
||||
|
@ -138,8 +138,8 @@ int orte_init(int* pargc, char*** pargv, orte_proc_type_t flags)
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (ORTE_PROC_IS_APP) {
|
||||
#if ORTE_ENABLE_PROGRESS_THREADS
|
||||
#if OPAL_EVENT_HAVE_THREAD_SUPPORT
|
||||
/* get a separate orte event base */
|
||||
orte_event_base = opal_event_base_create();
|
||||
/* construct the thread object */
|
||||
@ -150,15 +150,16 @@ int orte_init(int* pargc, char*** pargv, orte_proc_type_t flags)
|
||||
error = "orte progress thread start";
|
||||
goto error;
|
||||
}
|
||||
#else
|
||||
error = "event thread support is not configured";
|
||||
ret = ORTE_ERROR;
|
||||
goto error;
|
||||
#endif
|
||||
#else
|
||||
/* set the event base to the opal one */
|
||||
orte_event_base = opal_event_base;
|
||||
#endif
|
||||
} else {
|
||||
/* ORTE tools "block" in their own loop over the event
|
||||
* base, so no progress thread is required
|
||||
*/
|
||||
orte_event_base = opal_event_base;
|
||||
}
|
||||
|
||||
/* initialize the RTE for this environment */
|
||||
if (ORTE_SUCCESS != (ret = orte_ess.init())) {
|
||||
|
@ -1025,19 +1025,9 @@ int orterun(int argc, char *argv[])
|
||||
rc = orte_plm.spawn(jdata);
|
||||
|
||||
/* loop the event lib until an exit event is detected */
|
||||
#if ORTE_ENABLE_PROGRESS_THREADS
|
||||
while (orte_event_base_active) {
|
||||
/* provide a very short quiet period so we
|
||||
* don't hammer the cpu while
|
||||
*/
|
||||
struct timespec tp = {0, 100};
|
||||
nanosleep(&tp, NULL);
|
||||
}
|
||||
#else
|
||||
while (orte_event_base_active) {
|
||||
opal_event_loop(orte_event_base, OPAL_EVLOOP_ONCE);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* ensure all local procs are dead */
|
||||
orte_odls.kill_local_procs(NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user