1
1

re-order event library init/cleanup to handle a cleanup issue on threaded build

(at least this seems to fix it on my box :-) )

This commit was SVN r2459.
Этот коммит содержится в:
Tim Woodall 2004-09-03 00:06:57 +00:00
родитель 255a7947b7
Коммит 8d3055e3e7
3 изменённых файлов: 15 добавлений и 11 удалений

Просмотреть файл

@ -173,7 +173,7 @@ int mca_ptl_tcp_component_close(void)
ompi_event_del(&mca_ptl_tcp_component.tcp_recv_event);
close(mca_ptl_tcp_component.tcp_listen_sd);
}
return ompi_event_fini();
return OMPI_SUCCESS;
}
@ -387,15 +387,6 @@ mca_ptl_base_module_t** mca_ptl_tcp_component_init(int *num_ptl_modules,
*allow_multi_user_threads = true;
*have_hidden_threads = OMPI_HAVE_THREADS;
/* need to set ompi_using_threads() as ompi_event_init() will spawn a thread if supported */
if(OMPI_HAVE_THREADS)
ompi_set_using_threads(true);
if((rc = ompi_event_init()) != OMPI_SUCCESS) {
ompi_output(0, "mca_ptl_tcp_component_init: unable to initialize event dispatch thread: %d\n", rc);
return NULL;
}
ompi_free_list_init(&mca_ptl_tcp_component.tcp_send_frags,
sizeof(mca_ptl_tcp_send_frag_t),
OBJ_CLASS(mca_ptl_tcp_send_frag_t),

Просмотреть файл

@ -8,6 +8,7 @@
#include "include/constants.h"
#include "runtime/runtime.h"
#include "event/event.h"
#include "util/output.h"
#include "util/proc_info.h"
#include "threads/mutex.h"
@ -29,11 +30,14 @@
int ompi_rte_finalize(void)
{
ompi_rte_unregister();
mca_oob_base_close();
/* cleanup the event processing thread first - before doing any other cleanup */
ompi_event_fini();
mca_pcm_base_close();
mca_llm_base_close();
mca_pcmclient_base_close();
mca_ns_base_close();
mca_oob_base_close();
ompi_session_dir_finalize();

Просмотреть файл

@ -10,6 +10,7 @@
#include "include/constants.h"
#include "runtime/runtime.h"
#include "event/event.h"
#include "util/output.h"
#include "threads/mutex.h"
#include "mca/mca.h"
@ -103,6 +104,14 @@ int ompi_rte_init(bool *allow_multi_user_threads, bool *have_hidden_threads)
ret = mca_base_param_register_int("ompi", "rte", "debug", NULL, 0);
mca_base_param_lookup_int(ret, &ompi_rte_debug_flag);
/*
* Initialize the event library
*/
if (OMPI_SUCCESS != (ret = ompi_event_init())) {
ompi_output(0, "ompi_rte_init: ompi_event_init failed with error status: %d\n", ret);
return ret;
}
/*
* Out of Band Messaging
*/