Merge pull request #715 from rhc54/topic/evbase
Rename the current opal_event_base to opal_sync_event_base in prepara…
Этот коммит содержится в:
Коммит
d16af830fa
@ -8,6 +8,7 @@
|
||||
* Copyright (c) 2010-2012 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2015 Intel, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -32,7 +33,6 @@
|
||||
|
||||
#include "opal/util/opal_environ.h"
|
||||
#include "ompi/mca/mca.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/mca/pmix/pmix.h"
|
||||
|
||||
#include "ompi/request/request.h"
|
||||
@ -4440,7 +4440,7 @@ static int ft_event_exchange_bookmarks(void)
|
||||
/* Wait for all bookmarks to arrive */
|
||||
START_TIMER(CRCP_TIMER_CKPT_EX_WAIT);
|
||||
while( total_recv_bookmarks > 0 ) {
|
||||
opal_event_loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
opal_event_loop(opal_sync_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
}
|
||||
total_recv_bookmarks = 0;
|
||||
END_TIMER(CRCP_TIMER_CKPT_EX_WAIT);
|
||||
@ -5227,7 +5227,7 @@ static int wait_quiesce_drain_ack(void)
|
||||
}
|
||||
}
|
||||
|
||||
opal_event_loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
opal_event_loop(opal_sync_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
}
|
||||
|
||||
/* Clear the ack queue if it isn't already clear (it should already be) */
|
||||
|
@ -175,7 +175,7 @@ static int service_pipe_cmd_add_fd(bool use_libevent, cmd_t *cmd)
|
||||
if (use_libevent) {
|
||||
/* Make an event for this fd */
|
||||
ri->ri_event_used = true;
|
||||
opal_event_set(opal_event_base, &ri->ri_event, ri->ri_fd,
|
||||
opal_event_set(opal_sync_event_base, &ri->ri_event, ri->ri_fd,
|
||||
ri->ri_flags | OPAL_EV_PERSIST, service_fd_callback,
|
||||
ri);
|
||||
opal_event_add(&ri->ri_event, 0);
|
||||
@ -501,7 +501,7 @@ int opal_btl_openib_fd_init(void)
|
||||
|
||||
/* Create a libevent event that is used in the main thread
|
||||
to watch its pipe */
|
||||
opal_event_set(opal_event_base, &main_thread_event, pipe_to_main_thread[0],
|
||||
opal_event_set(opal_sync_event_base, &main_thread_event, pipe_to_main_thread[0],
|
||||
OPAL_EV_READ | OPAL_EV_PERSIST,
|
||||
main_thread_event_callback, NULL);
|
||||
opal_event_add(&main_thread_event, 0);
|
||||
|
@ -2212,7 +2212,7 @@ static void udcm_sent_message_constructor (udcm_message_sent_t *message)
|
||||
{
|
||||
memset ((char *)message + sizeof (message->super), 0,
|
||||
sizeof (*message) - sizeof (message->super));
|
||||
opal_event_evtimer_set(opal_event_base, &message->event, udcm_send_timeout, message);
|
||||
opal_event_evtimer_set(opal_sync_event_base, &message->event, udcm_send_timeout, message);
|
||||
}
|
||||
|
||||
static void udcm_sent_message_destructor (udcm_message_sent_t *message)
|
||||
|
@ -818,7 +818,7 @@ static int mca_btl_tcp_component_create_listen(uint16_t af_family)
|
||||
/* register listen port */
|
||||
#if OPAL_ENABLE_IPV6
|
||||
if (AF_INET6 == af_family) {
|
||||
opal_event_set(opal_event_base, &mca_btl_tcp_component.tcp6_recv_event,
|
||||
opal_event_set(opal_sync_event_base, &mca_btl_tcp_component.tcp6_recv_event,
|
||||
mca_btl_tcp_component.tcp6_listen_sd,
|
||||
OPAL_EV_READ|OPAL_EV_PERSIST,
|
||||
mca_btl_tcp_component_accept_handler,
|
||||
@ -827,7 +827,7 @@ static int mca_btl_tcp_component_create_listen(uint16_t af_family)
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
opal_event_set(opal_event_base, &mca_btl_tcp_component.tcp_recv_event,
|
||||
opal_event_set(opal_sync_event_base, &mca_btl_tcp_component.tcp_recv_event,
|
||||
mca_btl_tcp_component.tcp_listen_sd,
|
||||
OPAL_EV_READ|OPAL_EV_PERSIST,
|
||||
mca_btl_tcp_component_accept_handler,
|
||||
@ -1049,7 +1049,7 @@ static void mca_btl_tcp_component_accept_handler( int incoming_sd,
|
||||
|
||||
/* wait for receipt of peers process identifier to complete this connection */
|
||||
event = OBJ_NEW(mca_btl_tcp_event_t);
|
||||
opal_event_set(opal_event_base, &event->event, sd, OPAL_EV_READ, mca_btl_tcp_component_recv_handler, event);
|
||||
opal_event_set(opal_sync_event_base, &event->event, sd, OPAL_EV_READ, mca_btl_tcp_component_recv_handler, event);
|
||||
opal_event_add(&event->event, 0);
|
||||
}
|
||||
}
|
||||
|
@ -309,7 +309,7 @@ static inline void mca_btl_tcp_endpoint_event_init(mca_btl_base_endpoint_t* btl_
|
||||
btl_endpoint->endpoint_cache_pos = btl_endpoint->endpoint_cache;
|
||||
#endif /* MCA_BTL_TCP_ENDPOINT_CACHE */
|
||||
|
||||
opal_event_set(opal_event_base, &btl_endpoint->endpoint_recv_event,
|
||||
opal_event_set(opal_sync_event_base, &btl_endpoint->endpoint_recv_event,
|
||||
btl_endpoint->endpoint_sd,
|
||||
OPAL_EV_READ|OPAL_EV_PERSIST,
|
||||
mca_btl_tcp_endpoint_recv_handler,
|
||||
@ -320,7 +320,7 @@ static inline void mca_btl_tcp_endpoint_event_init(mca_btl_base_endpoint_t* btl_
|
||||
* will be fired only once, and when the endpoint is marked as
|
||||
* CONNECTED the event should be recreated with the correct flags.
|
||||
*/
|
||||
opal_event_set(opal_event_base, &btl_endpoint->endpoint_send_event,
|
||||
opal_event_set(opal_sync_event_base, &btl_endpoint->endpoint_send_event,
|
||||
btl_endpoint->endpoint_sd,
|
||||
OPAL_EV_WRITE,
|
||||
mca_btl_tcp_endpoint_send_handler,
|
||||
@ -509,7 +509,7 @@ void mca_btl_tcp_endpoint_accept(mca_btl_base_endpoint_t* btl_endpoint,
|
||||
assert(btl_endpoint->endpoint_sd_next == -1);
|
||||
btl_endpoint->endpoint_sd_next = sd;
|
||||
|
||||
opal_event_evtimer_set(opal_event_base, &btl_endpoint->endpoint_accept_event,
|
||||
opal_event_evtimer_set(opal_sync_event_base, &btl_endpoint->endpoint_accept_event,
|
||||
mca_btl_tcp_endpoint_complete_accept, btl_endpoint);
|
||||
opal_event_add(&btl_endpoint->endpoint_accept_event, &now);
|
||||
}
|
||||
@ -570,7 +570,7 @@ static void mca_btl_tcp_endpoint_connected(mca_btl_base_endpoint_t* btl_endpoint
|
||||
MCA_BTL_TCP_ENDPOINT_DUMP(1, btl_endpoint, true, "READY [endpoint_connected]");
|
||||
|
||||
/* Create the send event in a persistent manner. */
|
||||
opal_event_set(opal_event_base, &btl_endpoint->endpoint_send_event,
|
||||
opal_event_set(opal_sync_event_base, &btl_endpoint->endpoint_send_event,
|
||||
btl_endpoint->endpoint_sd,
|
||||
OPAL_EV_WRITE | OPAL_EV_PERSIST,
|
||||
mca_btl_tcp_endpoint_send_handler,
|
||||
|
@ -972,7 +972,7 @@ static mca_btl_base_module_t** usnic_component_init(int* num_btl_modules,
|
||||
}
|
||||
|
||||
/* start timer to guarantee synthetic clock advances */
|
||||
opal_event_set(opal_event_base, &usnic_clock_timer_event,
|
||||
opal_event_set(opal_sync_event_base, &usnic_clock_timer_event,
|
||||
-1, 0, usnic_clock_callback,
|
||||
&usnic_clock_timeout);
|
||||
usnic_clock_timer_event_set = true;
|
||||
|
@ -87,7 +87,7 @@ static void endpoint_construct(mca_btl_base_endpoint_t* endpoint)
|
||||
OBJ_CONSTRUCT(&endpoint->endpoint_hotel, opal_hotel_t);
|
||||
opal_hotel_init(&endpoint->endpoint_hotel,
|
||||
WINDOW_SIZE,
|
||||
opal_event_base,
|
||||
opal_sync_event_base,
|
||||
mca_btl_usnic_component.retrans_timeout,
|
||||
0,
|
||||
opal_btl_usnic_ack_timeout);
|
||||
|
@ -2068,7 +2068,7 @@ static void init_async_event(opal_btl_usnic_module_t *module)
|
||||
}
|
||||
|
||||
/* Get the fd to receive events on this device */
|
||||
opal_event_set(opal_event_base, &(module->device_async_event), fd,
|
||||
opal_event_set(opal_sync_event_base, &(module->device_async_event), fd,
|
||||
OPAL_EV_READ | OPAL_EV_PERSIST,
|
||||
module_async_event_callback, module);
|
||||
opal_event_add(&(module->device_async_event), NULL);
|
||||
|
@ -212,7 +212,7 @@ int opal_btl_usnic_stats_init(opal_btl_usnic_module_t *module)
|
||||
module->stats.timeout.tv_sec = mca_btl_usnic_component.stats_frequency;
|
||||
module->stats.timeout.tv_usec = 0;
|
||||
|
||||
opal_event_set(opal_event_base, &(module->stats.timer_event),
|
||||
opal_event_set(opal_sync_event_base, &(module->stats.timer_event),
|
||||
-1, EV_TIMEOUT | EV_PERSIST,
|
||||
&usnic_stats_callback, module);
|
||||
opal_event_add(&(module->stats.timer_event),
|
||||
|
@ -64,7 +64,7 @@ static int opal_event_base_close(void)
|
||||
/*
|
||||
* Globals
|
||||
*/
|
||||
opal_event_base_t *opal_event_base=NULL;
|
||||
opal_event_base_t *opal_sync_event_base=NULL;
|
||||
|
||||
static int opal_event_base_open(mca_base_open_flag_t flags)
|
||||
{
|
||||
@ -84,13 +84,13 @@ static int opal_event_base_open(mca_base_open_flag_t flags)
|
||||
opal_event_use_threads();
|
||||
|
||||
/* get our event base */
|
||||
if (NULL == (opal_event_base = opal_event_base_create())) {
|
||||
if (NULL == (opal_sync_event_base = opal_event_base_create())) {
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
|
||||
/* set the number of priorities */
|
||||
if (0 < OPAL_EVENT_NUM_PRI) {
|
||||
opal_event_base_priority_init(opal_event_base, OPAL_EVENT_NUM_PRI);
|
||||
opal_event_base_priority_init(opal_sync_event_base, OPAL_EVENT_NUM_PRI);
|
||||
}
|
||||
|
||||
return rc;
|
||||
|
@ -2,7 +2,7 @@
|
||||
/*
|
||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
*
|
||||
|
3
opal/mca/event/external/external.h
поставляемый
3
opal/mca/event/external/external.h
поставляемый
@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2011-2013 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights reserved.
|
||||
* Copyright (c) 2015 Intel, Inc. All rights reserved.
|
||||
*
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -27,7 +28,7 @@ BEGIN_C_DECLS
|
||||
typedef struct event_base opal_event_base_t;
|
||||
typedef struct event opal_event_t;
|
||||
|
||||
OPAL_DECLSPEC extern opal_event_base_t *opal_event_base;
|
||||
OPAL_DECLSPEC extern opal_event_base_t *opal_sync_event_base;
|
||||
|
||||
#define OPAL_EV_TIMEOUT EV_TIMEOUT
|
||||
#define OPAL_EV_READ EV_READ
|
||||
|
@ -67,7 +67,7 @@ BEGIN_C_DECLS
|
||||
typedef struct event_base opal_event_base_t;
|
||||
typedef struct event opal_event_t;
|
||||
|
||||
OPAL_DECLSPEC extern opal_event_base_t *opal_event_base;
|
||||
OPAL_DECLSPEC extern opal_event_base_t *opal_sync_event_base;
|
||||
|
||||
#define OPAL_EV_TIMEOUT EV_TIMEOUT
|
||||
#define OPAL_EV_READ EV_READ
|
||||
|
@ -811,7 +811,7 @@ int opal_cr_coord(int state)
|
||||
* Otherwise it may/will use stale file descriptors which will disrupt
|
||||
* the intended users of the soon-to-be newly assigned file descriptors.
|
||||
*/
|
||||
opal_event_reinit(opal_event_base);
|
||||
opal_event_reinit(opal_sync_event_base);
|
||||
|
||||
/*
|
||||
* Flush if() functionality, since it caches system specific info.
|
||||
|
@ -168,7 +168,7 @@ opal_progress(void)
|
||||
event_progress_last_time = (num_event_users > 0) ?
|
||||
now - event_progress_delta : now;
|
||||
|
||||
events += opal_event_loop(opal_event_base, opal_progress_event_flag);
|
||||
events += opal_event_loop(opal_sync_event_base, opal_progress_event_flag);
|
||||
}
|
||||
|
||||
#else /* OPAL_PROGRESS_USE_TIMERS */
|
||||
@ -177,7 +177,7 @@ opal_progress(void)
|
||||
if (OPAL_THREAD_ADD32(&event_progress_counter, -1) <= 0 ) {
|
||||
event_progress_counter =
|
||||
(num_event_users > 0) ? 0 : event_progress_delta;
|
||||
events += opal_event_loop(opal_event_base, opal_progress_event_flag);
|
||||
events += opal_event_loop(opal_sync_event_base, opal_progress_event_flag);
|
||||
}
|
||||
#endif /* OPAL_PROGRESS_USE_TIMERS */
|
||||
|
||||
|
@ -226,7 +226,7 @@ int orte_init(int* pargc, char*** pargv, orte_proc_type_t flags)
|
||||
* start their progress thread in ess_base_std_app.c
|
||||
* at the appropriate point
|
||||
*/
|
||||
orte_event_base = opal_event_base;
|
||||
orte_event_base = opal_sync_event_base;
|
||||
}
|
||||
|
||||
/* initialize the RTE for this environment */
|
||||
|
@ -238,10 +238,10 @@ int main(int argc, char *argv[])
|
||||
/* Set signal handlers to catch kill signals so we can properly clean up
|
||||
* after ourselves.
|
||||
*/
|
||||
opal_event_set(opal_event_base, &term_handler, SIGTERM, OPAL_EV_SIGNAL,
|
||||
opal_event_set(orte_event_base, &term_handler, SIGTERM, OPAL_EV_SIGNAL,
|
||||
shutdown_callback, NULL);
|
||||
opal_event_add(&term_handler, NULL);
|
||||
opal_event_set(opal_event_base, &int_handler, SIGINT, OPAL_EV_SIGNAL,
|
||||
opal_event_set(orte_event_base, &int_handler, SIGINT, OPAL_EV_SIGNAL,
|
||||
shutdown_callback, NULL);
|
||||
opal_event_add(&int_handler, NULL);
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user