No need for ORTE tools to use orte progress thread
This commit was SVN r28445.
Этот коммит содержится в:
родитель
422331b4da
Коммит
27e3e382d5
@ -811,19 +811,9 @@ int orte_daemon(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* loop the event lib until an exit event is detected */
|
/* 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) {
|
while (orte_event_base_active) {
|
||||||
opal_event_loop(orte_event_base, OPAL_EVLOOP_ONCE);
|
opal_event_loop(orte_event_base, OPAL_EVLOOP_ONCE);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* ensure all local procs are dead */
|
/* ensure all local procs are dead */
|
||||||
orte_odls.kill_local_procs(NULL);
|
orte_odls.kill_local_procs(NULL);
|
||||||
|
@ -71,18 +71,20 @@ int orte_finalize(void)
|
|||||||
|
|
||||||
/* close the ess itself */
|
/* close the ess itself */
|
||||||
(void) mca_base_framework_close(&orte_ess_base_framework);
|
(void) mca_base_framework_close(&orte_ess_base_framework);
|
||||||
|
|
||||||
|
if (ORTE_PROC_IS_APP) {
|
||||||
#if ORTE_ENABLE_PROGRESS_THREADS
|
#if ORTE_ENABLE_PROGRESS_THREADS
|
||||||
/* stop the progress thread */
|
/* stop the progress thread */
|
||||||
orte_event_base_active = false;
|
orte_event_base_active = false;
|
||||||
/* break the event loop */
|
/* break the event loop */
|
||||||
opal_event_base_loopbreak(orte_event_base);
|
opal_event_base_loopbreak(orte_event_base);
|
||||||
/* wait for thread to exit */
|
/* wait for thread to exit */
|
||||||
opal_thread_join(&orte_progress_thread, NULL);
|
opal_thread_join(&orte_progress_thread, NULL);
|
||||||
OBJ_DESTRUCT(&orte_progress_thread);
|
OBJ_DESTRUCT(&orte_progress_thread);
|
||||||
/* release the event base */
|
/* release the event base */
|
||||||
/* opal_event_base_free(orte_event_base); */
|
opal_event_base_free(orte_event_base);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/* cleanup the process info */
|
/* cleanup the process info */
|
||||||
orte_proc_info_finalize();
|
orte_proc_info_finalize();
|
||||||
|
@ -138,8 +138,8 @@ int orte_init(int* pargc, char*** pargv, orte_proc_type_t flags)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ORTE_PROC_IS_APP) {
|
||||||
#if ORTE_ENABLE_PROGRESS_THREADS
|
#if ORTE_ENABLE_PROGRESS_THREADS
|
||||||
#if OPAL_EVENT_HAVE_THREAD_SUPPORT
|
|
||||||
/* get a separate orte event base */
|
/* get a separate orte event base */
|
||||||
orte_event_base = opal_event_base_create();
|
orte_event_base = opal_event_base_create();
|
||||||
/* construct the thread object */
|
/* 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";
|
error = "orte progress thread start";
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
error = "event thread support is not configured";
|
|
||||||
ret = ORTE_ERROR;
|
|
||||||
goto error;
|
|
||||||
#endif
|
|
||||||
#else
|
#else
|
||||||
/* set the event base to the opal one */
|
/* set the event base to the opal one */
|
||||||
orte_event_base = opal_event_base;
|
orte_event_base = opal_event_base;
|
||||||
#endif
|
#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 */
|
/* initialize the RTE for this environment */
|
||||||
if (ORTE_SUCCESS != (ret = orte_ess.init())) {
|
if (ORTE_SUCCESS != (ret = orte_ess.init())) {
|
||||||
|
@ -1025,19 +1025,9 @@ int orterun(int argc, char *argv[])
|
|||||||
rc = orte_plm.spawn(jdata);
|
rc = orte_plm.spawn(jdata);
|
||||||
|
|
||||||
/* loop the event lib until an exit event is detected */
|
/* 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) {
|
while (orte_event_base_active) {
|
||||||
opal_event_loop(orte_event_base, OPAL_EVLOOP_ONCE);
|
opal_event_loop(orte_event_base, OPAL_EVLOOP_ONCE);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* ensure all local procs are dead */
|
/* ensure all local procs are dead */
|
||||||
orte_odls.kill_local_procs(NULL);
|
orte_odls.kill_local_procs(NULL);
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user