Convert the opal_event framework to use direct function calls instead of hiding functions behind function pointers. Eliminate the opal_object_t abstraction of libevent's event struct so it can be directly passed to the libevent functions.
Note: the ompi_check_libfca.m4 file had to be modified to avoid it stomping on global CPPFLAGS and the like. The file was also relocated to the ompi/config directory as it pertains solely to an ompi-layer component. Forgive the mid-day configure change, but I know Shiqing is working the windows issues and don't want to cause him unnecessary redo work. This commit was SVN r23966.
Этот коммит содержится в:
родитель
c13b0bb668
Коммит
9ea2b196ce
@ -22,14 +22,14 @@ AC_DEFUN([OMPI_CHECK_FCA],[
|
||||
|
||||
AS_IF([test "$with_fca" != "no"],
|
||||
[AS_IF([test ! -z "$with_fca" -a "$with_fca" != "yes"],
|
||||
[ompi_check_fca_dir="$with_fca"
|
||||
[ompi_check_fca_dir=$with_fca
|
||||
ompi_check_fca_libdir="$ompi_check_fca_dir/lib"
|
||||
ompi_check_fca_incdir="$ompi_check_fca_dir/include"
|
||||
ompi_check_fca_libs="fca"
|
||||
ompi_check_fca_libs=fca
|
||||
|
||||
CPPFLAGS_save="$CPPFLAGS"
|
||||
LDFLAGS_save="$LDFLAGS"
|
||||
LIBS_save="$LIBS"
|
||||
CPPFLAGS_save=$CPPFLAGS
|
||||
LDFLAGS_save=$LDFLAGS
|
||||
LIBS_save=$LIBS
|
||||
CPPFLAGS="$CPPFLAGS -I$ompi_check_fca_dir/include/fca -I$ompi_check_fca_dir/include/fca_core"
|
||||
|
||||
OMPI_LOG_MSG([$1_CPPFLAGS : $$1_CPPFLAGS], 1)
|
||||
@ -44,14 +44,13 @@ AC_DEFUN([OMPI_CHECK_FCA],[
|
||||
[$ompi_check_fca_dir],
|
||||
[$ompi_check_fca_libdir],
|
||||
[ompi_check_fca_happy="yes"],
|
||||
[ompi_check_fca_happy="no"])],
|
||||
[ompi_check_fca_happy="no"])
|
||||
|
||||
CPPFLAGS=$CPPFLAGS_save
|
||||
LDFLAGS=$LDFLAGS_save
|
||||
LIBS=$LIBS_save],
|
||||
[ompi_check_fca_happy="no"])
|
||||
|
||||
CPPFLAGS="$CPPFLAGS_save"
|
||||
LDFLAGS="$LDFLAGS_save"
|
||||
LIBS="$LIBS_save"
|
||||
])
|
||||
|
||||
])
|
||||
|
||||
AS_IF([test "$ompi_check_fca_happy" = "yes" -a "$enable_progress_threads" = "yes"],
|
||||
[AC_MSG_WARN([fca driver does not currently support progress threads. Disabling FCA.])
|
@ -39,7 +39,7 @@ int mca_btl_base_close(void)
|
||||
}
|
||||
#if 0
|
||||
/* disable event processing while cleaning up btls */
|
||||
opal_event.disable();
|
||||
opal_event_disable();
|
||||
#endif
|
||||
/* Finalize all the btl components and free their list items */
|
||||
|
||||
@ -72,7 +72,7 @@ int mca_btl_base_close(void)
|
||||
|
||||
#if 0
|
||||
/* restore event processing */
|
||||
opal_event.enable();
|
||||
opal_event_enable();
|
||||
#endif
|
||||
/* All done */
|
||||
return OMPI_SUCCESS;
|
||||
|
@ -174,11 +174,10 @@ 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;
|
||||
OBJ_CONSTRUCT(&ri->ri_event, opal_event_t);
|
||||
opal_event.set(opal_event_base, &ri->ri_event, ri->ri_fd,
|
||||
opal_event_set(opal_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);
|
||||
opal_event_add(&ri->ri_event, 0);
|
||||
} else {
|
||||
/* Add the fd to the relevant fd local sets and update max_fd */
|
||||
if (OPAL_EV_READ & ri->ri_flags) {
|
||||
@ -237,8 +236,7 @@ static int service_pipe_cmd_remove_fd(cmd_t *cmd)
|
||||
event or an entry in the local fd sets. */
|
||||
if (ri->ri_event_used) {
|
||||
/* Remove this event from libevent */
|
||||
opal_event.del(&ri->ri_event);
|
||||
OBJ_DESTRUCT(&ri->ri_event);
|
||||
opal_event_del(&ri->ri_event);
|
||||
} else {
|
||||
/* Remove this item from the fd_sets and recalculate
|
||||
MAX_FD */
|
||||
@ -482,17 +480,16 @@ int ompi_btl_openib_fd_init(void)
|
||||
|
||||
/* Create a libevent event that is used in the main thread
|
||||
to watch its pipe */
|
||||
OBJ_CONSTRUCT(&main_thread_event, opal_event_t);
|
||||
opal_event.set(opal_event_base, &main_thread_event, pipe_to_main_thread[0],
|
||||
opal_event_set(opal_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);
|
||||
opal_event_add(&main_thread_event, 0);
|
||||
|
||||
/* Start the service thread */
|
||||
if (0 != pthread_create(&thread, NULL, service_thread_start,
|
||||
NULL)) {
|
||||
int errno_save = errno;
|
||||
opal_event.del(&main_thread_event);
|
||||
opal_event_del(&main_thread_event);
|
||||
close(pipe_to_service_thread[0]);
|
||||
close(pipe_to_service_thread[1]);
|
||||
close(pipe_to_main_thread[0]);
|
||||
@ -664,7 +661,7 @@ int ompi_btl_openib_fd_finalize(void)
|
||||
/* For the threaded version, send a command down the pipe */
|
||||
cmd_t cmd;
|
||||
OPAL_OUTPUT((-1, "shutting down openib fd"));
|
||||
opal_event.del(&main_thread_event);
|
||||
opal_event_del(&main_thread_event);
|
||||
memset(&cmd, 0, cmd_size);
|
||||
cmd.pc_cmd = CMD_TIME_TO_QUIT;
|
||||
opal_fd_write(pipe_to_service_thread[1], cmd_size, &cmd);
|
||||
@ -672,8 +669,7 @@ int ompi_btl_openib_fd_finalize(void)
|
||||
pthread_join(thread, NULL);
|
||||
opal_atomic_rmb();
|
||||
|
||||
opal_event.del(&main_thread_event);
|
||||
OBJ_DESTRUCT(&main_thread_event);
|
||||
opal_event_del(&main_thread_event);
|
||||
|
||||
close(pipe_to_service_thread[0]);
|
||||
close(pipe_to_service_thread[1]);
|
||||
|
@ -138,7 +138,6 @@ typedef struct mca_btl_sctp_event_t mca_btl_sctp_event_t;
|
||||
static void mca_btl_sctp_event_construct(mca_btl_sctp_event_t* event)
|
||||
{
|
||||
OPAL_THREAD_LOCK(&mca_btl_sctp_component.sctp_lock);
|
||||
OBJ_CONSTRUCT(&event->event, opal_event_t);
|
||||
opal_list_append(&mca_btl_sctp_component.sctp_events, &event->item);
|
||||
OPAL_THREAD_UNLOCK(&mca_btl_sctp_component.sctp_lock);
|
||||
}
|
||||
@ -147,7 +146,6 @@ static void mca_btl_sctp_event_destruct(mca_btl_sctp_event_t* event)
|
||||
{
|
||||
OPAL_THREAD_LOCK(&mca_btl_sctp_component.sctp_lock);
|
||||
opal_list_remove_item(&mca_btl_sctp_component.sctp_events, &event->item);
|
||||
OBJ_DESTRUCT(&event->event);
|
||||
OPAL_THREAD_UNLOCK(&mca_btl_sctp_component.sctp_lock);
|
||||
}
|
||||
|
||||
@ -289,8 +287,7 @@ int mca_btl_sctp_component_close(void)
|
||||
mca_btl_sctp_recv_handler_freebuf();
|
||||
|
||||
if (mca_btl_sctp_component.sctp_listen_sd >= 0) {
|
||||
opal_event.del(&mca_btl_sctp_component.sctp_recv_event);
|
||||
OBJ_DESTRUCT(&mca_btl_sctp_component.sctp_recv_event);
|
||||
opal_event_del(&mca_btl_sctp_component.sctp_recv_event);
|
||||
CLOSE_THE_SOCKET(mca_btl_sctp_component.sctp_listen_sd);
|
||||
mca_btl_sctp_component.sctp_listen_sd = -1;
|
||||
}
|
||||
@ -302,7 +299,7 @@ int mca_btl_sctp_component_close(void)
|
||||
item = next) {
|
||||
mca_btl_sctp_event_t* event = (mca_btl_sctp_event_t*)item;
|
||||
next = opal_list_get_next(item);
|
||||
opal_event.del(&event->event);
|
||||
opal_event_del(&event->event);
|
||||
OBJ_RELEASE(event);
|
||||
}
|
||||
OPAL_THREAD_UNLOCK(&mca_btl_sctp_component.sctp_lock);
|
||||
@ -555,8 +552,6 @@ static int mca_btl_sctp_component_create_instance(void)
|
||||
|
||||
static int mca_btl_sctp_component_create_listen(void)
|
||||
{
|
||||
OBJ_CONSTRUCT(&mca_btl_sctp_component.sctp_recv_event, opal_event_t);
|
||||
|
||||
if(mca_btl_sctp_component.sctp_if_11) {
|
||||
/* 1 to 1 */
|
||||
int rc;
|
||||
@ -605,13 +600,13 @@ static int mca_btl_sctp_component_create_listen(void)
|
||||
|
||||
|
||||
/* register listen port */
|
||||
opal_event.set(opal_event_base,
|
||||
opal_event_set(opal_event_base,
|
||||
&mca_btl_sctp_component.sctp_recv_event,
|
||||
mca_btl_sctp_component.sctp_listen_sd,
|
||||
OPAL_EV_READ|OPAL_EV_PERSIST,
|
||||
mca_btl_sctp_component_recv_handler,
|
||||
0);
|
||||
opal_event.add(&mca_btl_sctp_component.sctp_recv_event,0);
|
||||
opal_event_add(&mca_btl_sctp_component.sctp_recv_event,0);
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
@ -655,13 +650,13 @@ static int mca_btl_sctp_component_register_listen(void)
|
||||
|
||||
|
||||
/* register listen port */
|
||||
opal_event.set(opal_event_base,
|
||||
opal_event_set(opal_event_base,
|
||||
&mca_btl_sctp_component.sctp_recv_event,
|
||||
mca_btl_sctp_component.sctp_listen_sd,
|
||||
OPAL_EV_READ|OPAL_EV_PERSIST,
|
||||
mca_btl_sctp_recv_handler,
|
||||
0);
|
||||
opal_event.add(&mca_btl_sctp_component.sctp_recv_event,0);
|
||||
opal_event_add(&mca_btl_sctp_component.sctp_recv_event,0);
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
@ -896,8 +891,8 @@ void mca_btl_sctp_component_accept(void)
|
||||
/* wait for receipt of peers process identifier to complete this connection */
|
||||
|
||||
event = OBJ_NEW(mca_btl_sctp_event_t);
|
||||
opal_event.set(opal_event_base, &event->event, sd, OPAL_EV_READ, mca_btl_sctp_component_recv_handler, event);
|
||||
opal_event.add(&event->event, 0);
|
||||
opal_event_set(opal_event_base, &event->event, sd, OPAL_EV_READ, mca_btl_sctp_component_recv_handler, event);
|
||||
opal_event_add(&event->event, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -916,8 +911,8 @@ void mca_btl_sctp_component_accept(void)
|
||||
/* wait for receipt of peers process identifier to complete this connection */
|
||||
|
||||
event = OBJ_NEW(mca_btl_sctp_event_t);
|
||||
opal_event.set(opal_event_base, &event->event, sd, OPAL_EV_READ, mca_btl_sctp_recv_handler, event);
|
||||
opal_event.add(&event->event, 0);
|
||||
opal_event_set(opal_event_base, &event->event, sd, OPAL_EV_READ, mca_btl_sctp_recv_handler, event);
|
||||
opal_event_add(&event->event, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -109,8 +109,6 @@ static void mca_btl_sctp_endpoint_construct(mca_btl_sctp_endpoint_t* endpoint)
|
||||
endpoint->endpoint_sd = -1;
|
||||
endpoint->endpoint_send_frag = 0;
|
||||
endpoint->endpoint_recv_frag = 0;
|
||||
OBJ_CONSTRUCT(&endpoint->endpoint_send_event, opal_event_t);
|
||||
OBJ_CONSTRUCT(&endpoint->endpoint_recv_event, opal_event_t);
|
||||
endpoint->endpoint_state = MCA_BTL_SCTP_CLOSED;
|
||||
endpoint->endpoint_retries = 0;
|
||||
endpoint->endpoint_nbo = false;
|
||||
@ -182,8 +180,6 @@ static void mca_btl_sctp_endpoint_destruct(mca_btl_sctp_endpoint_t* endpoint)
|
||||
free(chunkp);
|
||||
}
|
||||
}
|
||||
OBJ_DESTRUCT(&endpoint->endpoint_send_event);
|
||||
OBJ_DESTRUCT(&endpoint->endpoint_recv_event);
|
||||
}
|
||||
|
||||
OBJ_CLASS_INSTANCE(
|
||||
@ -273,12 +269,12 @@ static inline void mca_btl_sctp_endpoint_event_init(mca_btl_base_endpoint_t* btl
|
||||
btl_endpoint->endpoint_cache_pos = btl_endpoint->endpoint_cache;
|
||||
#endif /* MCA_BTL_SCTP_ENDPOINT_CACHE */
|
||||
|
||||
opal_event.set(opal_event_base, &btl_endpoint->endpoint_recv_event,
|
||||
opal_event_set(opal_event_base, &btl_endpoint->endpoint_recv_event,
|
||||
btl_endpoint->endpoint_sd,
|
||||
OPAL_EV_READ|OPAL_EV_PERSIST,
|
||||
mca_btl_sctp_endpoint_recv_handler,
|
||||
btl_endpoint );
|
||||
opal_event.set(opal_event_base, &btl_endpoint->endpoint_send_event,
|
||||
opal_event_set(opal_event_base, &btl_endpoint->endpoint_send_event,
|
||||
btl_endpoint->endpoint_sd,
|
||||
OPAL_EV_WRITE|OPAL_EV_PERSIST,
|
||||
mca_btl_sctp_endpoint_send_handler,
|
||||
@ -297,12 +293,12 @@ static inline void mca_btl_sctp_endpoint_event_init(mca_btl_base_endpoint_t* btl
|
||||
btl_endpoint->endpoint_cache_pos = btl_endpoint->endpoint_cache;
|
||||
#endif /* MCA_BTL_SCTP_ENDPOINT_CACHE */
|
||||
|
||||
opal_event.set(opal_event_base, &btl_endpoint->endpoint_recv_event,
|
||||
opal_event_set(opal_event_base, &btl_endpoint->endpoint_recv_event,
|
||||
btl_endpoint->endpoint_sd,
|
||||
OPAL_EV_READ|OPAL_EV_PERSIST,
|
||||
mca_btl_sctp_recv_handler,
|
||||
btl_endpoint );
|
||||
opal_event.set(opal_event_base, &btl_endpoint->endpoint_send_event,
|
||||
opal_event_set(opal_event_base, &btl_endpoint->endpoint_send_event,
|
||||
btl_endpoint->endpoint_sd,
|
||||
OPAL_EV_WRITE|OPAL_EV_PERSIST,
|
||||
mca_btl_sctp_endpoint_send_handler,
|
||||
@ -353,7 +349,7 @@ int mca_btl_sctp_endpoint_send(mca_btl_base_endpoint_t* btl_endpoint, mca_btl_sc
|
||||
return OMPI_SUCCESS;
|
||||
} else {
|
||||
btl_endpoint->endpoint_send_frag = frag;
|
||||
opal_event.add(&btl_endpoint->endpoint_send_event, 0);
|
||||
opal_event_add(&btl_endpoint->endpoint_send_event, 0);
|
||||
}
|
||||
} else {
|
||||
opal_list_append(&btl_endpoint->endpoint_frags, (opal_list_item_t*)frag);
|
||||
@ -459,7 +455,7 @@ int mca_btl_sctp_endpoint_send(mca_btl_base_endpoint_t* btl_endpoint, mca_btl_sc
|
||||
} else {
|
||||
|
||||
/* no endpoint is currently associated with sending on this socket */
|
||||
opal_event.add(&btl_endpoint->endpoint_send_event, 0);
|
||||
opal_event_add(&btl_endpoint->endpoint_send_event, 0);
|
||||
endpoint_associated_with_send = btl_endpoint;
|
||||
}
|
||||
}
|
||||
@ -599,7 +595,7 @@ bool mca_btl_sctp_endpoint_accept(mca_btl_base_endpoint_t* btl_endpoint, struct
|
||||
return false;
|
||||
}
|
||||
mca_btl_sctp_endpoint_event_init(btl_endpoint, sd);
|
||||
opal_event.add(&btl_endpoint->endpoint_recv_event, 0);
|
||||
opal_event_add(&btl_endpoint->endpoint_recv_event, 0);
|
||||
mca_btl_sctp_endpoint_connected(btl_endpoint);
|
||||
#if OPAL_ENABLE_DEBUG && WANT_PEER_DUMP
|
||||
mca_btl_sctp_endpoint_dump(btl_endpoint, "accepted");
|
||||
@ -624,7 +620,7 @@ bool mca_btl_sctp_endpoint_accept(mca_btl_base_endpoint_t* btl_endpoint, struct
|
||||
|
||||
/* conflicts can't happen with one-to-many socket */
|
||||
mca_btl_sctp_endpoint_event_init(btl_endpoint, sd);
|
||||
opal_event.add(&btl_endpoint->endpoint_recv_event, 0);
|
||||
opal_event_add(&btl_endpoint->endpoint_recv_event, 0);
|
||||
#if OPAL_ENABLE_DEBUG && WANT_PEER_DUMP
|
||||
mca_btl_sctp_endpoint_dump(btl_endpoint, "accepted");
|
||||
#endif
|
||||
@ -650,10 +646,8 @@ void mca_btl_sctp_endpoint_close(mca_btl_base_endpoint_t* btl_endpoint)
|
||||
SCTP_BTL_ERROR(("inside endpoint_close (sd = %d)\n", btl_endpoint->endpoint_sd));
|
||||
|
||||
if(btl_endpoint->endpoint_sd >= 0) {
|
||||
opal_event.del(&btl_endpoint->endpoint_recv_event);
|
||||
OBJ_DESTRUCT(&btl_endpoint->endpoint_recv_event);
|
||||
opal_event.del(&btl_endpoint->endpoint_send_event);
|
||||
OBJ_DESTRUCT(&btl_endpoint->endpoint_send_event);
|
||||
opal_event_del(&btl_endpoint->endpoint_recv_event);
|
||||
opal_event_del(&btl_endpoint->endpoint_send_event);
|
||||
CLOSE_THE_SOCKET(btl_endpoint->endpoint_sd);
|
||||
btl_endpoint->endpoint_sd = -1;
|
||||
#if MCA_BTL_SCTP_ENDPOINT_CACHE
|
||||
@ -694,7 +688,7 @@ static void mca_btl_sctp_endpoint_connected(mca_btl_base_endpoint_t* btl_endpoin
|
||||
btl_endpoint->endpoint_send_frag = (mca_btl_sctp_frag_t*)
|
||||
opal_list_remove_first(&btl_endpoint->endpoint_frags);
|
||||
}
|
||||
opal_event.add(&btl_endpoint->endpoint_send_event, 0);
|
||||
opal_event_add(&btl_endpoint->endpoint_send_event, 0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -768,7 +762,7 @@ static void mca_btl_sctp_endpoint_connected(mca_btl_base_endpoint_t* btl_endpoin
|
||||
} else {
|
||||
|
||||
/* no endpoint is currently associated with sending on this socket */
|
||||
opal_event.add(&btl_endpoint->endpoint_send_event, 0);
|
||||
opal_event_add(&btl_endpoint->endpoint_send_event, 0);
|
||||
endpoint_associated_with_send = btl_endpoint;
|
||||
}
|
||||
}
|
||||
@ -968,7 +962,7 @@ static int mca_btl_sctp_endpoint_start_connect(mca_btl_base_endpoint_t* btl_endp
|
||||
opal_socket_errno == EWOULDBLOCK)
|
||||
{
|
||||
btl_endpoint->endpoint_state = MCA_BTL_SCTP_CONNECTING;
|
||||
opal_event.add(&btl_endpoint->endpoint_send_event, 0);
|
||||
opal_event_add(&btl_endpoint->endpoint_send_event, 0);
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
SCTP_BTL_ERROR(("endpoint_close in start_connect #1\n"));
|
||||
@ -980,7 +974,7 @@ static int mca_btl_sctp_endpoint_start_connect(mca_btl_base_endpoint_t* btl_endp
|
||||
/* send our globally unique process identifier to the endpoint */
|
||||
if((rc = mca_btl_sctp_endpoint_send_connect_ack(btl_endpoint)) == OMPI_SUCCESS) {
|
||||
btl_endpoint->endpoint_state = MCA_BTL_SCTP_CONNECT_ACK;
|
||||
opal_event.add(&btl_endpoint->endpoint_recv_event, 0);
|
||||
opal_event_add(&btl_endpoint->endpoint_recv_event, 0);
|
||||
} else {
|
||||
SCTP_BTL_ERROR(("endpoint_close in start_connect #2\n"));
|
||||
mca_btl_sctp_endpoint_close(btl_endpoint);
|
||||
@ -1028,8 +1022,7 @@ static void mca_btl_sctp_endpoint_complete_connect(mca_btl_base_endpoint_t* btl_
|
||||
opal_socklen_t so_length = sizeof(so_error);
|
||||
|
||||
/* unregister from receiving event notifications */
|
||||
opal_event.del(&btl_endpoint->endpoint_send_event);
|
||||
OBJ_DESTRUCT(&btl_endpoint->endpoint_send_event);
|
||||
opal_event_del(&btl_endpoint->endpoint_send_event);
|
||||
|
||||
/* check connect completion status */
|
||||
if(getsockopt(btl_endpoint->endpoint_sd, SOL_SOCKET, SO_ERROR, (char *)&so_error, &so_length) < 0) {
|
||||
@ -1038,7 +1031,7 @@ static void mca_btl_sctp_endpoint_complete_connect(mca_btl_base_endpoint_t* btl_
|
||||
return;
|
||||
}
|
||||
if(so_error == EINPROGRESS || so_error == EWOULDBLOCK) {
|
||||
opal_event.add(&btl_endpoint->endpoint_send_event, 0);
|
||||
opal_event_add(&btl_endpoint->endpoint_send_event, 0);
|
||||
return;
|
||||
}
|
||||
if(so_error != 0) {
|
||||
@ -1049,7 +1042,7 @@ static void mca_btl_sctp_endpoint_complete_connect(mca_btl_base_endpoint_t* btl_
|
||||
|
||||
if(mca_btl_sctp_endpoint_send_connect_ack(btl_endpoint) == OMPI_SUCCESS) {
|
||||
btl_endpoint->endpoint_state = MCA_BTL_SCTP_CONNECT_ACK;
|
||||
opal_event.add(&btl_endpoint->endpoint_recv_event, 0);
|
||||
opal_event_add(&btl_endpoint->endpoint_recv_event, 0);
|
||||
} else {
|
||||
mca_btl_sctp_endpoint_close(btl_endpoint);
|
||||
}
|
||||
@ -1188,16 +1181,14 @@ static void mca_btl_sctp_endpoint_send_handler(int sd, short flags, void* user)
|
||||
|
||||
/* if nothing else to do unregister for send event notifications */
|
||||
if(NULL == btl_endpoint->endpoint_send_frag) {
|
||||
opal_event.del(&btl_endpoint->endpoint_send_event);
|
||||
OBJ_DESTRUCT(&btl_endpoint->endpoint_send_event);
|
||||
opal_event_del(&btl_endpoint->endpoint_send_event);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
BTL_ERROR(("invalid connection state (%d)",
|
||||
btl_endpoint->endpoint_state));
|
||||
opal_event.del(&btl_endpoint->endpoint_send_event);
|
||||
OBJ_DESTRUCT(&btl_endpoint->endpoint_send_event);
|
||||
opal_event_del(&btl_endpoint->endpoint_send_event);
|
||||
break;
|
||||
}
|
||||
OPAL_THREAD_UNLOCK(&btl_endpoint->endpoint_send_lock);
|
||||
@ -1241,8 +1232,7 @@ static void mca_btl_sctp_endpoint_send_handler(int sd, short flags, void* user)
|
||||
if(NULL == btl_endpoint->endpoint_send_frag && NULL == current_our_endpoint) {
|
||||
|
||||
/* remove the send event with this endpoint */
|
||||
opal_event.del(&btl_endpoint->endpoint_send_event);
|
||||
OBJ_DESTRUCT(&btl_endpoint->endpoint_send_event);
|
||||
opal_event_del(&btl_endpoint->endpoint_send_event);
|
||||
endpoint_associated_with_send = NULL;
|
||||
|
||||
/* see if there is another endpoint that wants the send event */
|
||||
@ -1280,7 +1270,7 @@ static void mca_btl_sctp_endpoint_send_handler(int sd, short flags, void* user)
|
||||
btl_endpoint = next_endpoint;
|
||||
assert(btl_endpoint->endpoint_in_list > 0);
|
||||
btl_endpoint->endpoint_in_list--;
|
||||
opal_event.add(&btl_endpoint->endpoint_send_event, 0);
|
||||
opal_event_add(&btl_endpoint->endpoint_send_event, 0);
|
||||
opal_list_append(&sending_endpoints_freelist, (opal_list_item_t *) our_btl_endpoint);
|
||||
endpoint_associated_with_send = btl_endpoint;
|
||||
goto send_handler_1_to_many_different_endpoint;
|
||||
@ -1325,8 +1315,7 @@ static void mca_btl_sctp_endpoint_send_handler(int sd, short flags, void* user)
|
||||
BTL_ERROR(("invalid connection state (%d)",
|
||||
btl_endpoint->endpoint_state));
|
||||
/*TODO: update del code to use sending_endpoints list */
|
||||
opal_event.del(&btl_endpoint->endpoint_send_event);
|
||||
OBJ_DESTRUCT(&btl_endpoint->endpoint_send_event);
|
||||
opal_event_del(&btl_endpoint->endpoint_send_event);
|
||||
}
|
||||
OPAL_THREAD_UNLOCK(&btl_endpoint->endpoint_send_lock);
|
||||
}
|
||||
|
@ -139,7 +139,6 @@ typedef struct mca_btl_tcp_event_t mca_btl_tcp_event_t;
|
||||
static void mca_btl_tcp_event_construct(mca_btl_tcp_event_t* event)
|
||||
{
|
||||
OPAL_THREAD_LOCK(&mca_btl_tcp_component.tcp_lock);
|
||||
OBJ_CONSTRUCT(&event->event, opal_event_t);
|
||||
opal_list_append(&mca_btl_tcp_component.tcp_events, &event->item);
|
||||
OPAL_THREAD_UNLOCK(&mca_btl_tcp_component.tcp_lock);
|
||||
}
|
||||
@ -148,7 +147,6 @@ static void mca_btl_tcp_event_destruct(mca_btl_tcp_event_t* event)
|
||||
{
|
||||
OPAL_THREAD_LOCK(&mca_btl_tcp_component.tcp_lock);
|
||||
opal_list_remove_item(&mca_btl_tcp_component.tcp_events, &event->item);
|
||||
OBJ_DESTRUCT(&event->event);
|
||||
OPAL_THREAD_UNLOCK(&mca_btl_tcp_component.tcp_lock);
|
||||
}
|
||||
|
||||
@ -309,15 +307,13 @@ int mca_btl_tcp_component_close(void)
|
||||
free(mca_btl_tcp_component.tcp_btls);
|
||||
|
||||
if (mca_btl_tcp_component.tcp_listen_sd >= 0) {
|
||||
opal_event.del(&mca_btl_tcp_component.tcp_recv_event);
|
||||
OBJ_DESTRUCT(&mca_btl_tcp_component.tcp_recv_event);
|
||||
opal_event_del(&mca_btl_tcp_component.tcp_recv_event);
|
||||
CLOSE_THE_SOCKET(mca_btl_tcp_component.tcp_listen_sd);
|
||||
mca_btl_tcp_component.tcp_listen_sd = -1;
|
||||
}
|
||||
#if OPAL_WANT_IPV6
|
||||
if (mca_btl_tcp_component.tcp6_listen_sd >= 0) {
|
||||
opal_event.del(&mca_btl_tcp_component.tcp6_recv_event);
|
||||
OBJ_DESTRUCT(&mca_btl_tcp_component.tcp6_recv_event);
|
||||
opal_event_del(&mca_btl_tcp_component.tcp6_recv_event);
|
||||
CLOSE_THE_SOCKET(mca_btl_tcp_component.tcp6_listen_sd);
|
||||
mca_btl_tcp_component.tcp6_listen_sd = -1;
|
||||
}
|
||||
@ -331,7 +327,7 @@ int mca_btl_tcp_component_close(void)
|
||||
item = next) {
|
||||
mca_btl_tcp_event_t* event = (mca_btl_tcp_event_t*)item;
|
||||
next = opal_list_get_next(item);
|
||||
opal_event.del(&event->event);
|
||||
opal_event_del(&event->event);
|
||||
OBJ_RELEASE(event);
|
||||
}
|
||||
OPAL_THREAD_UNLOCK(&mca_btl_tcp_component.tcp_lock);
|
||||
@ -798,23 +794,21 @@ static int mca_btl_tcp_component_create_listen(uint16_t af_family)
|
||||
|
||||
/* register listen port */
|
||||
if (AF_INET == af_family) {
|
||||
OBJ_CONSTRUCT(&mca_btl_tcp_component.tcp_recv_event, opal_event_t);
|
||||
opal_event.set(opal_event_base, &mca_btl_tcp_component.tcp_recv_event,
|
||||
opal_event_set(opal_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,
|
||||
0 );
|
||||
opal_event.add(&mca_btl_tcp_component.tcp_recv_event, 0);
|
||||
opal_event_add(&mca_btl_tcp_component.tcp_recv_event, 0);
|
||||
}
|
||||
#if OPAL_WANT_IPV6
|
||||
if (AF_INET6 == af_family) {
|
||||
OBJ_CONSTRUCT(&mca_btl_tcp_component.tcp6_recv_event, opal_event_t);
|
||||
opal_event.set(opal_event_base, &mca_btl_tcp_component.tcp6_recv_event,
|
||||
opal_event_set(opal_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,
|
||||
0 );
|
||||
opal_event.add(&mca_btl_tcp_component.tcp6_recv_event, 0);
|
||||
opal_event_add(&mca_btl_tcp_component.tcp6_recv_event, 0);
|
||||
}
|
||||
#endif
|
||||
return OMPI_SUCCESS;
|
||||
@ -1032,8 +1026,8 @@ 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.add(&event->event, 0);
|
||||
opal_event_set(opal_event_base, &event->event, sd, OPAL_EV_READ, mca_btl_tcp_component_recv_handler, event);
|
||||
opal_event_add(&event->event, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,8 +73,6 @@ static void mca_btl_tcp_endpoint_construct(mca_btl_tcp_endpoint_t* endpoint)
|
||||
endpoint->endpoint_sd = -1;
|
||||
endpoint->endpoint_send_frag = 0;
|
||||
endpoint->endpoint_recv_frag = 0;
|
||||
OBJ_CONSTRUCT(&endpoint->endpoint_send_event, opal_event_t);
|
||||
OBJ_CONSTRUCT(&endpoint->endpoint_recv_event, opal_event_t);
|
||||
endpoint->endpoint_state = MCA_BTL_TCP_CLOSED;
|
||||
endpoint->endpoint_retries = 0;
|
||||
endpoint->endpoint_nbo = false;
|
||||
@ -99,8 +97,6 @@ static void mca_btl_tcp_endpoint_destruct(mca_btl_tcp_endpoint_t* endpoint)
|
||||
OBJ_DESTRUCT(&endpoint->endpoint_frags);
|
||||
OBJ_DESTRUCT(&endpoint->endpoint_send_lock);
|
||||
OBJ_DESTRUCT(&endpoint->endpoint_recv_lock);
|
||||
OBJ_DESTRUCT(&endpoint->endpoint_send_event);
|
||||
OBJ_DESTRUCT(&endpoint->endpoint_recv_event);
|
||||
}
|
||||
|
||||
OBJ_CLASS_INSTANCE(
|
||||
@ -214,7 +210,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_event_base, &btl_endpoint->endpoint_recv_event,
|
||||
btl_endpoint->endpoint_sd,
|
||||
OPAL_EV_READ|OPAL_EV_PERSIST,
|
||||
mca_btl_tcp_endpoint_recv_handler,
|
||||
@ -225,7 +221,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_event_base, &btl_endpoint->endpoint_send_event,
|
||||
btl_endpoint->endpoint_sd,
|
||||
OPAL_EV_WRITE,
|
||||
mca_btl_tcp_endpoint_send_handler,
|
||||
@ -271,7 +267,7 @@ int mca_btl_tcp_endpoint_send(mca_btl_base_endpoint_t* btl_endpoint, mca_btl_tcp
|
||||
return 1;
|
||||
} else {
|
||||
btl_endpoint->endpoint_send_frag = frag;
|
||||
opal_event.add(&btl_endpoint->endpoint_send_event, 0);
|
||||
opal_event_add(&btl_endpoint->endpoint_send_event, 0);
|
||||
frag->base.des_flags |= MCA_BTL_DES_SEND_ALWAYS_CALLBACK;
|
||||
}
|
||||
} else {
|
||||
@ -369,7 +365,7 @@ bool mca_btl_tcp_endpoint_accept(mca_btl_base_endpoint_t* btl_endpoint,
|
||||
return false;
|
||||
}
|
||||
mca_btl_tcp_endpoint_event_init(btl_endpoint);
|
||||
opal_event.add(&btl_endpoint->endpoint_recv_event, 0);
|
||||
opal_event_add(&btl_endpoint->endpoint_recv_event, 0);
|
||||
mca_btl_tcp_endpoint_connected(btl_endpoint);
|
||||
#if OPAL_ENABLE_DEBUG && WANT_PEER_DUMP
|
||||
mca_btl_tcp_endpoint_dump(btl_endpoint, "accepted");
|
||||
@ -395,8 +391,8 @@ void mca_btl_tcp_endpoint_close(mca_btl_base_endpoint_t* btl_endpoint)
|
||||
return;
|
||||
btl_endpoint->endpoint_state = MCA_BTL_TCP_CLOSED;
|
||||
btl_endpoint->endpoint_retries++;
|
||||
opal_event.del(&btl_endpoint->endpoint_recv_event);
|
||||
opal_event.del(&btl_endpoint->endpoint_send_event);
|
||||
opal_event_del(&btl_endpoint->endpoint_recv_event);
|
||||
opal_event_del(&btl_endpoint->endpoint_send_event);
|
||||
CLOSE_THE_SOCKET(btl_endpoint->endpoint_sd);
|
||||
btl_endpoint->endpoint_sd = -1;
|
||||
#if MCA_BTL_TCP_ENDPOINT_CACHE
|
||||
@ -420,7 +416,7 @@ static void mca_btl_tcp_endpoint_connected(mca_btl_base_endpoint_t* btl_endpoint
|
||||
btl_endpoint->endpoint_retries = 0;
|
||||
|
||||
/* Create the send event in a persistent manner. */
|
||||
opal_event.set(opal_event_base, &btl_endpoint->endpoint_send_event,
|
||||
opal_event_set(opal_event_base, &btl_endpoint->endpoint_send_event,
|
||||
btl_endpoint->endpoint_sd,
|
||||
OPAL_EV_WRITE | OPAL_EV_PERSIST,
|
||||
mca_btl_tcp_endpoint_send_handler,
|
||||
@ -430,7 +426,7 @@ static void mca_btl_tcp_endpoint_connected(mca_btl_base_endpoint_t* btl_endpoint
|
||||
if(NULL == btl_endpoint->endpoint_send_frag)
|
||||
btl_endpoint->endpoint_send_frag = (mca_btl_tcp_frag_t*)
|
||||
opal_list_remove_first(&btl_endpoint->endpoint_frags);
|
||||
opal_event.add(&btl_endpoint->endpoint_send_event, 0);
|
||||
opal_event_add(&btl_endpoint->endpoint_send_event, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -581,7 +577,7 @@ static int mca_btl_tcp_endpoint_start_connect(mca_btl_base_endpoint_t* btl_endpo
|
||||
/* non-blocking so wait for completion */
|
||||
if(opal_socket_errno == EINPROGRESS || opal_socket_errno == EWOULDBLOCK) {
|
||||
btl_endpoint->endpoint_state = MCA_BTL_TCP_CONNECTING;
|
||||
opal_event.add(&btl_endpoint->endpoint_send_event, 0);
|
||||
opal_event_add(&btl_endpoint->endpoint_send_event, 0);
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
{
|
||||
@ -600,7 +596,7 @@ static int mca_btl_tcp_endpoint_start_connect(mca_btl_base_endpoint_t* btl_endpo
|
||||
/* send our globally unique process identifier to the endpoint */
|
||||
if((rc = mca_btl_tcp_endpoint_send_connect_ack(btl_endpoint)) == OMPI_SUCCESS) {
|
||||
btl_endpoint->endpoint_state = MCA_BTL_TCP_CONNECT_ACK;
|
||||
opal_event.add(&btl_endpoint->endpoint_recv_event, 0);
|
||||
opal_event_add(&btl_endpoint->endpoint_recv_event, 0);
|
||||
} else {
|
||||
mca_btl_tcp_endpoint_close(btl_endpoint);
|
||||
}
|
||||
@ -622,7 +618,7 @@ static void mca_btl_tcp_endpoint_complete_connect(mca_btl_base_endpoint_t* btl_e
|
||||
mca_btl_tcp_proc_tosocks(btl_endpoint->endpoint_addr, &endpoint_addr);
|
||||
|
||||
/* unregister from receiving event notifications */
|
||||
opal_event.del(&btl_endpoint->endpoint_send_event);
|
||||
opal_event_del(&btl_endpoint->endpoint_send_event);
|
||||
|
||||
/* check connect completion status */
|
||||
if(getsockopt(btl_endpoint->endpoint_sd, SOL_SOCKET, SO_ERROR, (char *)&so_error, &so_length) < 0) {
|
||||
@ -633,7 +629,7 @@ static void mca_btl_tcp_endpoint_complete_connect(mca_btl_base_endpoint_t* btl_e
|
||||
return;
|
||||
}
|
||||
if(so_error == EINPROGRESS || so_error == EWOULDBLOCK) {
|
||||
opal_event.add(&btl_endpoint->endpoint_send_event, 0);
|
||||
opal_event_add(&btl_endpoint->endpoint_send_event, 0);
|
||||
return;
|
||||
}
|
||||
if(so_error != 0) {
|
||||
@ -646,7 +642,7 @@ static void mca_btl_tcp_endpoint_complete_connect(mca_btl_base_endpoint_t* btl_e
|
||||
|
||||
if(mca_btl_tcp_endpoint_send_connect_ack(btl_endpoint) == OMPI_SUCCESS) {
|
||||
btl_endpoint->endpoint_state = MCA_BTL_TCP_CONNECT_ACK;
|
||||
opal_event.add(&btl_endpoint->endpoint_recv_event, 0);
|
||||
opal_event_add(&btl_endpoint->endpoint_recv_event, 0);
|
||||
} else {
|
||||
mca_btl_tcp_endpoint_close(btl_endpoint);
|
||||
}
|
||||
@ -795,12 +791,12 @@ static void mca_btl_tcp_endpoint_send_handler(int sd, short flags, void* user)
|
||||
|
||||
/* if nothing else to do unregister for send event notifications */
|
||||
if(NULL == btl_endpoint->endpoint_send_frag) {
|
||||
opal_event.del(&btl_endpoint->endpoint_send_event);
|
||||
opal_event_del(&btl_endpoint->endpoint_send_event);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
BTL_ERROR(("invalid connection state (%d)", btl_endpoint->endpoint_state));
|
||||
opal_event.del(&btl_endpoint->endpoint_send_event);
|
||||
opal_event_del(&btl_endpoint->endpoint_send_event);
|
||||
break;
|
||||
}
|
||||
OPAL_THREAD_UNLOCK(&btl_endpoint->endpoint_send_lock);
|
||||
|
@ -4445,7 +4445,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_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
}
|
||||
total_recv_bookmarks = 0;
|
||||
END_TIMER(CRCP_TIMER_CKPT_EX_WAIT);
|
||||
@ -5240,7 +5240,7 @@ static int wait_quiesce_drain_ack(void)
|
||||
}
|
||||
}
|
||||
|
||||
opal_event.loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
opal_event_loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
}
|
||||
|
||||
/* Clear the ack queue if it isn't already clear (it should already be) */
|
||||
|
@ -42,17 +42,13 @@ static void mca_pml_dr_vfrag_construct(mca_pml_dr_vfrag_t* vfrag)
|
||||
vfrag->vf_ack_tv = mca_pml_dr.ack_timer;
|
||||
vfrag->vf_wdog_cnt = 0;
|
||||
vfrag->vf_ack_cnt = 0;
|
||||
OBJ_CONSTRUCT(&vfrag->vf_wdog_ev, opal_event_t);
|
||||
opal_event.evtimer_set(opal_event_base, &vfrag->vf_wdog_ev, mca_pml_dr_vfrag_wdog_timeout, (void*) vfrag);
|
||||
OBJ_CONSTRUCT(&vfrag->vf_ack_ev, opal_event_t);
|
||||
opal_event.evtimer_set(opal_event_base, &vfrag->vf_ack_ev, mca_pml_dr_vfrag_ack_timeout, (void*) vfrag);
|
||||
opal_event_evtimer_set(opal_event_base, &vfrag->vf_wdog_ev, mca_pml_dr_vfrag_wdog_timeout, (void*) vfrag);
|
||||
opal_event_evtimer_set(opal_event_base, &vfrag->vf_ack_ev, mca_pml_dr_vfrag_ack_timeout, (void*) vfrag);
|
||||
}
|
||||
|
||||
|
||||
static void mca_pml_dr_vfrag_destruct(mca_pml_dr_vfrag_t* vfrag)
|
||||
{
|
||||
OBJ_DESTRUCT(&vfrag->vf_wdog_ev);
|
||||
OBJ_DESTRUCT(&vfrag->vf_ack_ev);
|
||||
}
|
||||
|
||||
|
||||
|
@ -99,18 +99,18 @@ do { \
|
||||
|
||||
#define MCA_PML_DR_VFRAG_WDOG_START(vfrag) \
|
||||
do { \
|
||||
opal_event.add(&(vfrag)->vf_wdog_ev, &(vfrag)->vf_wdog_tv); \
|
||||
opal_event_add(&(vfrag)->vf_wdog_ev, &(vfrag)->vf_wdog_tv); \
|
||||
} while(0)
|
||||
|
||||
#define MCA_PML_DR_VFRAG_WDOG_STOP(vfrag) \
|
||||
do { \
|
||||
opal_event.del(&(vfrag)->vf_wdog_ev); \
|
||||
opal_event_del(&(vfrag)->vf_wdog_ev); \
|
||||
} while(0)
|
||||
|
||||
#define MCA_PML_DR_VFRAG_WDOG_RESET(vfrag) \
|
||||
do { \
|
||||
opal_event.del(&(vfrag)->vf_wdog_ev); \
|
||||
opal_event.add(&(vfrag)->vf_wdog_ev, &vfrag->vf_wdog_tv); \
|
||||
opal_event_del(&(vfrag)->vf_wdog_ev); \
|
||||
opal_event_add(&(vfrag)->vf_wdog_ev, &vfrag->vf_wdog_tv); \
|
||||
} while(0)
|
||||
|
||||
|
||||
@ -120,12 +120,12 @@ do { \
|
||||
|
||||
#define MCA_PML_DR_VFRAG_ACK_START(vfrag) \
|
||||
do { \
|
||||
opal_event.add(&(vfrag)->vf_ack_ev, &(vfrag)->vf_ack_tv); \
|
||||
opal_event_add(&(vfrag)->vf_ack_ev, &(vfrag)->vf_ack_tv); \
|
||||
} while(0)
|
||||
|
||||
#define MCA_PML_DR_VFRAG_ACK_STOP(vfrag) \
|
||||
do { \
|
||||
opal_event.del(&vfrag->vf_ack_ev); \
|
||||
opal_event_del(&vfrag->vf_ack_ev); \
|
||||
} while(0)
|
||||
|
||||
#define MCA_PML_DR_VFRAG_ACK_RESET(vfrag) \
|
||||
|
@ -241,14 +241,12 @@ int main(int argc, char *argv[])
|
||||
/* Set signal handlers to catch kill signals so we can properly clean up
|
||||
* after ourselves.
|
||||
*/
|
||||
OBJ_CONSTRUCT(&term_handler, opal_event_t);
|
||||
opal_event.set(opal_event_base, &term_handler, SIGTERM, OPAL_EV_SIGNAL,
|
||||
opal_event_set(opal_event_base, &term_handler, SIGTERM, OPAL_EV_SIGNAL,
|
||||
shutdown_callback, NULL);
|
||||
opal_event.add(&term_handler, NULL);
|
||||
OBJ_CONSTRUCT(&int_handler, opal_event_t);
|
||||
opal_event.set(opal_event_base, &int_handler, SIGINT, OPAL_EV_SIGNAL,
|
||||
opal_event_add(&term_handler, NULL);
|
||||
opal_event_set(opal_event_base, &int_handler, SIGINT, OPAL_EV_SIGNAL,
|
||||
shutdown_callback, NULL);
|
||||
opal_event.add(&int_handler, NULL);
|
||||
opal_event_add(&int_handler, NULL);
|
||||
|
||||
/* We actually do *not* want the server to voluntarily yield() the
|
||||
processor more than necessary. The server already blocks when
|
||||
@ -284,7 +282,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* wait to hear we are done */
|
||||
opal_event.dispatch(opal_event_base);
|
||||
opal_event_dispatch(opal_event_base);
|
||||
|
||||
/* should never get here, but if we do... */
|
||||
|
||||
|
@ -20,12 +20,7 @@ int opal_event_base_close(void)
|
||||
opal_list_item_t *item;
|
||||
|
||||
/* release the event base */
|
||||
OBJ_RELEASE(opal_event_base);
|
||||
|
||||
/* If there is a selected event module, finalize it */
|
||||
if (NULL != opal_event.finalize) {
|
||||
opal_event.finalize();
|
||||
}
|
||||
opal_event_base_finalize(opal_event_base);
|
||||
|
||||
/* no need to close the component as it was statically opened */
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "opal/mca/mca.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/mca/base/mca_base_param.h"
|
||||
|
||||
#include "opal/mca/event/event.h"
|
||||
#include "opal/mca/event/base/base.h"
|
||||
|
||||
@ -31,17 +32,12 @@
|
||||
* Globals
|
||||
*/
|
||||
int opal_event_base_output = -1;
|
||||
opal_event_module_t opal_event = {0};
|
||||
opal_list_t opal_event_components;
|
||||
opal_event_base_t *opal_event_base=NULL;
|
||||
/*
|
||||
* Only ONE event component can compile at any time, so
|
||||
* just open that one - it will be statically built
|
||||
*/
|
||||
|
||||
int opal_event_base_open(void)
|
||||
{
|
||||
int value, rc = OPAL_SUCCESS;
|
||||
mca_base_component_list_item_t *cli;
|
||||
|
||||
/* Debugging / verbose output */
|
||||
mca_base_param_reg_int_name("event", "base_verbose",
|
||||
@ -58,72 +54,22 @@ int opal_event_base_open(void)
|
||||
* to a list
|
||||
*/
|
||||
OBJ_CONSTRUCT(&opal_event_components, opal_list_t);
|
||||
if (NULL != mca_event_base_static_components[0]) {
|
||||
opal_event_component_t *component =
|
||||
(opal_event_component_t*)
|
||||
mca_event_base_static_components[0];
|
||||
|
||||
/* Save it in a global list for ompi_info */
|
||||
cli = OBJ_NEW(mca_base_component_list_item_t);
|
||||
cli->cli_component = mca_event_base_static_components[0];
|
||||
opal_list_append(&opal_event_components,
|
||||
&cli->super);
|
||||
|
||||
if (NULL != component->base_version.mca_open_component) {
|
||||
if (OPAL_SUCCESS !=component->base_version.mca_open_component()) {
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
/* component will have done its duty, so close it */
|
||||
if (NULL != component->base_version.mca_close_component) {
|
||||
component->base_version.mca_close_component();
|
||||
}
|
||||
if (OPAL_SUCCESS !=
|
||||
mca_base_components_open("event", 0,
|
||||
mca_event_base_static_components,
|
||||
&opal_event_components, true)) {
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
|
||||
/* Init the final module */
|
||||
if (NULL != opal_event.init) {
|
||||
rc = opal_event.init();
|
||||
/* init the lib */
|
||||
if (OPAL_SUCCESS != (rc = opal_event_init())) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* get our event base */
|
||||
opal_event_base = OBJ_NEW(opal_event_base_t);
|
||||
if (NULL == (opal_event_base = opal_event_base_create())) {
|
||||
rc = OPAL_ERROR;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**** EVENT OBJECT ****/
|
||||
static void ev_construct(opal_event_t *ptr)
|
||||
{
|
||||
if (NULL != opal_event.construct) {
|
||||
opal_event.construct(ptr);
|
||||
}
|
||||
}
|
||||
static void ev_destruct(opal_event_t *ptr)
|
||||
{
|
||||
if (NULL != opal_event.destruct) {
|
||||
opal_event.destruct(ptr);
|
||||
}
|
||||
}
|
||||
OBJ_CLASS_INSTANCE(opal_event_t,
|
||||
opal_object_t,
|
||||
ev_construct,
|
||||
ev_destruct);
|
||||
|
||||
static void evbase_construct(opal_event_base_t *ptr)
|
||||
{
|
||||
ptr->base = NULL;
|
||||
if (NULL != opal_event.construct_base) {
|
||||
opal_event.construct_base(ptr);
|
||||
}
|
||||
}
|
||||
static void evbase_destruct(opal_event_base_t *ptr)
|
||||
{
|
||||
if (NULL != opal_event.destruct_base) {
|
||||
opal_event.destruct_base(ptr);
|
||||
}
|
||||
}
|
||||
OBJ_CLASS_INSTANCE(opal_event_base_t,
|
||||
opal_object_t,
|
||||
evbase_construct,
|
||||
evbase_destruct);
|
||||
|
@ -8,6 +8,17 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
# There will only be one component used in this framework, and it will
|
||||
# be selected at configure time by priority. Components must set
|
||||
# their priorities in their configure.m4 files. They must also set
|
||||
# the shell variable $event_base_include to a header file name
|
||||
# (relative to the top OMPI source directory) that will be included in
|
||||
# opal/mca/event/event.h. Optionally, components may also set the
|
||||
# shell variable $event_base_include_cppflags if additional CPPFLAGS
|
||||
# must be used with this header file. The event framework will add
|
||||
# the winning component's $event_base_include_cppflags to the global
|
||||
# $CPPFLAGS.
|
||||
|
||||
dnl We only want one winning component.
|
||||
m4_define(MCA_opal_event_CONFIGURE_MODE, STOP_AT_FIRST_PRIORITY)
|
||||
|
||||
@ -28,7 +39,6 @@ AC_DEFUN([MCA_opal_event_CONFIG],[
|
||||
# event component (for timers, etc.), but we don't have working
|
||||
# event ops. Ensure that it was set by the component.
|
||||
echo " "
|
||||
echo HAVE_WORKING_EVENTOPS is: $OPAL_HAVE_WORKING_EVENTOPS
|
||||
AC_MSG_CHECKING([if have working event ops for the event framework])
|
||||
AS_IF([test "$OPAL_HAVE_WORKING_EVENTOPS" = ""],
|
||||
[AC_MSG_RESULT([unknown])
|
||||
@ -40,4 +50,18 @@ AC_DEFUN([MCA_opal_event_CONFIG],[
|
||||
AC_DEFINE_UNQUOTED(OPAL_HAVE_WORKING_EVENTOPS,
|
||||
[$OPAL_HAVE_WORKING_EVENTOPS],
|
||||
[Whether our event component has working event operations or not (if not, then assumedly it only has working timers and signals)])
|
||||
|
||||
# someone should have set this...
|
||||
AS_IF([test "$event_base_include" = ""],
|
||||
[AC_MSG_WARN([Missing implementation header])
|
||||
AC_MSG_ERROR([Cannot continue])])
|
||||
|
||||
AC_DEFINE_UNQUOTED([MCA_event_IMPLEMENTATION_HEADER],
|
||||
["opal/mca/event/$event_base_include"],
|
||||
[Header to include for event implementation])
|
||||
AC_MSG_CHECKING([for winning component additional CPPFLAGS])
|
||||
AS_IF([test "$event_base_include_cppflags" != ""],
|
||||
[AC_MSG_RESULT([$event_base_include_cppflags])
|
||||
CPPFLAGS="$CPPFLAGS $event_base_include_cppflags -DGOT_EVENT_BASE_INCLUDE_CPPFLAGS"],
|
||||
[AC_MSG_RESULT([none])])
|
||||
])
|
||||
|
@ -2,12 +2,9 @@
|
||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* The OPAL interface into the Libevent library. Contains a number
|
||||
* of renamings for use inside OPAL, and some customized wrapper functions
|
||||
*
|
||||
* NOTE: OPAL functions currently point to deprecated libevent interfaces!
|
||||
*
|
||||
* @file opal_event.h
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*/
|
||||
|
||||
#ifndef OPAL_MCA_EVENT_H
|
||||
@ -30,8 +27,6 @@
|
||||
|
||||
#include "opal/mca/mca.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/class/opal_object.h"
|
||||
#include "opal/class/opal_list.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
@ -43,111 +38,10 @@ typedef unsigned char u_char;
|
||||
typedef unsigned short u_short;
|
||||
#endif
|
||||
|
||||
#define OPAL_EV_TIMEOUT 0x01
|
||||
#define OPAL_EV_READ 0x02
|
||||
#define OPAL_EV_WRITE 0x04
|
||||
#define OPAL_EV_SIGNAL 0x08
|
||||
/* Persistent event: won't get removed automatically when activated. */
|
||||
#define OPAL_EV_PERSIST 0x10
|
||||
|
||||
#define OPAL_EVENT_SIGNAL(ev) opal_event.get_signal(ev)
|
||||
|
||||
#define OPAL_EVLOOP_ONCE 0x01 /**< Block at most once. */
|
||||
#define OPAL_EVLOOP_NONBLOCK 0x02 /**< Do not block. */
|
||||
|
||||
/* selected module will fill this typedef in with their
|
||||
* own definition of ev_struct
|
||||
*/
|
||||
typedef struct {
|
||||
opal_object_t super;
|
||||
void *event;
|
||||
} opal_event_t;
|
||||
OPAL_DECLSPEC OBJ_CLASS_DECLARATION(opal_event_t);
|
||||
|
||||
typedef struct {
|
||||
opal_object_t super;
|
||||
void *base;
|
||||
} opal_event_base_t;
|
||||
OPAL_DECLSPEC OBJ_CLASS_DECLARATION(opal_event_base_t);
|
||||
#define OPAL_EVENT_SIGNAL(ev) opal_event_get_signal(ev)
|
||||
|
||||
#define OPAL_TIMEOUT_DEFAULT {1, 0}
|
||||
typedef void (*opal_event_callback_fn_t)(int, short, void *);
|
||||
typedef int (*opal_event_base_module_init_fn_t)(void);
|
||||
typedef int (*opal_event_base_module_fini_fn_t)(void);
|
||||
typedef void (*opal_event_base_module_set_debug_output_fn_t)(bool output);
|
||||
|
||||
typedef int (*opal_event_base_module_set_fn_t)(opal_event_base_t *evbase,
|
||||
opal_event_t *ev, int fd, short events,
|
||||
opal_event_callback_fn_t cbfunc, void *arg);
|
||||
typedef int (*opal_event_base_module_add_fn_t)(opal_event_t *ev, const struct timeval *tv);
|
||||
|
||||
typedef int (*opal_event_base_module_del_fn_t)(opal_event_t *ev);
|
||||
|
||||
typedef int (*opal_event_base_module_get_signal_fn_t)(opal_event_t *ev);
|
||||
|
||||
typedef int (*opal_event_base_module_dispatch_fn_t)(opal_event_base_t *evbase);
|
||||
|
||||
/**
|
||||
Create a timer event
|
||||
*/
|
||||
typedef opal_event_t* (*opal_event_base_module_evtimer_new_fn_t)(opal_event_base_t *evbase,
|
||||
opal_event_callback_fn_t cbfunc,
|
||||
void *cbdata);
|
||||
|
||||
/**
|
||||
Add a timer event.
|
||||
|
||||
@param ev the event struct
|
||||
@param tv timeval struct
|
||||
*/
|
||||
typedef int (*opal_event_base_module_evtimer_add_fn_t)(opal_event_t *ev, const struct timeval *tv);
|
||||
|
||||
/**
|
||||
Define a timer event.
|
||||
|
||||
@param ev event struct to be modified
|
||||
@param cb callback function
|
||||
@param arg argument that will be passed to the callback function
|
||||
*/
|
||||
typedef void (*opal_event_base_module_evtimer_set_fn_t)(opal_event_base_t *evbase,
|
||||
opal_event_t *ev,
|
||||
opal_event_callback_fn_t cbfunc, void *cbdata);
|
||||
|
||||
/**
|
||||
* Delete a timer event.
|
||||
*
|
||||
* @param ev the event struct to be disabled
|
||||
*/
|
||||
typedef int (*opal_event_base_module_evtimer_del_fn_t)(opal_event_t *ev);
|
||||
|
||||
typedef int (*opal_event_base_module_evtimer_pending_fn_t)(opal_event_t *ev, struct timeval *tv);
|
||||
|
||||
typedef int (*opal_event_base_module_evtimer_initialized_fn_t)(opal_event_t *ev);
|
||||
|
||||
|
||||
typedef int (*opal_event_base_module_signal_add_fn_t)(opal_event_t *ev, struct timeval *tv);
|
||||
|
||||
typedef int (*opal_event_base_module_signal_set_fn_t)(opal_event_base_t *evbase,
|
||||
opal_event_t *ev, int fd,
|
||||
opal_event_callback_fn_t cbfunc, void *cbdata);
|
||||
|
||||
typedef int (*opal_event_base_module_signal_del_fn_t)(opal_event_t *ev);
|
||||
|
||||
typedef int (*opal_event_base_module_signal_pending_fn_t)(opal_event_t *ev, struct timeval *tv);
|
||||
|
||||
typedef int (*opal_event_base_module_signal_initialized_fn_t)(opal_event_t *ev);
|
||||
|
||||
typedef int (*opal_event_base_module_loop_fn_t)(opal_event_base_t *evbase, int flags);
|
||||
|
||||
/* construct/destruct the event struct hidden inside the opal_event_t object */
|
||||
typedef void (*opal_event_base_module_construct_fn_t)(opal_event_t *ev);
|
||||
|
||||
typedef void (*opal_event_base_module_destruct_fn_t)(opal_event_t *ev);
|
||||
|
||||
/* construct/destruct the event base hidden inside the opal_event_base_t object */
|
||||
typedef void (*opal_event_base_construct_base_fn_t)(opal_event_base_t *evbase);
|
||||
typedef void (*opal_event_base_destruct_base_fn_t)(opal_event_base_t *evbase);
|
||||
|
||||
|
||||
/* This is to prevent event library from picking up the win32_ops
|
||||
since this will be picked up over select(). By using select, we can
|
||||
@ -174,45 +68,6 @@ struct opal_event_base_component_2_0_0_t {
|
||||
typedef struct opal_event_base_component_2_0_0_t opal_event_base_component_2_0_0_t;
|
||||
typedef struct opal_event_base_component_2_0_0_t opal_event_component_t;
|
||||
|
||||
/**
|
||||
* Structure for event API
|
||||
*/
|
||||
struct opal_event_base_module_1_0_0_t {
|
||||
/* constructor/destructor needed for event struct */
|
||||
opal_event_base_module_construct_fn_t construct;
|
||||
opal_event_base_module_destruct_fn_t destruct;
|
||||
/* constructor/destructor needed for event_base struct */
|
||||
opal_event_base_construct_base_fn_t construct_base;
|
||||
opal_event_base_destruct_base_fn_t destruct_base;
|
||||
/* all API functions */
|
||||
opal_event_base_module_init_fn_t init;
|
||||
opal_event_base_module_fini_fn_t finalize;
|
||||
opal_event_base_module_set_debug_output_fn_t set_debug_output;
|
||||
opal_event_base_module_set_fn_t set;
|
||||
opal_event_base_module_add_fn_t add;
|
||||
opal_event_base_module_del_fn_t del;
|
||||
opal_event_base_module_get_signal_fn_t get_signal;
|
||||
opal_event_base_module_dispatch_fn_t dispatch;
|
||||
opal_event_base_module_evtimer_new_fn_t evtimer_new;
|
||||
opal_event_base_module_evtimer_add_fn_t evtimer_add;
|
||||
opal_event_base_module_evtimer_set_fn_t evtimer_set;
|
||||
opal_event_base_module_evtimer_del_fn_t evtimer_del;
|
||||
opal_event_base_module_evtimer_pending_fn_t evtimer_pending;
|
||||
opal_event_base_module_evtimer_initialized_fn_t evtimer_initialized;
|
||||
opal_event_base_module_signal_add_fn_t signal_add;
|
||||
opal_event_base_module_signal_set_fn_t signal_set;
|
||||
opal_event_base_module_signal_del_fn_t signal_del;
|
||||
opal_event_base_module_signal_pending_fn_t signal_pending;
|
||||
opal_event_base_module_signal_initialized_fn_t signal_initialized;
|
||||
opal_event_base_module_loop_fn_t loop;
|
||||
};
|
||||
|
||||
/**
|
||||
* Convenience typedef
|
||||
*/
|
||||
typedef struct opal_event_base_module_1_0_0_t opal_event_base_module_1_0_0_t;
|
||||
typedef struct opal_event_base_module_1_0_0_t opal_event_module_t;
|
||||
|
||||
/**
|
||||
* Macro for use in components that are of type event
|
||||
*/
|
||||
@ -220,11 +75,9 @@ typedef struct opal_event_base_module_1_0_0_t opal_event_module_t;
|
||||
MCA_BASE_VERSION_2_0_0, \
|
||||
"event", 2, 0, 0
|
||||
|
||||
/* Global structure for accessing event functions */
|
||||
OPAL_DECLSPEC extern opal_event_module_t opal_event;
|
||||
OPAL_DECLSPEC extern opal_event_base_t *opal_event_base;
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
/* include implementation to call */
|
||||
#include MCA_event_IMPLEMENTATION_HEADER
|
||||
|
||||
#endif /* OPAL_EVENT_H_ */
|
||||
|
@ -13,11 +13,18 @@ AM_CPPFLAGS = -I$(srcdir)/libevent -I$(srcdir)/libevent/include -I$(builddir)/li
|
||||
|
||||
SUBDIRS = libevent
|
||||
|
||||
headers = libevent207.h
|
||||
|
||||
sources = \
|
||||
libevent207.h \
|
||||
libevent207_component.c \
|
||||
libevent207_module.c
|
||||
|
||||
# Conditionally install the header files
|
||||
if WANT_INSTALL_HEADERS
|
||||
opaldir = $(includedir)/openmpi/$(subdir)
|
||||
nobase_opal_HEADERS = $(headers)
|
||||
endif
|
||||
|
||||
# Make the output library in this directory, and name it either
|
||||
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
|
||||
# (for static builds).
|
||||
|
@ -19,11 +19,12 @@ AC_DEFUN([MCA_opal_event_libevent207_COMPILE_MODE], [
|
||||
AC_MSG_RESULT([$$4])
|
||||
])
|
||||
|
||||
# MCA_event_libevent207_CONFIG(action-if-can-compile,
|
||||
# [action-if-cant-compile])
|
||||
# MCA_event_libevent207_CONFIG([action-if-can-compile],
|
||||
# [action-if-cant-compile])
|
||||
# ------------------------------------------------
|
||||
AC_DEFUN([MCA_opal_event_libevent207_CONFIG],[
|
||||
AC_CONFIG_FILES([opal/mca/event/libevent207/Makefile])
|
||||
basedir="opal/mca/event/libevent207"
|
||||
|
||||
CFLAGS_save="$CFLAGS"
|
||||
CFLAGS="$OMPI_CFLAGS_BEFORE_PICKY $OPAL_VISIBILITY_CFLAGS"
|
||||
@ -32,7 +33,7 @@ AC_DEFUN([MCA_opal_event_libevent207_CONFIG],[
|
||||
|
||||
AC_MSG_CHECKING([libevent configuration args])
|
||||
|
||||
str=`event_args="--disable-dns --disable-http --disable-rpc --disable-openssl --enable-hidden-symbols --disable-thread-support --includedir=$includedir/openmpi/opal/event/libevent/include"`
|
||||
str=`event_args="--disable-dns --disable-http --disable-rpc --disable-openssl --enable-hidden-symbols --includedir=$includedir/openmpi/opal/event/libevent/include"`
|
||||
eval $str
|
||||
unset str
|
||||
|
||||
@ -93,9 +94,15 @@ AC_DEFUN([MCA_opal_event_libevent207_CONFIG],[
|
||||
event_args="$event_args --disable-debug-mode"
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(event-thread-support,
|
||||
AC_HELP_STRING([--enable-event-thread-support], [enable event library internal thread support]))
|
||||
if test "$enable_event_thread_support" = "no"; then
|
||||
event_args="$event_args --disable-thread-support"
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([$event_args])
|
||||
|
||||
OMPI_CONFIG_SUBDIR(opal/mca/event/libevent207/libevent,
|
||||
OMPI_CONFIG_SUBDIR([$basedir/libevent],
|
||||
[$event_args $ompi_subdir_args],
|
||||
[libevent_happy="yes"], [libevent_happy="no"])
|
||||
if test "$libevent_happy" = "no"; then
|
||||
@ -108,13 +115,59 @@ AC_DEFUN([MCA_opal_event_libevent207_CONFIG],[
|
||||
|
||||
# If we configured successfully, set OPAL_HAVE_WORKING_EVENTOPS to
|
||||
# the value in the generated libevent/config.h (NOT
|
||||
# libevent/include/event2/event-config.h! That file is generated
|
||||
# during "make" -- libevent.h is an AC_HEADER_FILE). Otherwise,
|
||||
# set it to 0.
|
||||
file=opal/mca/event/libevent207/libevent/config.h
|
||||
# libevent/include/event2/event-config.h!). Otherwise, set it to
|
||||
# 0.
|
||||
file=$basedir/libevent/config.h
|
||||
AS_IF([test "$libevent_happy" = "yes" -a -r $file],
|
||||
[$1
|
||||
OPAL_HAVE_WORKING_EVENTOPS=`grep HAVE_WORKING_EVENTOPS $file | awk '{print [$]3 }'`],
|
||||
[OPAL_HAVE_WORKING_EVENTOPS=`grep HAVE_WORKING_EVENTOPS $file | awk '{print [$]3 }'`
|
||||
|
||||
# Build libevent/include/event2/event-config.h. If we
|
||||
# don't do it here, then libevent's Makefile.am will build
|
||||
# it during "make all", which is too late for us (because
|
||||
# other things are built before the event framework that
|
||||
# end up including event-config.h). The steps below were
|
||||
# copied from libevent's Makefile.am.
|
||||
file="$basedir/libevent/include/event2/event-config.h"
|
||||
mkdir -p "`dirname $OMPI_TOP_SRCDIR/$file`"
|
||||
AS_IF([test ! -d "`dirname $OMPI_TOP_SRCDIR/$file`"],
|
||||
[AC_MSG_WARN([Failed to mkdir `dirname $file`])
|
||||
AC_MSG_ERROR([Cannot continue])])
|
||||
|
||||
cat > "$file.in" <<EOF
|
||||
/* event2/event-config.h
|
||||
*
|
||||
* This file was generated by autoconf when libevent was built, and
|
||||
* post- processed by Open MPI's component configure.m4 (so that
|
||||
* Libevent wouldn't build it during "make all") so that its macros
|
||||
* would have a uniform prefix.
|
||||
*
|
||||
* DO NOT EDIT THIS FILE.
|
||||
*
|
||||
* Do not rely on macros in this file existing in later versions
|
||||
*/
|
||||
#ifndef _EVENT2_EVENT_CONFIG_H_
|
||||
#define _EVENT2_EVENT_CONFIG_H_
|
||||
EOF
|
||||
|
||||
sed -e 's/#define /#define _EVENT_/' \
|
||||
-e 's/#undef /#undef _EVENT_/' \
|
||||
-e 's/#ifndef /#ifndef _EVENT_/' < "$basedir/libevent/config.h" >> "$file.in"
|
||||
echo "#endif" >> "$file.in"
|
||||
AC_CONFIG_FILES([$file])
|
||||
|
||||
# Must set this variable so that the framework m4 knows
|
||||
# what file to include in opal/mca/event/event.h
|
||||
event_base_include="libevent207/libevent207.h"
|
||||
|
||||
# We also set _cppflags so that when including
|
||||
# libevent207.h, it can find all the actual libevent files.
|
||||
# Be a little friendly and only include the -I for the
|
||||
# builddir if it's different than the srcdir.
|
||||
file=$basedir/libevent
|
||||
event_base_include_cppflags="-I$OMPI_TOP_SRCDIR/$file -I$OMPI_TOP_SRCDIR/$file/include"
|
||||
AS_IF([test "$OMPI_TOP_BUILDDIR" != "$OMPI_TOP_SRCDIR"],
|
||||
[event_base_include_cppflags="$event_base_include_cpp_flags -I$OMPI_TOP_BUILDDIR/$file/include"])
|
||||
$1],
|
||||
[$2
|
||||
OPAL_HAVE_WORKING_EVENTOPS=0])
|
||||
unset file
|
||||
|
@ -130,26 +130,29 @@ if SIGNAL_SUPPORT
|
||||
SYS_SRC += signal.c
|
||||
endif
|
||||
|
||||
BUILT_SOURCES = ./include/event2/event-config.h
|
||||
# Open MPI: commented this out. We generate event-config.h in the
|
||||
# component configure.m4.
|
||||
#BUILT_SOURCES = ./include/event2/event-config.h
|
||||
|
||||
./include/event2/event-config.h: config.h
|
||||
@MKDIR_P@ ./include/event2
|
||||
echo '/* event2/event-config.h' > $@
|
||||
echo ' *' >> $@
|
||||
echo ' * This file was generated by autoconf when libevent was built, and post-' >> $@
|
||||
echo ' * processed by Libevent so that its macros would have a uniform prefix.' >> $@
|
||||
echo ' *' >> $@
|
||||
echo ' * DO NOT EDIT THIS FILE.' >> $@
|
||||
echo ' *' >> $@
|
||||
echo ' * Do not rely on macros in this file existing in later versions.'>> $@
|
||||
echo ' */' >> $@
|
||||
echo '#ifndef _EVENT2_EVENT_CONFIG_H_' >> $@
|
||||
echo '#define _EVENT2_EVENT_CONFIG_H_' >> $@
|
||||
|
||||
sed -e 's/#define /#define _EVENT_/' \
|
||||
-e 's/#undef /#undef _EVENT_/' \
|
||||
-e 's/#ifndef /#ifndef _EVENT_/' < config.h >> $@
|
||||
echo "#endif" >> $@
|
||||
# Open MPI: commented this out. We generate event-config.h in the
|
||||
# component configure.m4.
|
||||
#./include/event2/event-config.h: config.h
|
||||
# @MKDIR_P@ ./include/event2
|
||||
# echo '/* event2/event-config.h' > $@
|
||||
# echo ' *' >> $@
|
||||
# echo ' * This file was generated by autoconf when libevent was built, and post-' >> $@
|
||||
# echo ' * processed by Libevent so that its macros would have a uniform prefix.' >> $@
|
||||
# echo ' *' >> $@
|
||||
# echo ' * DO NOT EDIT THIS FILE.' >> $@
|
||||
# echo ' *' >> $@
|
||||
# echo ' * Do not rely on macros in this file existing in later versions.'>> $@
|
||||
# echo ' */' >> $@
|
||||
# echo '#ifndef _EVENT2_EVENT_CONFIG_H_' >> $@
|
||||
# echo '#define _EVENT2_EVENT_CONFIG_H_' >> $@
|
||||
# sed -e 's/#define /#define _EVENT_/' \
|
||||
# -e 's/#undef /#undef _EVENT_/' \
|
||||
# -e 's/#ifndef /#ifndef _EVENT_/' < config.h >> $@
|
||||
# echo "#endif" >> $@
|
||||
|
||||
CORE_SRC = event.c evthread.c buffer.c \
|
||||
bufferevent.c bufferevent_sock.c bufferevent_filter.c \
|
||||
|
@ -1,31 +1,126 @@
|
||||
/*
|
||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
*
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*
|
||||
* When this component is used, this file is included in the rest of
|
||||
* the OPAL/ORTE/OMPI code base via opal/mca/event/event.h. As such,
|
||||
* this header represents the public interface to this static component.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef MCA_LIBEVENT207_H
|
||||
#define MCA_LIBEVENT207_H
|
||||
#ifndef MCA_OPAL_EVENT_LIBEVENT207_H
|
||||
#define MCA_OPAL_EVENT_LIBEVENT207_H
|
||||
|
||||
#include "opal_config.h"
|
||||
|
||||
#include "opal/mca/mca.h"
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#include <sys/queue.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#ifndef WIN32
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <time.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "opal/class/opal_object.h"
|
||||
#include "opal/threads/mutex.h"
|
||||
#include "opal/threads/threads.h"
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/constants.h"
|
||||
#include "opal/util/argv.h"
|
||||
#include "opal/mca/base/mca_base_param.h"
|
||||
#include "opal/mca/event/base/base.h"
|
||||
|
||||
#include "libevent/event.h"
|
||||
|
||||
#include "opal/mca/event/event.h"
|
||||
|
||||
typedef struct event opal_event_t;
|
||||
typedef struct event_base opal_event_base_t;
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/**
|
||||
* Globally exported variable
|
||||
*/
|
||||
OPAL_DECLSPEC extern const opal_event_component_t mca_event_libevent207_component;
|
||||
/* Temporary global - will be replaced by layer-specific event bases */
|
||||
OPAL_DECLSPEC extern opal_event_base_t *opal_event_base;
|
||||
|
||||
OPAL_DECLSPEC extern const opal_event_module_t opal_event_libevent207;
|
||||
#define OPAL_EV_TIMEOUT EV_TIMEOUT
|
||||
#define OPAL_EV_READ EV_READ
|
||||
#define OPAL_EV_WRITE EV_WRITE
|
||||
#define OPAL_EV_SIGNAL EV_SIGNAL
|
||||
/* Persistent event: won't get removed automatically when activated. */
|
||||
#define OPAL_EV_PERSIST EV_PERSIST
|
||||
|
||||
#define OPAL_EVLOOP_ONCE EVLOOP_ONCE /**< Block at most once. */
|
||||
#define OPAL_EVLOOP_NONBLOCK EVLOOP_NONBLOCK /**< Do not block. */
|
||||
|
||||
/* Global function to create an event base */
|
||||
OPAL_DECLSPEC opal_event_base_t* opal_event_base_create(void);
|
||||
|
||||
OPAL_DECLSPEC int opal_event_init(void);
|
||||
|
||||
/* Basic event APIs */
|
||||
#define opal_event_base_finalize(x) event_base_free((x))
|
||||
|
||||
#define opal_event_set_debug_output(x) event_set_debug_output((x))
|
||||
|
||||
#define opal_event_set(b, ev, fd, fg, cb, arg) event_assign((ev), (b), (fd), (fg), (cb), (arg))
|
||||
|
||||
#define opal_event_add(ev, tv) event_add((ev), (tv))
|
||||
|
||||
#define opal_event_del(ev) event_del((ev))
|
||||
|
||||
/* Timer APIs */
|
||||
#define opal_event_evtimer_new(b, cb, arg) event_new((b), -1, 0, (cb), (arg))
|
||||
|
||||
#define opal_event_evtimer_add(ev, tv) event_add((ev), (tv))
|
||||
|
||||
#define opal_event_evtimer_set(b, ev, cb, arg) event_assign((ev), (b), -1, 0, (cb), (arg))
|
||||
|
||||
#define opal_event_evtimer_del(ev) event_del((ev))
|
||||
|
||||
#define opal_event_evtimer_pending(ev, tv) event_pending((ev), EV_TIMEOUT, (tv))
|
||||
|
||||
#define opal_event_evtimer_initialized(ev) event_initialized((ev))
|
||||
|
||||
/* Signal APIs */
|
||||
#define opal_event_signal_add(ev, tv) event_add((ev), (tv))
|
||||
|
||||
#define opal_event_signal_set(b, ev, fd, cb, arg) event_assign((ev), (b), (fd), EV_SIGNAL|EV_PERSIST, (cb), (arg))
|
||||
|
||||
#define opal_event_signal_del(ev) event_del((ev))
|
||||
|
||||
#define opal_event_signal_pending(ev, tv) event_pending((ev), EV_SIGNAL, (tv))
|
||||
|
||||
#define opal_event_signal_initalized(ev) event_initialized((ev))
|
||||
|
||||
#define opal_event_get_signal(ev) event_get_signal((ev))
|
||||
|
||||
#define opal_event_loop(b, fg) event_base_loop((b), (fg))
|
||||
|
||||
#define opal_event_dispatch(b) event_base_loop((b), 0)
|
||||
|
||||
END_C_DECLS
|
||||
#endif /* MCA_LIBEVENT207_H */
|
||||
|
||||
#endif /* MCA_OPAL_EVENT_LIBEVENT207_H */
|
||||
|
@ -62,9 +62,7 @@ const opal_event_component_t mca_event_libevent207_component = {
|
||||
|
||||
|
||||
static int libevent207_open(void)
|
||||
{
|
||||
opal_event = opal_event_libevent207;
|
||||
|
||||
{
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -49,66 +49,6 @@
|
||||
|
||||
#include "opal/mca/event/event.h"
|
||||
|
||||
static void constructor(opal_event_t *ev);
|
||||
static void destructor(opal_event_t *ev);
|
||||
static void construct_base(opal_event_base_t *evbase);
|
||||
static void destruct_base(opal_event_base_t *evbase);
|
||||
static int init(void);
|
||||
static int finalize(void);
|
||||
static void set_debug_output(bool output);
|
||||
static int set(opal_event_base_t *evbase,
|
||||
opal_event_t *ev, int fd, short events,
|
||||
opal_event_callback_fn_t cbfunc, void *arg);
|
||||
static int add(opal_event_t *ev, const struct timeval *tv);
|
||||
static int del(opal_event_t *ev);
|
||||
static int get_signal(opal_event_t *ev);
|
||||
static int dispatch(opal_event_base_t *evbase);
|
||||
static opal_event_t* module_evtimer_new(opal_event_base_t *evbase,
|
||||
opal_event_callback_fn_t cbfunc,
|
||||
void *cbdata);
|
||||
static int module_evtimer_add(opal_event_t *ev, const struct timeval *tv);
|
||||
static void module_evtimer_set(opal_event_base_t *evbase,
|
||||
opal_event_t *ev,
|
||||
opal_event_callback_fn_t cbfunc, void *cbdata);
|
||||
static int module_evtimer_del(opal_event_t *ev);
|
||||
static int module_evtimer_pending(opal_event_t *ev, struct timeval *tv);
|
||||
static int module_evtimer_initialized(opal_event_t *ev);
|
||||
static int module_signal_add(opal_event_t *ev, struct timeval *tv);
|
||||
static int module_signal_set(opal_event_base_t *evbase,
|
||||
opal_event_t *ev, int fd,
|
||||
opal_event_callback_fn_t cbfunc, void *cbdata);
|
||||
static int module_signal_del(opal_event_t *ev);
|
||||
static int module_signal_pending(opal_event_t *ev, struct timeval *tv);
|
||||
static int module_signal_initialized(opal_event_t *ev);
|
||||
static int loop(opal_event_base_t *evbase, int flags);
|
||||
|
||||
const opal_event_module_t opal_event_libevent207 = {
|
||||
constructor,
|
||||
destructor,
|
||||
construct_base,
|
||||
destruct_base,
|
||||
init,
|
||||
finalize,
|
||||
set_debug_output,
|
||||
set,
|
||||
add,
|
||||
del,
|
||||
get_signal,
|
||||
dispatch,
|
||||
module_evtimer_new,
|
||||
module_evtimer_add,
|
||||
module_evtimer_set,
|
||||
module_evtimer_del,
|
||||
module_evtimer_pending,
|
||||
module_evtimer_initialized,
|
||||
module_signal_add,
|
||||
module_signal_set,
|
||||
module_signal_del,
|
||||
module_signal_pending,
|
||||
module_signal_initialized,
|
||||
loop
|
||||
};
|
||||
|
||||
/* copied from event.c */
|
||||
#ifdef _EVENT_HAVE_EVENT_PORTS
|
||||
extern const struct eventop evportops;
|
||||
@ -158,23 +98,10 @@ static const struct eventop *eventops[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
static int debug_output = -1;
|
||||
static struct event_config *config=NULL;
|
||||
|
||||
static void constructor(opal_event_t *ev)
|
||||
{
|
||||
ev->event = (void*)malloc(sizeof(struct event));
|
||||
memset(ev->event, 0, sizeof(struct event));
|
||||
}
|
||||
|
||||
static void destructor(opal_event_t *ev)
|
||||
{
|
||||
if (NULL != ev->event) {
|
||||
event_free(ev->event);
|
||||
}
|
||||
}
|
||||
|
||||
static void construct_base(opal_event_base_t *evbase)
|
||||
/* Public function -- not part of the module */
|
||||
opal_event_base_t* opal_event_base_create(void)
|
||||
{
|
||||
struct event_base *base;
|
||||
|
||||
@ -182,30 +109,27 @@ static void construct_base(opal_event_base_t *evbase)
|
||||
if (NULL == base) {
|
||||
/* there is no backend method that does what we want */
|
||||
opal_output(0, "No event method available");
|
||||
evbase->base = NULL;
|
||||
return;
|
||||
}
|
||||
evbase->base = (void*)base;
|
||||
return base;
|
||||
}
|
||||
|
||||
static void destruct_base(opal_event_base_t *evbase)
|
||||
int opal_event_init(void)
|
||||
{
|
||||
if (NULL != evbase->base) {
|
||||
event_base_free(evbase->base);
|
||||
evbase->base = NULL;
|
||||
}
|
||||
}
|
||||
char* event_module_include=NULL;
|
||||
char **modules=NULL, **includes=NULL;
|
||||
bool dumpit;
|
||||
int i, j;
|
||||
const struct eventop** _eventop = eventops;
|
||||
char available_eventops[1024] = "none";
|
||||
char* help_msg = NULL;
|
||||
int position = 0;
|
||||
|
||||
static int init(void)
|
||||
{
|
||||
if (4 < opal_output_get_verbosity(opal_event_base_output)) {
|
||||
debug_output = opal_output_open(NULL);
|
||||
if (opal_output_get_verbosity(opal_event_base_output) > 4) {
|
||||
event_enable_debug_mode();
|
||||
event_set_debug_output(true);
|
||||
dumpit = true;
|
||||
}
|
||||
|
||||
OPAL_OUTPUT((debug_output, "event: initialized event library"));
|
||||
|
||||
/* Retrieve the upper level specified event system, if any.
|
||||
* Default to select() on OS X and poll() everywhere else because
|
||||
* various parts of OMPI / ORTE use libevent with pty's. pty's
|
||||
@ -230,208 +154,72 @@ static int init(void)
|
||||
* - orterun (probably only if it launches locally)
|
||||
* - ...?
|
||||
*/
|
||||
{
|
||||
char* event_module_include=NULL;
|
||||
char **modules=NULL, **includes=NULL;
|
||||
bool dumpit;
|
||||
int i, j;
|
||||
const struct eventop** _eventop = eventops;
|
||||
char available_eventops[1024] = "none";
|
||||
char* help_msg = NULL;
|
||||
int position = 0;
|
||||
|
||||
while( NULL != (*_eventop) ) {
|
||||
opal_argv_append_nosize(&modules, (*_eventop)->name);
|
||||
if( 0 != position ) {
|
||||
position += snprintf( available_eventops + position,
|
||||
(size_t)(1024 - position),
|
||||
", %s", (*_eventop)->name );
|
||||
} else {
|
||||
position += snprintf( available_eventops + position,
|
||||
(size_t)(1024 - position),
|
||||
"%s", (*_eventop)->name );
|
||||
}
|
||||
available_eventops[position] = '\0';
|
||||
_eventop++; /* go to the next available eventop */
|
||||
while( NULL != (*_eventop) ) {
|
||||
opal_argv_append_nosize(&modules, (*_eventop)->name);
|
||||
if( 0 != position ) {
|
||||
position += snprintf( available_eventops + position,
|
||||
(size_t)(1024 - position),
|
||||
", %s", (*_eventop)->name );
|
||||
} else {
|
||||
position += snprintf( available_eventops + position,
|
||||
(size_t)(1024 - position),
|
||||
"%s", (*_eventop)->name );
|
||||
}
|
||||
asprintf( &help_msg,
|
||||
"Comma-delimited list of libevent subsystems "
|
||||
"to use (%s -- available on your platform)",
|
||||
available_eventops );
|
||||
mca_base_param_reg_string_name("opal", "event_include",
|
||||
help_msg, false, false,
|
||||
available_eventops[position] = '\0';
|
||||
_eventop++; /* go to the next available eventop */
|
||||
}
|
||||
asprintf( &help_msg,
|
||||
"Comma-delimited list of libevent subsystems "
|
||||
"to use (%s -- available on your platform)",
|
||||
available_eventops );
|
||||
mca_base_param_reg_string_name("opal", "event_include",
|
||||
help_msg, false, false,
|
||||
#ifdef __APPLE__
|
||||
"select",
|
||||
"select",
|
||||
#else
|
||||
# ifdef __WINDOWS__
|
||||
"win32",
|
||||
# else
|
||||
"poll",
|
||||
# endif
|
||||
#ifdef __WINDOWS__
|
||||
"win32",
|
||||
#else
|
||||
"poll",
|
||||
#endif
|
||||
&event_module_include);
|
||||
#endif
|
||||
&event_module_include);
|
||||
|
||||
OPAL_OUTPUT((debug_output, "event: available subsystems: %s",
|
||||
available_eventops));
|
||||
|
||||
free(help_msg); /* release the help message */
|
||||
|
||||
if (NULL == event_module_include) {
|
||||
/* Shouldn't happen, but... */
|
||||
event_module_include = strdup("select");
|
||||
}
|
||||
includes = opal_argv_split(event_module_include,',');
|
||||
free(event_module_include);
|
||||
|
||||
/* get a configuration object */
|
||||
config = event_config_new();
|
||||
/* cycle thru the available subsystems */
|
||||
for (i=0; NULL != modules[i]; i++) {
|
||||
/* if this module isn't included in the given ones,
|
||||
* then exclude it
|
||||
*/
|
||||
dumpit = true;
|
||||
for (j=0; NULL != includes[j]; j++) {
|
||||
if (0 == strcmp("all", includes[j]) ||
|
||||
0 == strcmp(modules[i], includes[j])) {
|
||||
dumpit = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (dumpit) {
|
||||
event_config_avoid_method(config, modules[i]);
|
||||
}
|
||||
}
|
||||
opal_argv_free(includes);
|
||||
opal_argv_free(modules);
|
||||
if (dumpit) {
|
||||
opal_output(0, "event: available subsystems: %s", available_eventops);
|
||||
}
|
||||
|
||||
free(help_msg); /* release the help message */
|
||||
|
||||
if (NULL == event_module_include) {
|
||||
/* Shouldn't happen, but... */
|
||||
event_module_include = strdup("select");
|
||||
}
|
||||
includes = opal_argv_split(event_module_include,',');
|
||||
free(event_module_include);
|
||||
|
||||
/* get a configuration object */
|
||||
config = event_config_new();
|
||||
/* cycle thru the available subsystems */
|
||||
for (i=0; NULL != modules[i]; i++) {
|
||||
/* if this module isn't included in the given ones,
|
||||
* then exclude it
|
||||
*/
|
||||
dumpit = true;
|
||||
for (j=0; NULL != includes[j]; j++) {
|
||||
if (0 == strcmp("all", includes[j]) ||
|
||||
0 == strcmp(modules[i], includes[j])) {
|
||||
dumpit = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (dumpit) {
|
||||
event_config_avoid_method(config, modules[i]);
|
||||
}
|
||||
}
|
||||
opal_argv_free(includes);
|
||||
opal_argv_free(modules);
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
static int finalize(void)
|
||||
{
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
static void set_debug_output(bool output)
|
||||
{
|
||||
event_set_debug_output(output);
|
||||
}
|
||||
|
||||
static int set(opal_event_base_t *evbase,
|
||||
opal_event_t *ev, int fd, short events,
|
||||
opal_event_callback_fn_t cbfunc, void *arg)
|
||||
{
|
||||
OPAL_OUTPUT((debug_output, "event: event set called"));
|
||||
return event_assign(ev->event, evbase->base, fd, events, cbfunc, arg);
|
||||
}
|
||||
|
||||
static int add(opal_event_t *ev, const struct timeval *tv)
|
||||
{
|
||||
OPAL_OUTPUT((debug_output, "event: event add called"));
|
||||
return event_add(ev->event, tv);
|
||||
}
|
||||
|
||||
int del(opal_event_t *ev)
|
||||
{
|
||||
OPAL_OUTPUT((debug_output, "event: event del called"));
|
||||
return event_del(ev->event);
|
||||
}
|
||||
|
||||
|
||||
/**** TIMER APIs ****/
|
||||
static opal_event_t* module_evtimer_new(opal_event_base_t *evbase,
|
||||
opal_event_callback_fn_t cbfunc, void *cbdata)
|
||||
{
|
||||
opal_event_t *tmp;
|
||||
|
||||
tmp = OBJ_NEW(opal_event_t);
|
||||
event_assign(tmp->event, evbase->base, -1, 0, cbfunc, cbdata);
|
||||
|
||||
OPAL_OUTPUT((debug_output, "event: timer event created"));
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static int module_evtimer_add(opal_event_t *ev, const struct timeval *tv)
|
||||
{
|
||||
OPAL_OUTPUT((debug_output, "event: timer event added"));
|
||||
return event_add(ev->event, tv);
|
||||
}
|
||||
|
||||
static void module_evtimer_set(opal_event_base_t *evbase,
|
||||
opal_event_t *ev,
|
||||
opal_event_callback_fn_t cbfunc, void *cbdata)
|
||||
{
|
||||
OPAL_OUTPUT((debug_output, "event: timer event set"));
|
||||
event_assign(ev->event, evbase->base, -1, 0, cbfunc, cbdata);
|
||||
}
|
||||
|
||||
static int module_evtimer_del(opal_event_t *ev)
|
||||
{
|
||||
OPAL_OUTPUT((debug_output, "event: timer event deleted"));
|
||||
return event_del(ev->event);
|
||||
}
|
||||
|
||||
static int module_evtimer_pending(opal_event_t *ev, struct timeval *tv)
|
||||
{
|
||||
return event_pending(ev->event, EV_TIMEOUT, tv);
|
||||
}
|
||||
|
||||
static int module_evtimer_initialized(opal_event_t *ev)
|
||||
{
|
||||
return event_initialized(ev->event);
|
||||
}
|
||||
|
||||
|
||||
/**** SIGNAL APIs ****/
|
||||
static int module_signal_add(opal_event_t *ev, struct timeval *tv)
|
||||
{
|
||||
OPAL_OUTPUT((debug_output, "event: signal event added"));
|
||||
return event_add(ev->event, tv);
|
||||
}
|
||||
|
||||
static int module_signal_set(opal_event_base_t *evbase,
|
||||
opal_event_t *ev, int fd, opal_event_callback_fn_t cbfunc, void *cbdata)
|
||||
{
|
||||
OPAL_OUTPUT((debug_output, "event: signal event set"));
|
||||
return event_assign(ev->event, evbase->base, fd, EV_SIGNAL|EV_PERSIST, cbfunc, cbdata);
|
||||
}
|
||||
|
||||
static int module_signal_del(opal_event_t *ev)
|
||||
{
|
||||
OPAL_OUTPUT((debug_output, "event: signal event deleted"));
|
||||
return event_del(ev->event);
|
||||
}
|
||||
|
||||
static int module_signal_pending(opal_event_t *ev, struct timeval *tv)
|
||||
{
|
||||
return event_pending(ev->event, EV_SIGNAL, tv);
|
||||
}
|
||||
|
||||
static int module_signal_initialized(opal_event_t *ev)
|
||||
{
|
||||
return event_initialized(ev->event);
|
||||
}
|
||||
|
||||
static int get_signal(opal_event_t *ev)
|
||||
{
|
||||
return event_get_signal(ev->event);
|
||||
}
|
||||
|
||||
static int loop(opal_event_base_t *evbase, int flags)
|
||||
{
|
||||
int rc;
|
||||
OPAL_OUTPUT((debug_output, "event: looping event library"));
|
||||
rc = event_base_loop(evbase->base, flags);
|
||||
|
||||
assert(rc >= 0);
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int dispatch(opal_event_base_t *evbase)
|
||||
{
|
||||
OPAL_OUTPUT((debug_output, "event: dispatching event library"));
|
||||
return event_base_loop(evbase->base, 0);
|
||||
}
|
||||
|
||||
|
@ -186,7 +186,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_event_base, opal_progress_event_flag);
|
||||
}
|
||||
|
||||
#else /* OPAL_PROGRESS_USE_TIMERS */
|
||||
@ -195,7 +195,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_event_base, opal_progress_event_flag);
|
||||
}
|
||||
#endif /* OPAL_PROGRESS_USE_TIMERS */
|
||||
|
||||
|
@ -77,8 +77,6 @@ static bool fifo_active=false;
|
||||
|
||||
static int init(void)
|
||||
{
|
||||
OBJ_CONSTRUCT(&attach, opal_event_t);
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
@ -89,10 +87,9 @@ static int init(void)
|
||||
void finalize(void)
|
||||
{
|
||||
if (fifo_active) {
|
||||
opal_event.del(&attach);
|
||||
opal_event_del(&attach);
|
||||
close(attach_fd);
|
||||
}
|
||||
OBJ_DESTRUCT(&attach);
|
||||
|
||||
if (MPIR_proctable) {
|
||||
free(MPIR_proctable);
|
||||
@ -156,8 +153,8 @@ void init_before_spawn(orte_job_t *jdata)
|
||||
attach_fifo);
|
||||
free(attach_fifo);
|
||||
fifo_active = true;
|
||||
opal_event.set(opal_event_base, &attach, attach_fd, OPAL_EV_READ, attach_debugger, NULL);
|
||||
opal_event.add(&attach, 0);
|
||||
opal_event_set(opal_event_base, &attach, attach_fd, OPAL_EV_READ, attach_debugger, NULL);
|
||||
opal_event_add(&attach, 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -230,8 +227,10 @@ static void attach_debugger(int fd, short event, void *arg)
|
||||
int rc;
|
||||
int32_t ljob;
|
||||
orte_job_t *jdata;
|
||||
#if 0
|
||||
struct timeval now;
|
||||
opal_event_t *check;
|
||||
#endif
|
||||
|
||||
if (!MPIR_being_debugged && !orte_debugger_base.test_attach) {
|
||||
/* false alarm */
|
||||
@ -254,7 +253,7 @@ static void attach_debugger(int fd, short event, void *arg)
|
||||
}
|
||||
#endif
|
||||
if (fifo_active) {
|
||||
opal_event.del(&attach);
|
||||
opal_event_del(&attach);
|
||||
fifo_active = false;
|
||||
#if 0
|
||||
read(attach_fd, &rc, sizeof(rc));
|
||||
@ -334,10 +333,10 @@ static void attach_debugger(int fd, short event, void *arg)
|
||||
check = (opal_event_t*)arg;
|
||||
now.tv_sec = orte_debugger_mpirx_check_rate;
|
||||
now.tv_usec = 0;
|
||||
opal_event.evtimer_add(check, &now);
|
||||
opal_event_evtimer_add(check, &now);
|
||||
} else {
|
||||
fifo_active = true;
|
||||
opal_event.add(&attach, 0);
|
||||
opal_event_add(&attach, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -167,7 +167,6 @@ int orte_errmgr_hnp_autor_global_module_init(void)
|
||||
"errmgr:hnp(autor):init()");
|
||||
|
||||
procs_pending_recovery = OBJ_NEW(opal_list_t);
|
||||
autor_timer_event = OBJ_NEW(opal_event_t);
|
||||
|
||||
current_global_jobid = ORTE_JOBID_INVALID;
|
||||
current_global_jobdata = NULL;
|
||||
@ -187,7 +186,7 @@ int orte_errmgr_hnp_autor_global_module_finalize(void)
|
||||
procs_pending_recovery = NULL;
|
||||
}
|
||||
if( NULL != autor_timer_event ) {
|
||||
OBJ_RELEASE(autor_timer_event);
|
||||
free(autor_timer_event);
|
||||
}
|
||||
|
||||
current_global_jobid = ORTE_JOBID_INVALID;
|
||||
@ -512,10 +511,10 @@ static void errmgr_autor_process_fault_app(orte_job_t *jdata,
|
||||
if( !autor_timer_active ) {
|
||||
autor_timer_active = true;
|
||||
|
||||
opal_event.evtimer_set(opal_event_base, autor_timer_event, errmgr_autor_recover_processes, NULL);
|
||||
opal_event_evtimer_set(opal_event_base, autor_timer_event, errmgr_autor_recover_processes, NULL);
|
||||
soon.tv_sec = mca_errmgr_hnp_component.autor_recovery_delay;
|
||||
soon.tv_usec = 0;
|
||||
opal_event.evtimer_add(autor_timer_event, &soon);
|
||||
opal_event_evtimer_add(autor_timer_event, &soon);
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -98,31 +98,26 @@ int orte_ess_base_orted_setup(char **hosts)
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
/* setup callback for SIGPIPE */
|
||||
OBJ_CONSTRUCT(&epipe_handler, opal_event_t);
|
||||
opal_event.signal_set(opal_event_base, &epipe_handler, SIGPIPE,
|
||||
opal_event_signal_set(opal_event_base, &epipe_handler, SIGPIPE,
|
||||
epipe_signal_callback, &epipe_handler);
|
||||
opal_event.signal_add(&epipe_handler, NULL);
|
||||
opal_event_signal_add(&epipe_handler, NULL);
|
||||
/* Set signal handlers to catch kill signals so we can properly clean up
|
||||
* after ourselves.
|
||||
*/
|
||||
OBJ_CONSTRUCT(&term_handler, opal_event_t);
|
||||
opal_event.set(opal_event_base, &term_handler, SIGTERM, OPAL_EV_SIGNAL,
|
||||
opal_event_set(opal_event_base, &term_handler, SIGTERM, OPAL_EV_SIGNAL,
|
||||
shutdown_signal, NULL);
|
||||
opal_event.add(&term_handler, NULL);
|
||||
OBJ_CONSTRUCT(&int_handler, opal_event_t);
|
||||
opal_event.set(opal_event_base, &int_handler, SIGINT, OPAL_EV_SIGNAL,
|
||||
opal_event_add(&term_handler, NULL);
|
||||
opal_event_set(opal_event_base, &int_handler, SIGINT, OPAL_EV_SIGNAL,
|
||||
shutdown_signal, NULL);
|
||||
opal_event.add(&int_handler, NULL);
|
||||
opal_event_add(&int_handler, NULL);
|
||||
|
||||
/** setup callbacks for signals we should ignore */
|
||||
OBJ_CONSTRUCT(&sigusr1_handler, opal_event_t);
|
||||
opal_event.signal_set(opal_event_base, &sigusr1_handler, SIGUSR1,
|
||||
opal_event_signal_set(opal_event_base, &sigusr1_handler, SIGUSR1,
|
||||
signal_callback, &sigusr1_handler);
|
||||
opal_event.signal_add(&sigusr1_handler, NULL);
|
||||
OBJ_CONSTRUCT(&sigusr2_handler, opal_event_t);
|
||||
opal_event.signal_set(opal_event_base, &sigusr2_handler, SIGUSR2,
|
||||
opal_event_signal_add(&sigusr1_handler, NULL);
|
||||
opal_event_signal_set(opal_event_base, &sigusr2_handler, SIGUSR2,
|
||||
signal_callback, &sigusr2_handler);
|
||||
opal_event.signal_add(&sigusr2_handler, NULL);
|
||||
opal_event_signal_add(&sigusr2_handler, NULL);
|
||||
#endif /* __WINDOWS__ */
|
||||
|
||||
signals_set = true;
|
||||
@ -536,17 +531,12 @@ int orte_ess_base_orted_finalize(void)
|
||||
|
||||
if (signals_set) {
|
||||
/* Release all local signal handlers */
|
||||
opal_event.del(&epipe_handler);
|
||||
OBJ_DESTRUCT(&epipe_handler);
|
||||
opal_event.del(&term_handler);
|
||||
OBJ_DESTRUCT(&term_handler);
|
||||
opal_event.del(&int_handler);
|
||||
OBJ_DESTRUCT(&int_handler);
|
||||
opal_event_del(&epipe_handler);
|
||||
opal_event_del(&term_handler);
|
||||
opal_event_del(&int_handler);
|
||||
#ifndef __WINDOWS__
|
||||
opal_event.signal_del(&sigusr1_handler);
|
||||
OBJ_DESTRUCT(&sigusr1_handler);
|
||||
opal_event.signal_del(&sigusr2_handler);
|
||||
OBJ_DESTRUCT(&sigusr2_handler);
|
||||
opal_event_signal_del(&sigusr1_handler);
|
||||
opal_event_signal_del(&sigusr2_handler);
|
||||
#endif /* __WINDOWS__ */
|
||||
}
|
||||
|
||||
|
@ -148,41 +148,34 @@ static int rte_init(void)
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
/* setup callback for SIGPIPE */
|
||||
OBJ_CONSTRUCT(&epipe_handler, opal_event_t);
|
||||
opal_event.signal_set(opal_event_base, &epipe_handler, SIGPIPE,
|
||||
opal_event_signal_set(opal_event_base, &epipe_handler, SIGPIPE,
|
||||
epipe_signal_callback, &epipe_handler);
|
||||
opal_event.signal_add(&epipe_handler, NULL);
|
||||
opal_event_signal_add(&epipe_handler, NULL);
|
||||
/** setup callbacks for abort signals - from this point
|
||||
* forward, we need to abort in a manner that allows us
|
||||
* to cleanup
|
||||
*/
|
||||
OBJ_CONSTRUCT(&term_handler, opal_event_t);
|
||||
opal_event.signal_set(opal_event_base, &term_handler, SIGTERM,
|
||||
opal_event_signal_set(opal_event_base, &term_handler, SIGTERM,
|
||||
abort_signal_callback, &term_handler);
|
||||
opal_event.signal_add(&term_handler, NULL);
|
||||
OBJ_CONSTRUCT(&int_handler, opal_event_t);
|
||||
opal_event.signal_set(opal_event_base, &int_handler, SIGINT,
|
||||
opal_event_signal_add(&term_handler, NULL);
|
||||
opal_event_signal_set(opal_event_base, &int_handler, SIGINT,
|
||||
abort_signal_callback, &int_handler);
|
||||
opal_event.signal_add(&int_handler, NULL);
|
||||
opal_event_signal_add(&int_handler, NULL);
|
||||
|
||||
/** setup callbacks for signals we should foward */
|
||||
OBJ_CONSTRUCT(&sigusr1_handler, opal_event_t);
|
||||
opal_event.signal_set(opal_event_base, &sigusr1_handler, SIGUSR1,
|
||||
opal_event_signal_set(opal_event_base, &sigusr1_handler, SIGUSR1,
|
||||
signal_forward_callback, &sigusr1_handler);
|
||||
opal_event.signal_add(&sigusr1_handler, NULL);
|
||||
OBJ_CONSTRUCT(&sigusr2_handler, opal_event_t);
|
||||
opal_event.signal_set(opal_event_base, &sigusr2_handler, SIGUSR2,
|
||||
opal_event_signal_add(&sigusr1_handler, NULL);
|
||||
opal_event_signal_set(opal_event_base, &sigusr2_handler, SIGUSR2,
|
||||
signal_forward_callback, &sigusr2_handler);
|
||||
opal_event.signal_add(&sigusr2_handler, NULL);
|
||||
opal_event_signal_add(&sigusr2_handler, NULL);
|
||||
if (orte_forward_job_control) {
|
||||
OBJ_CONSTRUCT(&sigtstp_handler, opal_event_t);
|
||||
opal_event.signal_set(opal_event_base, &sigtstp_handler, SIGTSTP,
|
||||
opal_event_signal_set(opal_event_base, &sigtstp_handler, SIGTSTP,
|
||||
signal_forward_callback, &sigtstp_handler);
|
||||
opal_event.signal_add(&sigtstp_handler, NULL);
|
||||
OBJ_CONSTRUCT(&sigcont_handler, opal_event_t);
|
||||
opal_event.signal_set(opal_event_base, &sigcont_handler, SIGCONT,
|
||||
opal_event_signal_add(&sigtstp_handler, NULL);
|
||||
opal_event_signal_set(opal_event_base, &sigcont_handler, SIGCONT,
|
||||
signal_forward_callback, &sigcont_handler);
|
||||
opal_event.signal_add(&sigcont_handler, NULL);
|
||||
opal_event_signal_add(&sigcont_handler, NULL);
|
||||
}
|
||||
#endif /* __WINDOWS__ */
|
||||
|
||||
@ -681,24 +674,17 @@ static int rte_finalize(void)
|
||||
|
||||
if (signals_set) {
|
||||
/* Remove the epipe handler */
|
||||
opal_event.signal_del(&epipe_handler);
|
||||
OBJ_DESTRUCT(&epipe_handler);
|
||||
opal_event_signal_del(&epipe_handler);
|
||||
/* Remove the TERM and INT signal handlers */
|
||||
opal_event.signal_del(&term_handler);
|
||||
OBJ_DESTRUCT(&term_handler);
|
||||
opal_event.signal_del(&int_handler);
|
||||
OBJ_DESTRUCT(&int_handler);
|
||||
opal_event_signal_del(&term_handler);
|
||||
opal_event_signal_del(&int_handler);
|
||||
#ifndef __WINDOWS__
|
||||
/** Remove the USR signal handlers */
|
||||
opal_event.signal_del(&sigusr1_handler);
|
||||
OBJ_DESTRUCT(&sigusr1_handler);
|
||||
opal_event.signal_del(&sigusr2_handler);
|
||||
OBJ_DESTRUCT(&sigusr2_handler);
|
||||
opal_event_signal_del(&sigusr1_handler);
|
||||
opal_event_signal_del(&sigusr2_handler);
|
||||
if (orte_forward_job_control) {
|
||||
opal_event.signal_del(&sigtstp_handler);
|
||||
OBJ_DESTRUCT(&sigtstp_handler);
|
||||
opal_event.signal_del(&sigcont_handler);
|
||||
OBJ_DESTRUCT(&sigcont_handler);
|
||||
opal_event_signal_del(&sigtstp_handler);
|
||||
opal_event_signal_del(&sigcont_handler);
|
||||
}
|
||||
#endif /* __WINDOWS__ */
|
||||
signals_set = false;
|
||||
|
@ -138,7 +138,7 @@ typedef struct orte_iof_base_t orte_iof_base_t;
|
||||
ep->tag = (tg); \
|
||||
if (0 <= (fid)) { \
|
||||
ep->wev->fd = (fid); \
|
||||
opal_event.set(opal_event_base, \
|
||||
opal_event_set(opal_event_base, \
|
||||
&(ep->wev->ev), ep->wev->fd, \
|
||||
OPAL_EV_WRITE, \
|
||||
wrthndlr, ep); \
|
||||
@ -173,13 +173,13 @@ typedef struct orte_iof_base_t orte_iof_base_t;
|
||||
*(rv) = rev; \
|
||||
rev->file = strdup(__FILE__); \
|
||||
rev->line = __LINE__; \
|
||||
opal_event.set(opal_event_base, \
|
||||
opal_event_set(opal_event_base, \
|
||||
&rev->ev, (fid), \
|
||||
OPAL_EV_READ, \
|
||||
(cbfunc), rev); \
|
||||
if ((actv)) { \
|
||||
rev->active = true; \
|
||||
opal_event.add(&rev->ev, 0); \
|
||||
opal_event_add(&rev->ev, 0); \
|
||||
} \
|
||||
} while(0);
|
||||
|
||||
@ -195,7 +195,7 @@ typedef struct orte_iof_base_t orte_iof_base_t;
|
||||
ep->tag = (tg); \
|
||||
if (0 <= (fid)) { \
|
||||
ep->wev->fd = (fid); \
|
||||
opal_event.set(opal_event_base, \
|
||||
opal_event_set(opal_event_base, \
|
||||
&(ep->wev->ev), ep->wev->fd, \
|
||||
OPAL_EV_WRITE, \
|
||||
wrthndlr, ep); \
|
||||
@ -214,13 +214,13 @@ typedef struct orte_iof_base_t orte_iof_base_t;
|
||||
rev->name.vpid = (nm)->vpid; \
|
||||
rev->tag = (tg); \
|
||||
*(rv) = rev; \
|
||||
opal_event.set(opal_event_base, \
|
||||
opal_event_set(opal_event_base, \
|
||||
&rev->ev, (fid), \
|
||||
OPAL_EV_READ, \
|
||||
(cbfunc), rev); \
|
||||
if ((actv)) { \
|
||||
rev->active = true; \
|
||||
opal_event.add(&rev->ev, 0); \
|
||||
opal_event_add(&rev->ev, 0); \
|
||||
} \
|
||||
} while(0);
|
||||
|
||||
|
@ -111,12 +111,10 @@ OBJ_CLASS_INSTANCE(orte_iof_sink_t,
|
||||
|
||||
static void orte_iof_base_read_event_construct(orte_iof_read_event_t* rev)
|
||||
{
|
||||
OBJ_CONSTRUCT(&rev->ev, opal_event_t);
|
||||
}
|
||||
static void orte_iof_base_read_event_destruct(orte_iof_read_event_t* rev)
|
||||
{
|
||||
opal_event.del(&rev->ev);
|
||||
OBJ_DESTRUCT(&rev->ev);
|
||||
opal_event_del(&rev->ev);
|
||||
if (0 <= rev->fd) {
|
||||
OPAL_OUTPUT_VERBOSE((20, orte_iof_base.iof_output,
|
||||
"%s iof: closing fd %d for process %s",
|
||||
@ -135,13 +133,11 @@ static void orte_iof_base_write_event_construct(orte_iof_write_event_t* wev)
|
||||
wev->pending = false;
|
||||
wev->fd = -1;
|
||||
OBJ_CONSTRUCT(&wev->outputs, opal_list_t);
|
||||
OBJ_CONSTRUCT(&wev->ev, opal_event_t);
|
||||
}
|
||||
static void orte_iof_base_write_event_destruct(orte_iof_write_event_t* wev)
|
||||
{
|
||||
if (wev->pending) {
|
||||
opal_event.del(&wev->ev);
|
||||
OBJ_DESTRUCT(&wev->ev);
|
||||
opal_event_del(&wev->ev);
|
||||
}
|
||||
if (ORTE_PROC_IS_HNP) {
|
||||
int xmlfd = fileno(orte_xml_fp);
|
||||
|
@ -267,7 +267,7 @@ process:
|
||||
OPAL_OUTPUT_VERBOSE((1, orte_iof_base.iof_output,
|
||||
"%s write:output adding write event",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
||||
opal_event.add(&channel->ev, 0);
|
||||
opal_event_add(&channel->ev, 0);
|
||||
channel->pending = true;
|
||||
}
|
||||
|
||||
@ -323,7 +323,7 @@ void orte_iof_base_write_handler(int fd, short event, void *cbdata)
|
||||
OBJ_RELEASE(output);
|
||||
}
|
||||
ABORT:
|
||||
opal_event.del(&wev->ev);
|
||||
opal_event_del(&wev->ev);
|
||||
wev->pending = false;
|
||||
|
||||
DEPART:
|
||||
|
@ -91,9 +91,6 @@ static int init(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
/* setup the stdin signal event */
|
||||
OBJ_CONSTRUCT(&mca_iof_hnp_component.stdinsig, opal_event_t);
|
||||
|
||||
/* post non-blocking recv to catch forwarded IO from
|
||||
* the orteds
|
||||
*/
|
||||
@ -247,11 +244,11 @@ static int hnp_push(const orte_process_name_t* dst_name, orte_iof_tag_t src_tag,
|
||||
*/
|
||||
if (NULL != proct->revstdout && NULL != proct->revstderr && NULL != proct->revstddiag) {
|
||||
proct->revstdout->active = true;
|
||||
opal_event.add(&(proct->revstdout->ev), 0);
|
||||
opal_event_add(&(proct->revstdout->ev), 0);
|
||||
proct->revstderr->active = true;
|
||||
opal_event.add(&(proct->revstderr->ev), 0);
|
||||
opal_event_add(&(proct->revstderr->ev), 0);
|
||||
proct->revstddiag->active = true;
|
||||
opal_event.add(&(proct->revstddiag->ev), 0);
|
||||
opal_event_add(&(proct->revstddiag->ev), 0);
|
||||
}
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
@ -313,7 +310,7 @@ static int hnp_push(const orte_process_name_t* dst_name, orte_iof_tag_t src_tag,
|
||||
* filedescriptor is not a tty, don't worry about it
|
||||
* and always stay connected.
|
||||
*/
|
||||
opal_event.signal_set(opal_event_base, &mca_iof_hnp_component.stdinsig,
|
||||
opal_event_signal_set(opal_event_base, &mca_iof_hnp_component.stdinsig,
|
||||
SIGCONT, orte_iof_hnp_stdin_cb,
|
||||
NULL);
|
||||
|
||||
@ -332,7 +329,7 @@ static int hnp_push(const orte_process_name_t* dst_name, orte_iof_tag_t src_tag,
|
||||
*/
|
||||
if (!(src_tag & ORTE_IOF_STDIN) || orte_iof_hnp_stdin_check(fd)) {
|
||||
mca_iof_hnp_component.stdinev->active = true;
|
||||
if (OPAL_SUCCESS != (rc = opal_event.add(&(mca_iof_hnp_component.stdinev->ev), 0))) {
|
||||
if (OPAL_SUCCESS != (rc = opal_event_add(&(mca_iof_hnp_component.stdinev->ev), 0))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
}
|
||||
}
|
||||
@ -477,8 +474,7 @@ static int finalize(void)
|
||||
/* if the stdin event is active, delete it */
|
||||
if (NULL != mca_iof_hnp_component.stdinev) {
|
||||
OBJ_RELEASE(mca_iof_hnp_component.stdinev);
|
||||
opal_event.signal_del(&mca_iof_hnp_component.stdinsig);
|
||||
OBJ_DESTRUCT(&mca_iof_hnp_component.stdinsig);
|
||||
opal_event_signal_del(&mca_iof_hnp_component.stdinsig);
|
||||
}
|
||||
/* cleanout all registered sinks */
|
||||
while ((item = opal_list_remove_first(&mca_iof_hnp_component.sinks)) != NULL) {
|
||||
@ -560,7 +556,7 @@ static void stdin_write_handler(int fd, short event, void *cbdata)
|
||||
* when the fd is ready.
|
||||
*/
|
||||
wev->pending = true;
|
||||
opal_event.add(&wev->ev, 0);
|
||||
opal_event_add(&wev->ev, 0);
|
||||
goto CHECK;
|
||||
}
|
||||
/* otherwise, something bad happened so all we can do is declare an
|
||||
@ -585,7 +581,7 @@ static void stdin_write_handler(int fd, short event, void *cbdata)
|
||||
* when the fd is ready.
|
||||
*/
|
||||
wev->pending = true;
|
||||
opal_event.add(&wev->ev, 0);
|
||||
opal_event_add(&wev->ev, 0);
|
||||
goto CHECK;
|
||||
}
|
||||
OBJ_RELEASE(output);
|
||||
@ -612,7 +608,7 @@ CHECK:
|
||||
OPAL_OUTPUT_VERBOSE((1, orte_iof_base.iof_output,
|
||||
"restarting read event"));
|
||||
mca_iof_hnp_component.stdinev->active = true;
|
||||
opal_event.add(&(mca_iof_hnp_component.stdinev->ev), 0);
|
||||
opal_event_add(&(mca_iof_hnp_component.stdinev->ev), 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ static void restart_stdin(int fd, short event, void *cbdata)
|
||||
if (NULL != mca_iof_hnp_component.stdinev &&
|
||||
!orte_job_term_ordered) {
|
||||
mca_iof_hnp_component.stdinev->active = true;
|
||||
opal_event.add(&(mca_iof_hnp_component.stdinev->ev), 0);
|
||||
opal_event_add(&(mca_iof_hnp_component.stdinev->ev), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,9 +71,9 @@ void orte_iof_hnp_stdin_cb(int fd, short event, void *cbdata)
|
||||
|
||||
if (should_process) {
|
||||
mca_iof_hnp_component.stdinev->active = true;
|
||||
opal_event.add(&(mca_iof_hnp_component.stdinev->ev), 0);
|
||||
opal_event_add(&(mca_iof_hnp_component.stdinev->ev), 0);
|
||||
} else {
|
||||
opal_event.del(&(mca_iof_hnp_component.stdinev->ev));
|
||||
opal_event_del(&(mca_iof_hnp_component.stdinev->ev));
|
||||
mca_iof_hnp_component.stdinev->active = false;
|
||||
}
|
||||
}
|
||||
@ -109,7 +109,7 @@ void orte_iof_hnp_read_local_handler(int fd, short event, void *cbdata)
|
||||
|
||||
/* non-blocking, retry */
|
||||
if (EAGAIN == errno || EINTR == errno) {
|
||||
opal_event.add(&rev->ev, 0);
|
||||
opal_event_add(&rev->ev, 0);
|
||||
OPAL_THREAD_UNLOCK(&mca_iof_hnp_component.lock);
|
||||
return;
|
||||
}
|
||||
@ -335,7 +335,7 @@ void orte_iof_hnp_read_local_handler(int fd, short event, void *cbdata)
|
||||
}
|
||||
|
||||
/* re-add the event */
|
||||
opal_event.add(&rev->ev, 0);
|
||||
opal_event_add(&rev->ev, 0);
|
||||
|
||||
OPAL_THREAD_UNLOCK(&mca_iof_hnp_component.lock);
|
||||
return;
|
||||
|
@ -74,14 +74,14 @@ static void process_msg(int fd, short event, void *cbdata)
|
||||
!orte_job_term_ordered &&
|
||||
!mca_iof_hnp_component.stdinev->active) {
|
||||
mca_iof_hnp_component.stdinev->active = true;
|
||||
opal_event.add(&(mca_iof_hnp_component.stdinev->ev), 0);
|
||||
opal_event_add(&(mca_iof_hnp_component.stdinev->ev), 0);
|
||||
}
|
||||
goto CLEAN_RETURN;
|
||||
} else if (ORTE_IOF_XOFF & stream) {
|
||||
/* stop the stdin read event */
|
||||
if (NULL != mca_iof_hnp_component.stdinev &&
|
||||
!mca_iof_hnp_component.stdinev->active) {
|
||||
opal_event.del(&(mca_iof_hnp_component.stdinev->ev));
|
||||
opal_event_del(&(mca_iof_hnp_component.stdinev->ev));
|
||||
mca_iof_hnp_component.stdinev->active = false;
|
||||
}
|
||||
goto CLEAN_RETURN;
|
||||
|
@ -220,11 +220,11 @@ SETUP:
|
||||
*/
|
||||
if (NULL != proct->revstdout && NULL != proct->revstderr && NULL != proct->revstddiag) {
|
||||
proct->revstdout->active = true;
|
||||
opal_event.add(&(proct->revstdout->ev), 0);
|
||||
opal_event_add(&(proct->revstdout->ev), 0);
|
||||
proct->revstderr->active = true;
|
||||
opal_event.add(&(proct->revstderr->ev), 0);
|
||||
opal_event_add(&(proct->revstderr->ev), 0);
|
||||
proct->revstddiag->active = true;
|
||||
opal_event.add(&(proct->revstddiag->ev), 0);
|
||||
opal_event_add(&(proct->revstddiag->ev), 0);
|
||||
}
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
@ -385,7 +385,7 @@ static void stdin_write_handler(int fd, short event, void *cbdata)
|
||||
* when the fd is ready.
|
||||
*/
|
||||
wev->pending = true;
|
||||
opal_event.add(&wev->ev, 0);
|
||||
opal_event_add(&wev->ev, 0);
|
||||
goto CHECK;
|
||||
}
|
||||
/* otherwise, something bad happened so all we can do is declare an
|
||||
@ -415,7 +415,7 @@ static void stdin_write_handler(int fd, short event, void *cbdata)
|
||||
* when the fd is ready.
|
||||
*/
|
||||
wev->pending = true;
|
||||
opal_event.add(&wev->ev, 0);
|
||||
opal_event_add(&wev->ev, 0);
|
||||
goto CHECK;
|
||||
}
|
||||
OBJ_RELEASE(output);
|
||||
|
@ -90,7 +90,7 @@ void orte_iof_orted_read_handler(int fd, short event, void *cbdata)
|
||||
/* either we have a connection error or it was a non-blocking read */
|
||||
if (EAGAIN == errno || EINTR == errno) {
|
||||
/* non-blocking, retry */
|
||||
opal_event.add(&rev->ev, 0);
|
||||
opal_event_add(&rev->ev, 0);
|
||||
OPAL_THREAD_UNLOCK(&mca_iof_orted_component.lock);
|
||||
return;
|
||||
}
|
||||
@ -164,7 +164,7 @@ void orte_iof_orted_read_handler(int fd, short event, void *cbdata)
|
||||
|
||||
RESTART:
|
||||
/* re-add the event */
|
||||
opal_event.add(&rev->ev, 0);
|
||||
opal_event_add(&rev->ev, 0);
|
||||
|
||||
OPAL_THREAD_UNLOCK(&mca_iof_orted_component.lock);
|
||||
return;
|
||||
|
@ -76,7 +76,6 @@ typedef struct mca_oob_tcp_event_t mca_oob_tcp_event_t;
|
||||
static void mca_oob_tcp_event_construct(mca_oob_tcp_event_t* event)
|
||||
{
|
||||
OPAL_THREAD_LOCK(&mca_oob_tcp_component.tcp_lock);
|
||||
OBJ_CONSTRUCT(&event->event, opal_event_t);
|
||||
opal_list_append(&mca_oob_tcp_component.tcp_events, &event->item);
|
||||
OPAL_THREAD_UNLOCK(&mca_oob_tcp_component.tcp_lock);
|
||||
}
|
||||
@ -85,7 +84,6 @@ static void mca_oob_tcp_event_destruct(mca_oob_tcp_event_t* event)
|
||||
{
|
||||
OPAL_THREAD_LOCK(&mca_oob_tcp_component.tcp_lock);
|
||||
opal_list_remove_item(&mca_oob_tcp_component.tcp_events, &event->item);
|
||||
OBJ_DESTRUCT(&event->event);
|
||||
OPAL_THREAD_UNLOCK(&mca_oob_tcp_component.tcp_lock);
|
||||
}
|
||||
|
||||
@ -484,8 +482,8 @@ mca_oob_tcp_create_connection(const int accepted_fd,
|
||||
|
||||
/* wait for receipt of peers process identifier to complete this connection */
|
||||
event = OBJ_NEW(mca_oob_tcp_event_t);
|
||||
opal_event.set(opal_event_base, &event->event, accepted_fd, OPAL_EV_READ, mca_oob_tcp_recv_handler, event);
|
||||
opal_event.add(&event->event, 0);
|
||||
opal_event_set(opal_event_base, &event->event, accepted_fd, OPAL_EV_READ, mca_oob_tcp_recv_handler, event);
|
||||
opal_event_add(&event->event, 0);
|
||||
}
|
||||
|
||||
|
||||
@ -1082,16 +1080,16 @@ mca_oob_tcp_accept_thread_handler(int sd, short flags, void* user)
|
||||
tv.tv_sec = mca_oob_tcp_component.tcp_listen_thread_tv.tv_sec;
|
||||
tv.tv_usec = mca_oob_tcp_component.tcp_listen_thread_tv.tv_usec;
|
||||
#ifdef HAVE_PIPE
|
||||
opal_event.set(opal_event_base, &mca_oob_tcp_component.tcp_listen_thread_event,
|
||||
opal_event_set(opal_event_base, &mca_oob_tcp_component.tcp_listen_thread_event,
|
||||
mca_oob_tcp_component.tcp_connections_pipe[0],
|
||||
OPAL_EV_READ,
|
||||
mca_oob_tcp_accept_thread_handler, NULL);
|
||||
#else
|
||||
opal_event.set(opal_event_base, &mca_oob_tcp_component.tcp_listen_thread_event,
|
||||
opal_event_set(opal_event_base, &mca_oob_tcp_component.tcp_listen_thread_event,
|
||||
-1, 0,
|
||||
mca_oob_tcp_accept_thread_handler, NULL);
|
||||
#endif
|
||||
opal_event.add(&mca_oob_tcp_component.tcp_listen_thread_event, &tv);
|
||||
opal_event_add(&mca_oob_tcp_component.tcp_listen_thread_event, &tv);
|
||||
}
|
||||
|
||||
|
||||
@ -1118,16 +1116,16 @@ mca_oob_tcp_create_listen_thread(void)
|
||||
tv.tv_sec = mca_oob_tcp_component.tcp_listen_thread_tv.tv_sec;
|
||||
tv.tv_usec = mca_oob_tcp_component.tcp_listen_thread_tv.tv_usec;
|
||||
#ifdef HAVE_PIPE
|
||||
opal_event.set(opal_event_base, &mca_oob_tcp_component.tcp_listen_thread_event,
|
||||
opal_event_set(opal_event_base, &mca_oob_tcp_component.tcp_listen_thread_event,
|
||||
mca_oob_tcp_component.tcp_connections_pipe[0],
|
||||
OPAL_EV_READ,
|
||||
mca_oob_tcp_accept_thread_handler, NULL);
|
||||
#else
|
||||
opal_event.set(opal_event_base, &mca_oob_tcp_component.tcp_listen_thread_event,
|
||||
opal_event_set(opal_event_base, &mca_oob_tcp_component.tcp_listen_thread_event,
|
||||
-1, 0,
|
||||
mca_oob_tcp_accept_thread_handler, NULL);
|
||||
#endif
|
||||
opal_event.add(&mca_oob_tcp_component.tcp_listen_thread_event, &tv);
|
||||
opal_event_add(&mca_oob_tcp_component.tcp_listen_thread_event, &tv);
|
||||
|
||||
return opal_thread_start(&mca_oob_tcp_component.tcp_listen_thread);
|
||||
}
|
||||
@ -1392,12 +1390,12 @@ mca_oob_t* mca_oob_tcp_component_init(int* priority)
|
||||
-1, /* maximum number */
|
||||
8); /* increment to grow by */
|
||||
|
||||
/* intialize event library */
|
||||
OBJ_CONSTRUCT(&mca_oob_tcp_component.tcp_recv_event, opal_event_t);
|
||||
OBJ_CONSTRUCT(&mca_oob_tcp_component.tcp_listen_thread_event, opal_event_t);
|
||||
|
||||
/* intialize event library */
|
||||
memset(&mca_oob_tcp_component.tcp_recv_event, 0, sizeof(opal_event_t));
|
||||
memset(&mca_oob_tcp_component.tcp_listen_thread_event, 0, sizeof(opal_event_t));
|
||||
#if OPAL_WANT_IPV6
|
||||
OBJ_CONSTRUCT(&mca_oob_tcp_component.tcp6_recv_event, opal_event_t);
|
||||
memset(&mca_oob_tcp_component.tcp6_recv_event, 0, sizeof(opal_event_t));
|
||||
#endif /* OPAL_WANT_IPV6 */
|
||||
return &mca_oob_tcp;
|
||||
}
|
||||
@ -1590,12 +1588,12 @@ int mca_oob_tcp_init(void)
|
||||
mca_oob_tcp_component.tcp_listen_thread_sds[idx] =
|
||||
mca_oob_tcp_component.tcp_listen_sd;
|
||||
} else {
|
||||
opal_event.set(opal_event_base, &mca_oob_tcp_component.tcp_recv_event,
|
||||
opal_event_set(opal_event_base, &mca_oob_tcp_component.tcp_recv_event,
|
||||
mca_oob_tcp_component.tcp_listen_sd,
|
||||
OPAL_EV_READ|OPAL_EV_PERSIST,
|
||||
mca_oob_tcp_recv_handler,
|
||||
0);
|
||||
opal_event.add(&mca_oob_tcp_component.tcp_recv_event, 0);
|
||||
opal_event_add(&mca_oob_tcp_component.tcp_recv_event, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1622,12 +1620,12 @@ int mca_oob_tcp_init(void)
|
||||
mca_oob_tcp_component.tcp_listen_thread_sds[idx] =
|
||||
mca_oob_tcp_component.tcp6_listen_sd;
|
||||
} else {
|
||||
opal_event.set(opal_event_base, &mca_oob_tcp_component.tcp6_recv_event,
|
||||
opal_event_set(opal_event_base, &mca_oob_tcp_component.tcp6_recv_event,
|
||||
mca_oob_tcp_component.tcp6_listen_sd,
|
||||
OPAL_EV_READ|OPAL_EV_PERSIST,
|
||||
mca_oob_tcp_recv_handler,
|
||||
0);
|
||||
opal_event.add(&mca_oob_tcp_component.tcp6_recv_event, 0);
|
||||
opal_event_add(&mca_oob_tcp_component.tcp6_recv_event, 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -1674,23 +1672,20 @@ int mca_oob_tcp_fini(void)
|
||||
|
||||
OPAL_THREAD_LOCK(&mca_oob_tcp_component.tcp_lock);
|
||||
#if 0
|
||||
opal_event.disable(); /* disable event processing */
|
||||
opal_event_disable(); /* disable event processing */
|
||||
#endif
|
||||
/* shut down the listening system */
|
||||
if (OOB_TCP_LISTEN_THREAD == mca_oob_tcp_component.tcp_listen_type) {
|
||||
mca_oob_tcp_component.tcp_shutdown = true;
|
||||
opal_thread_join(&mca_oob_tcp_component.tcp_listen_thread, &data);
|
||||
opal_event.del(&mca_oob_tcp_component.tcp_listen_thread_event);
|
||||
OBJ_DESTRUCT(&mca_oob_tcp_component.tcp_listen_thread_event);
|
||||
opal_event_del(&mca_oob_tcp_component.tcp_listen_thread_event);
|
||||
} else {
|
||||
if (mca_oob_tcp_component.tcp_listen_sd >= 0) {
|
||||
opal_event.del(&mca_oob_tcp_component.tcp_recv_event);
|
||||
OBJ_DESTRUCT(&mca_oob_tcp_component.tcp_recv_event);
|
||||
opal_event_del(&mca_oob_tcp_component.tcp_recv_event);
|
||||
}
|
||||
#if OPAL_WANT_IPV6
|
||||
if (mca_oob_tcp_component.tcp6_listen_sd >= 0) {
|
||||
opal_event.del(&mca_oob_tcp_component.tcp6_recv_event);
|
||||
OBJ_DESTRUCT(&mca_oob_tcp_component.tcp6_recv_event);
|
||||
opal_event_del(&mca_oob_tcp_component.tcp6_recv_event);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -1720,7 +1715,7 @@ int mca_oob_tcp_fini(void)
|
||||
item != opal_list_get_end(&mca_oob_tcp_component.tcp_events);
|
||||
item = opal_list_get_first(&mca_oob_tcp_component.tcp_events) ) {
|
||||
mca_oob_tcp_event_t* event = (mca_oob_tcp_event_t*)item;
|
||||
opal_event.del(&event->event);
|
||||
opal_event_del(&event->event);
|
||||
OBJ_RELEASE(event);
|
||||
}
|
||||
|
||||
@ -1984,7 +1979,7 @@ int mca_oob_tcp_ft_event(int state) {
|
||||
* Disable event processing while we are working
|
||||
*/
|
||||
OPAL_THREAD_LOCK(&mca_oob_tcp_component.tcp_lock);
|
||||
opal_event.disable();
|
||||
opal_event_disable();
|
||||
OPAL_THREAD_UNLOCK(&mca_oob_tcp_component.tcp_lock);
|
||||
#endif
|
||||
}
|
||||
@ -1994,7 +1989,7 @@ int mca_oob_tcp_ft_event(int state) {
|
||||
* Resume event processing
|
||||
*/
|
||||
OPAL_THREAD_LOCK(&mca_oob_tcp_component.tcp_lock);
|
||||
opal_event.enable();
|
||||
opal_event_enable();
|
||||
OPAL_THREAD_UNLOCK(&mca_oob_tcp_component.tcp_lock);
|
||||
#endif
|
||||
}
|
||||
@ -2029,7 +2024,7 @@ int mca_oob_tcp_ft_event(int state) {
|
||||
* Resume event processing
|
||||
*/
|
||||
#if 0
|
||||
opal_event.enable();
|
||||
opal_event_enable();
|
||||
#endif
|
||||
OPAL_THREAD_UNLOCK(&mca_oob_tcp_component.tcp_lock);
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ int mca_oob_tcp_msg_wait(mca_oob_tcp_msg_t* msg, int* rc)
|
||||
if(opal_event_progress_thread()) {
|
||||
int rc;
|
||||
OPAL_THREAD_UNLOCK(&msg->msg_lock);
|
||||
rc = opal_event.loop(opal_event_base, OPAL_EVLOOP_ONCE);
|
||||
rc = opal_event_loop(opal_event_base, OPAL_EVLOOP_ONCE);
|
||||
assert(rc >= 0);
|
||||
OPAL_THREAD_LOCK(&msg->msg_lock);
|
||||
} else {
|
||||
@ -112,7 +112,7 @@ int mca_oob_tcp_msg_wait(mca_oob_tcp_msg_t* msg, int* rc)
|
||||
library, as EVLOOP_ONCE may block for a short period of
|
||||
time. */
|
||||
opal_progress();
|
||||
opal_event.loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
opal_event_loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
OPAL_CR_TEST_CHECKPOINT_READY();
|
||||
}
|
||||
#endif
|
||||
@ -146,7 +146,7 @@ int mca_oob_tcp_msg_timedwait(mca_oob_tcp_msg_t* msg, int* rc, struct timespec*
|
||||
if(opal_event_progress_thread()) {
|
||||
int rc;
|
||||
OPAL_THREAD_UNLOCK(&msg->msg_lock);
|
||||
rc = opal_event.loop(opal_event_base, OPAL_EVLOOP_ONCE);
|
||||
rc = opal_event_loop(opal_event_base, OPAL_EVLOOP_ONCE);
|
||||
assert(rc >= 0);
|
||||
OPAL_THREAD_LOCK(&msg->msg_lock);
|
||||
} else {
|
||||
@ -162,7 +162,7 @@ int mca_oob_tcp_msg_timedwait(mca_oob_tcp_msg_t* msg, int* rc, struct timespec*
|
||||
((uint32_t)tv.tv_sec == secs && (uint32_t)tv.tv_usec < usecs))) {
|
||||
/* see comment in tcp_msg_wait, above */
|
||||
opal_progress();
|
||||
opal_event.loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
opal_event_loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
gettimeofday(&tv,NULL);
|
||||
}
|
||||
#endif
|
||||
|
@ -101,12 +101,12 @@ static void mca_oob_tcp_peer_construct(mca_oob_tcp_peer_t* peer)
|
||||
{
|
||||
OBJ_CONSTRUCT(&(peer->peer_send_queue), opal_list_t);
|
||||
OBJ_CONSTRUCT(&(peer->peer_lock), opal_mutex_t);
|
||||
OBJ_CONSTRUCT(&peer->peer_send_event, opal_event_t);
|
||||
OBJ_CONSTRUCT(&peer->peer_recv_event, opal_event_t);
|
||||
memset(&peer->peer_send_event, 0, sizeof(peer->peer_send_event));
|
||||
memset(&peer->peer_recv_event, 0, sizeof(peer->peer_recv_event));
|
||||
peer->peer_sd = -1;
|
||||
peer->peer_current_af = AF_UNSPEC;
|
||||
OBJ_CONSTRUCT(&peer->peer_timer_event, opal_event_t);
|
||||
opal_event.evtimer_set(opal_event_base, &peer->peer_timer_event, mca_oob_tcp_peer_timer_handler, peer);
|
||||
memset(&peer->peer_timer_event, 0, sizeof(peer->peer_timer_event));
|
||||
opal_event_evtimer_set(opal_event_base, &peer->peer_timer_event, mca_oob_tcp_peer_timer_handler, peer);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -125,9 +125,6 @@ static void mca_oob_tcp_peer_destruct(mca_oob_tcp_peer_t * peer)
|
||||
if (NULL != peer->peer_addr) {
|
||||
OBJ_RELEASE(peer->peer_addr);
|
||||
}
|
||||
OBJ_DESTRUCT(&peer->peer_send_event);
|
||||
OBJ_DESTRUCT(&peer->peer_recv_event);
|
||||
OBJ_DESTRUCT(&peer->peer_timer_event);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -135,17 +132,17 @@ static void mca_oob_tcp_peer_destruct(mca_oob_tcp_peer_t * peer)
|
||||
*/
|
||||
static int mca_oob_tcp_peer_event_init(mca_oob_tcp_peer_t* peer)
|
||||
{
|
||||
OBJ_CONSTRUCT(&peer->peer_recv_event, opal_event_t);
|
||||
OBJ_CONSTRUCT(&peer->peer_send_event, opal_event_t);
|
||||
memset(&peer->peer_recv_event, 0, sizeof(peer->peer_recv_event));
|
||||
memset(&peer->peer_send_event, 0, sizeof(peer->peer_send_event));
|
||||
|
||||
if (peer->peer_sd >= 0) {
|
||||
opal_event.set(opal_event_base,
|
||||
opal_event_set(opal_event_base,
|
||||
&peer->peer_recv_event,
|
||||
peer->peer_sd,
|
||||
OPAL_EV_READ|OPAL_EV_PERSIST,
|
||||
mca_oob_tcp_peer_recv_handler,
|
||||
peer);
|
||||
opal_event.set(opal_event_base,
|
||||
opal_event_set(opal_event_base,
|
||||
&peer->peer_send_event,
|
||||
peer->peer_sd,
|
||||
OPAL_EV_WRITE|OPAL_EV_PERSIST,
|
||||
@ -206,7 +203,7 @@ int mca_oob_tcp_peer_send(mca_oob_tcp_peer_t* peer, mca_oob_tcp_msg_t* msg)
|
||||
/*if the send does not complete */
|
||||
if(!mca_oob_tcp_msg_send_handler(msg, peer)) {
|
||||
peer->peer_send_msg = msg;
|
||||
opal_event.add(&peer->peer_send_event, 0);
|
||||
opal_event_add(&peer->peer_send_event, 0);
|
||||
} else {
|
||||
mca_oob_tcp_msg_complete(msg, &peer->peer_name);
|
||||
}
|
||||
@ -401,7 +398,7 @@ static int mca_oob_tcp_peer_try_connect(mca_oob_tcp_peer_t* peer)
|
||||
rc = mca_oob_tcp_peer_create_socket(peer, inaddr.ss_family);
|
||||
if (ORTE_SUCCESS != rc) {
|
||||
struct timeval tv = { 1,0 };
|
||||
opal_event.evtimer_add(&peer->peer_timer_event, &tv);
|
||||
opal_event_evtimer_add(&peer->peer_timer_event, &tv);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -416,7 +413,7 @@ static int mca_oob_tcp_peer_try_connect(mca_oob_tcp_peer_t* peer)
|
||||
if (connect(peer->peer_sd, (struct sockaddr*)&inaddr, addrlen) < 0) {
|
||||
/* non-blocking so wait for completion */
|
||||
if(opal_socket_errno == EINPROGRESS || opal_socket_errno == EWOULDBLOCK) {
|
||||
opal_event.add(&peer->peer_send_event, 0);
|
||||
opal_event_add(&peer->peer_send_event, 0);
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
@ -447,7 +444,7 @@ static int mca_oob_tcp_peer_try_connect(mca_oob_tcp_peer_t* peer)
|
||||
/* send our globally unique process identifier to the peer */
|
||||
if((rc = mca_oob_tcp_peer_send_connect_ack(peer, peer->peer_sd)) == ORTE_SUCCESS) {
|
||||
peer->peer_state = MCA_OOB_TCP_CONNECT_ACK;
|
||||
opal_event.add(&peer->peer_recv_event, 0);
|
||||
opal_event_add(&peer->peer_recv_event, 0);
|
||||
return ORTE_SUCCESS;
|
||||
} else {
|
||||
opal_output(0,
|
||||
@ -508,7 +505,7 @@ static void mca_oob_tcp_peer_complete_connect(mca_oob_tcp_peer_t* peer, int sd)
|
||||
opal_socklen_t so_length = sizeof(so_error);
|
||||
|
||||
/* unregister from receiving event notifications */
|
||||
opal_event.del(&peer->peer_send_event);
|
||||
opal_event_del(&peer->peer_send_event);
|
||||
|
||||
/* check connect completion status */
|
||||
if(getsockopt(sd, SOL_SOCKET, SO_ERROR, (char *)&so_error, &so_length) < 0) {
|
||||
@ -522,7 +519,7 @@ static void mca_oob_tcp_peer_complete_connect(mca_oob_tcp_peer_t* peer, int sd)
|
||||
}
|
||||
|
||||
if(so_error == EINPROGRESS) {
|
||||
opal_event.add(&peer->peer_send_event, 0);
|
||||
opal_event_add(&peer->peer_send_event, 0);
|
||||
return;
|
||||
} else if (so_error == ECONNREFUSED || so_error == ETIMEDOUT) {
|
||||
struct timeval tv = { 1,0 };
|
||||
@ -536,7 +533,7 @@ static void mca_oob_tcp_peer_complete_connect(mca_oob_tcp_peer_t* peer, int sd)
|
||||
}
|
||||
mca_oob_tcp_peer_shutdown(peer);
|
||||
if( MCA_OOB_TCP_FAILED != peer->peer_state ) {
|
||||
opal_event.evtimer_add(&peer->peer_timer_event, &tv);
|
||||
opal_event_evtimer_add(&peer->peer_timer_event, &tv);
|
||||
}
|
||||
return;
|
||||
} else if(so_error != 0) {
|
||||
@ -556,7 +553,7 @@ static void mca_oob_tcp_peer_complete_connect(mca_oob_tcp_peer_t* peer, int sd)
|
||||
|
||||
if (mca_oob_tcp_peer_send_connect_ack(peer, sd) == ORTE_SUCCESS) {
|
||||
peer->peer_state = MCA_OOB_TCP_CONNECT_ACK;
|
||||
opal_event.add(&peer->peer_recv_event, 0);
|
||||
opal_event_add(&peer->peer_recv_event, 0);
|
||||
} else {
|
||||
opal_output(0, "%s-%s mca_oob_tcp_peer_complete_connect: unable to send connect ack.",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
@ -571,7 +568,7 @@ static void mca_oob_tcp_peer_complete_connect(mca_oob_tcp_peer_t* peer, int sd)
|
||||
*/
|
||||
static void mca_oob_tcp_peer_connected(mca_oob_tcp_peer_t* peer, int sd)
|
||||
{
|
||||
opal_event.del(&peer->peer_timer_event);
|
||||
opal_event_del(&peer->peer_timer_event);
|
||||
peer->peer_state = MCA_OOB_TCP_CONNECTED;
|
||||
peer->peer_retries = 0;
|
||||
|
||||
@ -580,7 +577,7 @@ static void mca_oob_tcp_peer_connected(mca_oob_tcp_peer_t* peer, int sd)
|
||||
peer->peer_send_msg = (mca_oob_tcp_msg_t*)
|
||||
opal_list_remove_first(&peer->peer_send_queue);
|
||||
}
|
||||
opal_event.add(&peer->peer_send_event, 0);
|
||||
opal_event_add(&peer->peer_send_event, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -663,14 +660,14 @@ void mca_oob_tcp_peer_shutdown(mca_oob_tcp_peer_t* peer)
|
||||
}
|
||||
|
||||
if (peer->peer_sd >= 0) {
|
||||
opal_event.del(&peer->peer_recv_event);
|
||||
opal_event.del(&peer->peer_send_event);
|
||||
opal_event_del(&peer->peer_recv_event);
|
||||
opal_event_del(&peer->peer_send_event);
|
||||
CLOSE_THE_SOCKET(peer->peer_sd);
|
||||
peer->peer_sd = -1;
|
||||
peer->peer_current_af = AF_UNSPEC;
|
||||
}
|
||||
|
||||
opal_event.del(&peer->peer_timer_event);
|
||||
opal_event_del(&peer->peer_timer_event);
|
||||
if( MCA_OOB_TCP_FAILED != peer->peer_state ) {
|
||||
peer->peer_state = MCA_OOB_TCP_CLOSED;
|
||||
}
|
||||
@ -721,9 +718,9 @@ static int mca_oob_tcp_peer_recv_connect_ack(mca_oob_tcp_peer_t* peer, int sd)
|
||||
ORTE_NAME_PRINT(&(peer->peer_name)),
|
||||
strerror(opal_socket_errno));
|
||||
}
|
||||
opal_event.del(&peer->peer_recv_event);
|
||||
opal_event_del(&peer->peer_recv_event);
|
||||
mca_oob_tcp_peer_shutdown(peer);
|
||||
opal_event.evtimer_add(&peer->peer_timer_event, &tv);
|
||||
opal_event_evtimer_add(&peer->peer_timer_event, &tv);
|
||||
return ORTE_SUCCESS;
|
||||
} else {
|
||||
mca_oob_tcp_peer_close(peer);
|
||||
@ -975,7 +972,7 @@ static void mca_oob_tcp_peer_send_handler(int sd, short flags, void* user)
|
||||
|
||||
/* if nothing else to do unregister for send event notifications */
|
||||
if(NULL == peer->peer_send_msg) {
|
||||
opal_event.del(&peer->peer_send_event);
|
||||
opal_event_del(&peer->peer_send_event);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -984,7 +981,7 @@ static void mca_oob_tcp_peer_send_handler(int sd, short flags, void* user)
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
ORTE_NAME_PRINT(&(peer->peer_name)),
|
||||
peer->peer_state);
|
||||
opal_event.del(&peer->peer_send_event);
|
||||
opal_event_del(&peer->peer_send_event);
|
||||
break;
|
||||
}
|
||||
OPAL_THREAD_UNLOCK(&peer->peer_lock);
|
||||
@ -1092,7 +1089,7 @@ bool mca_oob_tcp_peer_accept(mca_oob_tcp_peer_t* peer, int sd)
|
||||
|
||||
mca_oob_tcp_peer_connected(peer, sd);
|
||||
if (sd == peer->peer_sd) {
|
||||
opal_event.add(&peer->peer_recv_event, 0);
|
||||
opal_event_add(&peer->peer_recv_event, 0);
|
||||
}
|
||||
if(mca_oob_tcp_component.tcp_debug > 0) {
|
||||
mca_oob_tcp_peer_dump(peer, "accepted");
|
||||
|
@ -187,10 +187,9 @@ mca_oob_tcp_ping(const orte_process_name_t* name,
|
||||
#ifndef __WINDOWS__
|
||||
/* Ignore SIGPIPE in the write -- determine success or failure in
|
||||
the ping by looking at the return code from write() */
|
||||
OBJ_CONSTRUCT(&sigpipe_handler, opal_event_t);
|
||||
opal_event.signal_set(opal_event_base, &sigpipe_handler, SIGPIPE,
|
||||
opal_event_signal_set(opal_event_base, &sigpipe_handler, SIGPIPE,
|
||||
noop, &sigpipe_handler);
|
||||
opal_event.signal_add(&sigpipe_handler, NULL);
|
||||
opal_event_signal_add(&sigpipe_handler, NULL);
|
||||
#endif
|
||||
/* Do the write and see what happens. Use the writev version just to
|
||||
* make Windows happy as there the write function is limitted to
|
||||
@ -201,7 +200,7 @@ mca_oob_tcp_ping(const orte_process_name_t* name,
|
||||
rc = writev(sd, &iov, 1 );
|
||||
#ifndef __WINDOWS__
|
||||
/* Now de-register the handler */
|
||||
opal_event.signal_del(&sigpipe_handler);
|
||||
opal_event_signal_del(&sigpipe_handler);
|
||||
#endif
|
||||
if (rc != sizeof(hdr)) {
|
||||
CLOSE_THE_SOCKET(sd);
|
||||
|
@ -77,8 +77,9 @@ static void send_callback(int status,
|
||||
if (num_reported == num_being_sent) {
|
||||
/* cancel the timer */
|
||||
if (NULL != ev) {
|
||||
opal_event.evtimer_del(ev);
|
||||
OBJ_RELEASE(ev);
|
||||
opal_event_evtimer_del(ev);
|
||||
free(ev);
|
||||
ev = NULL;
|
||||
}
|
||||
|
||||
/* mark as done */
|
||||
@ -191,8 +192,9 @@ int orte_plm_base_orted_exit(orte_daemon_cmd_flag_t command)
|
||||
|
||||
/* cleanup the timer */
|
||||
if (NULL != ev) {
|
||||
opal_event.del(ev);
|
||||
OBJ_RELEASE(ev);
|
||||
opal_event_del(ev);
|
||||
free(ev);
|
||||
ev = NULL;
|
||||
}
|
||||
|
||||
/* be sure I get the command */
|
||||
@ -394,8 +396,9 @@ int orte_plm_base_orted_kill_local_procs(opal_pointer_array_t *procs)
|
||||
|
||||
/* cleanup the timer */
|
||||
if (NULL != ev) {
|
||||
opal_event.del(ev);
|
||||
OBJ_RELEASE(ev);
|
||||
opal_event_del(ev);
|
||||
free(ev);
|
||||
ev = NULL;
|
||||
}
|
||||
|
||||
/* if all the sends didn't go, or we couldn't send to
|
||||
|
@ -91,9 +91,9 @@ int orte_plm_base_comm_start(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
OBJ_CONSTRUCT(&ready, opal_event_t);
|
||||
opal_event.set(opal_event_base, &ready, ready_fd[0], OPAL_EV_READ, process_msg, NULL);
|
||||
opal_event.add(&ready, 0);
|
||||
memset(&ready, 0, sizeof(opal_event_t));
|
||||
opal_event_set(opal_event_base, &ready, ready_fd[0], OPAL_EV_READ, process_msg, NULL);
|
||||
opal_event_add(&ready, 0);
|
||||
|
||||
if (ORTE_SUCCESS != (rc = orte_rml.recv_buffer_nb(ORTE_NAME_WILDCARD,
|
||||
ORTE_RML_TAG_PLM,
|
||||
@ -115,8 +115,7 @@ int orte_plm_base_comm_stop(void)
|
||||
}
|
||||
|
||||
OBJ_DESTRUCT(&recvs);
|
||||
opal_event.del(&ready);
|
||||
OBJ_DESTRUCT(&ready);
|
||||
opal_event_del(&ready);
|
||||
#ifndef __WINDOWS__
|
||||
close(ready_fd[0]);
|
||||
#else
|
||||
@ -171,7 +170,7 @@ static void process_msg(int fd, short event, void *data)
|
||||
#endif
|
||||
|
||||
/* reset the event for the next message */
|
||||
opal_event.add(&ready, 0);
|
||||
opal_event_add(&ready, 0);
|
||||
|
||||
while (NULL != (item = opal_list_remove_first(&recvs))) {
|
||||
msgpkt = (orte_msg_packet_t*)item;
|
||||
|
@ -485,7 +485,7 @@ GETMAP:
|
||||
|
||||
|
||||
/* Allow some progress to occur */
|
||||
opal_event.loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
opal_event_loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
|
||||
launched++;
|
||||
|
||||
|
@ -1484,9 +1484,8 @@ static int orte_plm_process_launch_threaded(orte_jobid_t jobid)
|
||||
if( opal_event_progress_thread() ) {
|
||||
stack.rc = orte_plm_process_launch( jobid );
|
||||
} else {
|
||||
OBJ_CONSTRUCT(&event, opal_event_t);
|
||||
opal_event.evtimer_set(opal_event_base, &event, orte_plm_process_launch_cb, &stack);
|
||||
opal_event.evtimer_add(&event, &tv);
|
||||
opal_event_evtimer_set(opal_event_base, &event, orte_plm_process_launch_cb, &stack);
|
||||
opal_event_evtimer_add(&event, &tv);
|
||||
|
||||
OPAL_THREAD_LOCK(&stack.mutex);
|
||||
while (stack.complete == false) {
|
||||
|
@ -1569,7 +1569,6 @@ static int orte_plm_rsh_launch_threaded(orte_jobid_t jobid)
|
||||
if( opal_event_progress_thread() ) {
|
||||
stack.rc = orte_plm_rsh_launch( jobid );
|
||||
} else {
|
||||
OBJ_CONSTRUCT(&event, opal_event_t);
|
||||
opal_evtimer_set(opal_event_base, &event, orte_plm_rsh_launch_cb, &stack);
|
||||
opal_evtimer_add(&event, &tv);
|
||||
|
||||
|
@ -478,7 +478,6 @@ static int orte_plm_rshd_launch_threaded(orte_jobid_t jobid)
|
||||
if( opal_event_progress_thread() ) {
|
||||
stack.rc = orte_plm_rshd_launch( jobid );
|
||||
} else {
|
||||
OBJ_CONSTRUCT(&event, opal_event_t);
|
||||
opal_evtimer_set(opal_event_base, &event, orte_plm_rshd_launch_cb, &stack);
|
||||
opal_evtimer_add(&event, &tv);
|
||||
|
||||
|
@ -1034,7 +1034,6 @@ static int orte_plm_submit_launch_threaded(orte_jobid_t jobid)
|
||||
if( opal_event_progress_thread() ) {
|
||||
stack.rc = orte_plm_submit_launch( jobid );
|
||||
} else {
|
||||
OBJ_CONSTRUCT(&event, opal_event_t);
|
||||
opal_evtimer_set(opal_event_base, &event, orte_plm_submit_launch_cb, &stack);
|
||||
opal_evtimer_add(&event, &tv);
|
||||
|
||||
|
@ -376,7 +376,7 @@ static int plm_tm_launch_job(orte_job_t *jdata)
|
||||
launched++;
|
||||
|
||||
/* Allow some progress to occur */
|
||||
opal_event.loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
opal_event_loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
}
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output,
|
||||
@ -422,7 +422,7 @@ static int plm_tm_launch_job(orte_job_t *jdata)
|
||||
|
||||
/* if issued, cancel the failed-to-start timer */
|
||||
if (NULL != ev) {
|
||||
opal_event.del(ev);
|
||||
opal_event_del(ev);
|
||||
}
|
||||
|
||||
launch_apps:
|
||||
|
@ -430,7 +430,7 @@ static int plm_tmd_launch_job(orte_job_t *jdata)
|
||||
launched++;
|
||||
|
||||
/* Allow some progress to occur */
|
||||
opal_event.loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
opal_event_loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
}
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((1, orte_plm_globals.output,
|
||||
@ -511,7 +511,7 @@ static int plm_tmd_launch_job(orte_job_t *jdata)
|
||||
|
||||
/* if issued, cancel the failed-to-start timer */
|
||||
if (NULL != ev) {
|
||||
opal_event.del(ev);
|
||||
opal_event_del(ev);
|
||||
}
|
||||
|
||||
launch_apps:
|
||||
@ -640,7 +640,7 @@ int plm_tmd_terminate_orteds(void)
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
||||
/* give system a little time to progress */
|
||||
timer_fired = false;
|
||||
opal_event.evtimer_add(quicktime, &quicktimeval);
|
||||
opal_event_evtimer_add(quicktime, &quicktimeval);
|
||||
ORTE_PROGRESSED_WAIT(timer_fired, 0, 1);
|
||||
continue;
|
||||
}
|
||||
@ -658,7 +658,7 @@ int plm_tmd_terminate_orteds(void)
|
||||
}
|
||||
/* give system a little time to progress */
|
||||
timer_fired = false;
|
||||
opal_event.evtimer_add(quicktime, &quicktimeval);
|
||||
opal_event_evtimer_add(quicktime, &quicktimeval);
|
||||
ORTE_PROGRESSED_WAIT(timer_fired, 0, 1);
|
||||
}
|
||||
if (0 != local_err) {
|
||||
@ -699,7 +699,7 @@ int plm_tmd_terminate_orteds(void)
|
||||
free(quicktime);
|
||||
}
|
||||
if (NULL != timerev) {
|
||||
opal_event.del(timerev);
|
||||
opal_event_del(timerev);
|
||||
free(timerev);
|
||||
}
|
||||
} else {
|
||||
|
@ -150,11 +150,11 @@ ORTE_DECLSPEC OBJ_CLASS_DECLARATION(rmcast_send_log_t);
|
||||
__FILE__, __LINE__)); \
|
||||
mev = OBJ_NEW(orte_mcast_msg_event_t); \
|
||||
mev->buf = (bf); \
|
||||
opal_event.evtimer_set(opal_event_base, \
|
||||
opal_event_evtimer_set(opal_event_base, \
|
||||
mev->ev, (cbfunc), mev); \
|
||||
now.tv_sec = 0; \
|
||||
now.tv_usec = 0; \
|
||||
opal_event.evtimer_add(mev->ev, &now); \
|
||||
opal_event_evtimer_add(mev->ev, &now); \
|
||||
} while(0);
|
||||
|
||||
|
||||
|
@ -341,12 +341,12 @@ int orte_rmcast_base_open(void)
|
||||
/**** CLASS INSTANCES ****/
|
||||
static void mcast_event_constructor(orte_mcast_msg_event_t *ev)
|
||||
{
|
||||
ev->ev = OBJ_NEW(opal_event_t);
|
||||
ev->ev = (opal_event_t*)malloc(sizeof(opal_event_t));
|
||||
}
|
||||
static void mcast_event_destructor(orte_mcast_msg_event_t *ev)
|
||||
{
|
||||
if (NULL != ev->ev) {
|
||||
OBJ_RELEASE(ev->ev);
|
||||
free(ev->ev);
|
||||
}
|
||||
}
|
||||
OBJ_CLASS_INSTANCE(orte_mcast_msg_event_t,
|
||||
@ -401,12 +401,12 @@ static void channel_construct(rmcast_base_channel_t *ptr)
|
||||
ptr->seq_num = 0;
|
||||
ptr->recv = -1;
|
||||
memset(&ptr->addr, 0, sizeof(ptr->addr));
|
||||
OBJ_CONSTRUCT(&ptr->send_ev, opal_event_t);
|
||||
memset(&ptr->send_ev, 0, sizeof(opal_event_t));
|
||||
OBJ_CONSTRUCT(&ptr->send_lock, opal_mutex_t);
|
||||
ptr->sends_in_progress = false;
|
||||
OBJ_CONSTRUCT(&ptr->pending_sends, opal_list_t);
|
||||
ptr->send_data = NULL;
|
||||
OBJ_CONSTRUCT(&ptr->recv_ev, opal_event_t);
|
||||
memset(&ptr->recv_ev, 0, sizeof(opal_event_t));
|
||||
OBJ_CONSTRUCT(&ptr->cache, opal_ring_buffer_t);
|
||||
opal_ring_buffer_init(&ptr->cache, orte_rmcast_base.cache_size);
|
||||
}
|
||||
@ -416,15 +416,13 @@ static void channel_destruct(rmcast_base_channel_t *ptr)
|
||||
|
||||
/* cleanup the recv side */
|
||||
if (0 < ptr->recv) {
|
||||
opal_event.del(&ptr->recv_ev);
|
||||
OBJ_DESTRUCT(&ptr->recv_ev);
|
||||
opal_event_del(&ptr->recv_ev);
|
||||
CLOSE_THE_SOCKET(ptr->recv);
|
||||
}
|
||||
/* attempt to xmit any pending sends */
|
||||
/* cleanup the xmit side */
|
||||
if (0 < ptr->xmit) {
|
||||
opal_event.del(&ptr->send_ev);
|
||||
OBJ_DESTRUCT(&ptr->send_ev);
|
||||
opal_event_del(&ptr->send_ev);
|
||||
CLOSE_THE_SOCKET(ptr->xmit);
|
||||
}
|
||||
OBJ_DESTRUCT(&ptr->send_lock);
|
||||
|
@ -796,8 +796,8 @@ static int setup_channel(rmcast_base_channel_t *chan, uint8_t direction)
|
||||
"%s setup:channel activating recv event on fd %d",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),(int)chan->recv));
|
||||
|
||||
opal_event.set(opal_event_base, &chan->recv_ev, chan->recv, OPAL_EV_READ|OPAL_EV_PERSIST, recv_handler, chan);
|
||||
opal_event.add(&chan->recv_ev, 0);
|
||||
opal_event_set(opal_event_base, &chan->recv_ev, chan->recv, OPAL_EV_READ|OPAL_EV_PERSIST, recv_handler, chan);
|
||||
opal_event_add(&chan->recv_ev, 0);
|
||||
}
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
|
@ -156,11 +156,11 @@ rml_oob_init(int* priority)
|
||||
/* Set default timeout for queued messages to be 1/2 second */
|
||||
orte_rml_oob_module.timeout.tv_sec = 0;
|
||||
orte_rml_oob_module.timeout.tv_usec = 500000;
|
||||
orte_rml_oob_module.timer_event = OBJ_NEW(opal_event_t);
|
||||
orte_rml_oob_module.timer_event = (opal_event_t *) malloc(sizeof(opal_event_t));
|
||||
if (NULL == orte_rml_oob_module.timer_event) {
|
||||
return NULL;
|
||||
}
|
||||
opal_event.evtimer_set(opal_event_base, orte_rml_oob_module.timer_event,
|
||||
opal_event_evtimer_set(opal_event_base, orte_rml_oob_module.timer_event,
|
||||
rml_oob_queued_progress,
|
||||
NULL);
|
||||
|
||||
@ -412,7 +412,7 @@ rml_oob_queued_progress(int fd, short event, void *arg)
|
||||
opal_list_append(&orte_rml_oob_module.queued_routing_messages,
|
||||
&qmsg->super);
|
||||
if (1 == opal_list_get_size(&orte_rml_oob_module.queued_routing_messages)) {
|
||||
opal_event.evtimer_add(orte_rml_oob_module.timer_event,
|
||||
opal_event_evtimer_add(orte_rml_oob_module.timer_event,
|
||||
&orte_rml_oob_module.timeout);
|
||||
}
|
||||
OPAL_THREAD_UNLOCK(&orte_rml_oob_module.queued_lock);
|
||||
@ -526,7 +526,7 @@ rml_oob_recv_route_callback(int status,
|
||||
opal_list_append(&orte_rml_oob_module.queued_routing_messages,
|
||||
&qmsg->super);
|
||||
if (1 == opal_list_get_size(&orte_rml_oob_module.queued_routing_messages)) {
|
||||
opal_event.evtimer_add(orte_rml_oob_module.timer_event,
|
||||
opal_event_evtimer_add(orte_rml_oob_module.timer_event,
|
||||
&orte_rml_oob_module.timeout);
|
||||
}
|
||||
OPAL_THREAD_UNLOCK(&orte_rml_oob_module.queued_lock);
|
||||
|
@ -115,8 +115,8 @@ static void finalize(void)
|
||||
opal_list_item_t *item;
|
||||
|
||||
if (NULL != sample_ev) {
|
||||
opal_event.del(sample_ev);
|
||||
OBJ_RELEASE(sample_ev);
|
||||
opal_event_del(sample_ev);
|
||||
free(sample_ev);
|
||||
}
|
||||
while (NULL != (item = opal_list_remove_first(&jobs))) {
|
||||
OBJ_RELEASE(item);
|
||||
@ -230,11 +230,11 @@ static void start(orte_jobid_t jobid)
|
||||
/* startup a timer to wake us up periodically
|
||||
* for a data sample
|
||||
*/
|
||||
sample_ev = OBJ_NEW(opal_event_t);
|
||||
opal_event.evtimer_set(opal_event_base, sample_ev, sample, sample_ev);
|
||||
sample_ev = (opal_event_t *) malloc(sizeof(opal_event_t));
|
||||
opal_event_evtimer_set(opal_event_base, sample_ev, sample, sample_ev);
|
||||
sample_time.tv_sec = mca_sensor_file_component.sample_rate;
|
||||
sample_time.tv_usec = 0;
|
||||
opal_event.evtimer_add(sample_ev, &sample_time);
|
||||
opal_event_evtimer_add(sample_ev, &sample_time);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -261,8 +261,9 @@ static void stop(orte_jobid_t jobid)
|
||||
}
|
||||
/* if no jobs remain, stop the sampling */
|
||||
if (opal_list_is_empty(&jobs) && NULL != sample_ev) {
|
||||
opal_event.del(sample_ev);
|
||||
OBJ_RELEASE(sample_ev);
|
||||
opal_event_del(sample_ev);
|
||||
free(sample_ev);
|
||||
sample_ev = NULL;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -346,5 +347,5 @@ static void sample(int fd, short event, void *arg)
|
||||
}
|
||||
|
||||
/* restart the timer */
|
||||
opal_event.evtimer_add(sample_ev, &sample_time);
|
||||
opal_event_evtimer_add(sample_ev, &sample_time);
|
||||
}
|
||||
|
@ -138,12 +138,12 @@ static int init(void)
|
||||
static void finalize(void)
|
||||
{
|
||||
if (NULL != send_ev) {
|
||||
opal_event.del(send_ev);
|
||||
OBJ_RELEASE(send_ev);
|
||||
opal_event_del(send_ev);
|
||||
free(send_ev);
|
||||
}
|
||||
if (NULL != check_ev) {
|
||||
opal_event.del(check_ev);
|
||||
OBJ_RELEASE(check_ev);
|
||||
opal_event_del(check_ev);
|
||||
free(check_ev);
|
||||
}
|
||||
|
||||
#if ORTE_ENABLE_MULTICAST
|
||||
@ -168,22 +168,22 @@ static void start(orte_jobid_t jobid)
|
||||
|
||||
/* setup the send */
|
||||
time = mca_sensor_heartbeat_component.rate * 1000; /* convert to microsecs */
|
||||
send_ev = OBJ_NEW(opal_event_t);
|
||||
opal_event.evtimer_set(opal_event_base, send_ev, send_heartbeat, send_ev);
|
||||
send_ev = (opal_event_t *) malloc(sizeof(opal_event_t));
|
||||
opal_event_evtimer_set(opal_event_base, send_ev, send_heartbeat, send_ev);
|
||||
send_time.tv_sec = time / 1000000;
|
||||
send_time.tv_usec = time % 1000000;
|
||||
opal_event.evtimer_add(send_ev, &send_time);
|
||||
opal_event_evtimer_add(send_ev, &send_time);
|
||||
|
||||
/* define the timeout */
|
||||
timeout = 2.0 * (double)time;
|
||||
|
||||
/* setup the check */
|
||||
time = mca_sensor_heartbeat_component.check * 1000; /* convert to microsecs */
|
||||
check_ev = OBJ_NEW(opal_event_t);
|
||||
opal_event.evtimer_set(opal_event_base, check_ev, check_heartbeat, check_ev);
|
||||
check_ev = (opal_event_t *) malloc(sizeof(opal_event_t));
|
||||
opal_event_evtimer_set(opal_event_base, check_ev, check_heartbeat, check_ev);
|
||||
check_time.tv_sec = time / 1000000;
|
||||
check_time.tv_usec = time % 1000000;
|
||||
opal_event.evtimer_add(check_ev, &check_time);
|
||||
opal_event_evtimer_add(check_ev, &check_time);
|
||||
}
|
||||
|
||||
|
||||
@ -195,12 +195,14 @@ static void stop(orte_jobid_t jobid)
|
||||
}
|
||||
|
||||
if (NULL != send_ev) {
|
||||
opal_event.del(send_ev);
|
||||
OBJ_RELEASE(send_ev);
|
||||
opal_event_del(send_ev);
|
||||
free(send_ev);
|
||||
send_ev = NULL;
|
||||
}
|
||||
if (NULL != check_ev) {
|
||||
opal_event.del(check_ev);
|
||||
OBJ_RELEASE(check_ev);
|
||||
opal_event_del(check_ev);
|
||||
free(check_ev);
|
||||
check_ev = NULL;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -243,7 +245,7 @@ static void send_heartbeat(int fd, short event, void *arg)
|
||||
#endif
|
||||
|
||||
/* reset the timer */
|
||||
opal_event.evtimer_add(tmp, &send_time);
|
||||
opal_event_evtimer_add(tmp, &send_time);
|
||||
}
|
||||
|
||||
/* this function automatically gets periodically called
|
||||
@ -297,7 +299,7 @@ static void check_heartbeat(int fd, short dummy, void *arg)
|
||||
}
|
||||
|
||||
/* reset the timer */
|
||||
opal_event.evtimer_add(tmp, &check_time);
|
||||
opal_event_evtimer_add(tmp, &check_time);
|
||||
}
|
||||
|
||||
#if ORTE_ENABLE_MULTICAST
|
||||
|
@ -86,8 +86,8 @@ static void finalize(void)
|
||||
opal_list_item_t *item;
|
||||
|
||||
if (NULL != sample_ev) {
|
||||
opal_event.del(sample_ev);
|
||||
OBJ_RELEASE(sample_ev);
|
||||
opal_event_del(sample_ev);
|
||||
free(sample_ev);
|
||||
}
|
||||
while (NULL != (item = opal_list_remove_first(&jobs))) {
|
||||
OBJ_RELEASE(item);
|
||||
@ -160,11 +160,11 @@ static void start(orte_jobid_t jobid)
|
||||
/* startup a timer to wake us up periodically
|
||||
* for a data sample
|
||||
*/
|
||||
sample_ev = OBJ_NEW(opal_event_t);
|
||||
opal_event.evtimer_set(opal_event_base, sample_ev, sample, sample_ev);
|
||||
sample_ev = (opal_event_t *) malloc(sizeof(opal_event_t));
|
||||
opal_event_evtimer_set(opal_event_base, sample_ev, sample, sample_ev);
|
||||
sample_time.tv_sec = mca_sensor_memusage_component.sample_rate;
|
||||
sample_time.tv_usec = 0;
|
||||
opal_event.evtimer_add(sample_ev, &sample_time);
|
||||
opal_event_evtimer_add(sample_ev, &sample_time);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -191,8 +191,9 @@ static void stop(orte_jobid_t jobid)
|
||||
}
|
||||
/* if no jobs remain, stop the sampling */
|
||||
if (opal_list_is_empty(&jobs) && NULL != sample_ev) {
|
||||
opal_event.del(sample_ev);
|
||||
OBJ_RELEASE(sample_ev);
|
||||
opal_event_del(sample_ev);
|
||||
free(sample_ev);
|
||||
sample_ev = NULL;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -261,5 +262,5 @@ static void sample(int fd, short event, void *arg)
|
||||
}
|
||||
|
||||
/* restart the timer */
|
||||
opal_event.evtimer_add(sample_ev, &sample_time);
|
||||
opal_event_evtimer_add(sample_ev, &sample_time);
|
||||
}
|
||||
|
@ -1471,7 +1471,7 @@ static int snapc_full_local_start_ckpt_open_comm(orte_snapc_full_app_snapshot_t
|
||||
s_time/usleep_time, max_wait_time/usleep_time));
|
||||
}
|
||||
usleep(usleep_time);
|
||||
opal_event.loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
opal_event_loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
continue;
|
||||
}
|
||||
else if( 0 > (ret = access(vpid_snapshot->comm_pipe_w, F_OK) )) {
|
||||
@ -1483,7 +1483,7 @@ static int snapc_full_local_start_ckpt_open_comm(orte_snapc_full_app_snapshot_t
|
||||
s_time/usleep_time, max_wait_time/usleep_time));
|
||||
}
|
||||
usleep(usleep_time);
|
||||
opal_event.loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
opal_event_loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
@ -1712,13 +1712,13 @@ static int snapc_full_local_start_ckpt_handshake(orte_snapc_full_app_snapshot_t
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
opal_event.set(opal_event_base, &(vpid_snapshot->comm_pipe_r_eh),
|
||||
opal_event_set(opal_event_base, &(vpid_snapshot->comm_pipe_r_eh),
|
||||
vpid_snapshot->comm_pipe_r_fd,
|
||||
OPAL_EV_READ|OPAL_EV_PERSIST,
|
||||
snapc_full_local_comm_read_event,
|
||||
vpid_snapshot);
|
||||
vpid_snapshot->is_eh_active = true;
|
||||
opal_event.add(&(vpid_snapshot->comm_pipe_r_eh), NULL);
|
||||
opal_event_add(&(vpid_snapshot->comm_pipe_r_eh), NULL);
|
||||
|
||||
/*
|
||||
* Let the application know that it can proceed
|
||||
@ -1929,7 +1929,7 @@ static void snapc_full_local_comm_read_event(int fd, short flags, void *arg)
|
||||
/*
|
||||
* Disable events
|
||||
*/
|
||||
opal_event.del(&(vpid_snapshot->comm_pipe_r_eh));
|
||||
opal_event_del(&(vpid_snapshot->comm_pipe_r_eh));
|
||||
vpid_snapshot->is_eh_active = false;
|
||||
|
||||
if( NULL != state_str ) {
|
||||
|
@ -526,13 +526,12 @@ int orte_daemon(int argc, char *argv[])
|
||||
/* if we were given a pipe to monitor for singleton termination, set that up */
|
||||
if (orted_globals.singleton_died_pipe > 0) {
|
||||
/* register shutdown handler */
|
||||
OBJ_CONSTRUCT(&pipe_handler, opal_event_t);
|
||||
opal_event.set(opal_event_base, &pipe_handler,
|
||||
opal_event_set(opal_event_base, &pipe_handler,
|
||||
orted_globals.singleton_died_pipe,
|
||||
OPAL_EV_READ|OPAL_EV_PERSIST,
|
||||
shutdown_callback,
|
||||
&orted_globals.singleton_died_pipe);
|
||||
opal_event.add(&pipe_handler, NULL);
|
||||
opal_event_add(&pipe_handler, NULL);
|
||||
}
|
||||
|
||||
/* if we are not the HNP...the only time we will be an HNP
|
||||
@ -713,7 +712,7 @@ int orte_daemon(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* wait to hear we are done */
|
||||
opal_event.dispatch(opal_event_base);
|
||||
opal_event_dispatch(opal_event_base);
|
||||
|
||||
/* should never get here, but if we do... */
|
||||
DONE:
|
||||
@ -726,7 +725,7 @@ static void shutdown_callback(int fd, short flags, void *arg)
|
||||
{
|
||||
if (NULL != arg) {
|
||||
/* it's the singleton pipe... remove that handler */
|
||||
opal_event.del(&pipe_handler);
|
||||
opal_event_del(&pipe_handler);
|
||||
}
|
||||
|
||||
if (orte_debug_daemons_flag) {
|
||||
|
@ -75,7 +75,7 @@
|
||||
static void message_event_destructor(orte_message_event_t *ev)
|
||||
{
|
||||
if (NULL != ev->ev) {
|
||||
OBJ_RELEASE(ev->ev);
|
||||
free(ev->ev);
|
||||
}
|
||||
if (NULL != ev->buffer) {
|
||||
OBJ_RELEASE(ev->buffer);
|
||||
@ -89,7 +89,7 @@ static void message_event_destructor(orte_message_event_t *ev)
|
||||
|
||||
static void message_event_constructor(orte_message_event_t *ev)
|
||||
{
|
||||
ev->ev = OBJ_NEW(opal_event_t);
|
||||
ev->ev = (opal_event_t *) malloc(sizeof(opal_event_t));
|
||||
ev->buffer = OBJ_NEW(opal_buffer_t);
|
||||
#if OPAL_ENABLE_DEBUG
|
||||
ev->file = NULL;
|
||||
@ -104,13 +104,13 @@ OBJ_CLASS_INSTANCE(orte_message_event_t,
|
||||
static void notify_event_destructor(orte_notify_event_t *ev)
|
||||
{
|
||||
if (NULL != ev->ev) {
|
||||
OBJ_RELEASE(ev->ev);
|
||||
free(ev->ev);
|
||||
}
|
||||
}
|
||||
|
||||
static void notify_event_constructor(orte_notify_event_t *ev)
|
||||
{
|
||||
ev->ev = OBJ_NEW(opal_event_t);
|
||||
ev->ev = (opal_event_t *) malloc(sizeof(opal_event_t));
|
||||
}
|
||||
OBJ_CLASS_INSTANCE(orte_notify_event_t,
|
||||
opal_object_t,
|
||||
@ -255,13 +255,13 @@ static void internal_waitpid_callback(int fd, short event, void *arg);
|
||||
void
|
||||
orte_wait_disable(void)
|
||||
{
|
||||
opal_event.del(&handler);
|
||||
opal_event_del(&handler);
|
||||
}
|
||||
|
||||
void
|
||||
orte_wait_enable(void)
|
||||
{
|
||||
opal_event.add(&handler, NULL);
|
||||
opal_event_add(&handler, NULL);
|
||||
}
|
||||
|
||||
int
|
||||
@ -271,13 +271,12 @@ orte_wait_init(void)
|
||||
OBJ_CONSTRUCT(&pending_pids, opal_list_t);
|
||||
OBJ_CONSTRUCT(®istered_cb, opal_list_t);
|
||||
|
||||
OBJ_CONSTRUCT(&handler, opal_event_t);
|
||||
opal_event.set(opal_event_base,
|
||||
opal_event_set(opal_event_base,
|
||||
&handler, SIGCHLD, OPAL_EV_SIGNAL|OPAL_EV_PERSIST,
|
||||
orte_wait_signal_callback,
|
||||
&handler);
|
||||
|
||||
opal_event.add(&handler, NULL);
|
||||
opal_event_add(&handler, NULL);
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
@ -288,8 +287,7 @@ orte_wait_finalize(void)
|
||||
opal_list_item_t *item;
|
||||
|
||||
OPAL_THREAD_LOCK(&mutex);
|
||||
opal_event.del(&handler);
|
||||
OBJ_DESTRUCT(&handler);
|
||||
opal_event_del(&handler);
|
||||
|
||||
/* clear out the lists */
|
||||
while (NULL != (item = opal_list_remove_first(&pending_pids))) {
|
||||
@ -385,7 +383,7 @@ orte_waitpid(pid_t wpid, int *status, int options)
|
||||
#if OPAL_HAVE_POSIX_THREADS && ORTE_ENABLE_PROGRESS_THREADS
|
||||
if (opal_using_threads()) {
|
||||
opal_mutex_unlock(&mutex);
|
||||
opal_event.loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
opal_event_loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
opal_mutex_lock(&mutex);
|
||||
}
|
||||
#endif
|
||||
@ -410,7 +408,7 @@ orte_waitpid(pid_t wpid, int *status, int options)
|
||||
for long. */
|
||||
|
||||
if (!OPAL_HAVE_THREAD_SUPPORT) {
|
||||
opal_event.loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
opal_event_loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
|
||||
}
|
||||
}
|
||||
|
||||
@ -516,16 +514,16 @@ int orte_wait_event(opal_event_t **event, orte_trigger_event_t *trig,
|
||||
trig->name = strdup(trigger_name);
|
||||
|
||||
/* create the event */
|
||||
*event = OBJ_NEW(opal_event_t);
|
||||
*event = (opal_event_t *) malloc(sizeof(opal_event_t));
|
||||
|
||||
/* pass back the write end of the pipe */
|
||||
trig->channel = p[1];
|
||||
|
||||
/* define the event to fire when someone writes to the pipe */
|
||||
opal_event.set(opal_event_base, *event, p[0], OPAL_EV_READ, cbfunc, trig);
|
||||
opal_event_set(opal_event_base, *event, p[0], OPAL_EV_READ, cbfunc, trig);
|
||||
|
||||
/* Add it to the active events, without a timeout */
|
||||
opal_event.add(*event, NULL);
|
||||
opal_event_add(*event, NULL);
|
||||
|
||||
/* all done */
|
||||
return ORTE_SUCCESS;
|
||||
@ -744,8 +742,7 @@ internal_waitpid(pid_t pid, int *status, int options)
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
OBJ_CONSTRUCT(&ev, opal_event_t);
|
||||
opal_event.evtimer_set(opal_event_base, &ev, internal_waitpid_callback, &data);
|
||||
opal_event_evtimer_set(opal_event_base, &ev, internal_waitpid_callback, &data);
|
||||
opal_evtimer_add(&ev, &tv);
|
||||
|
||||
while (data.done == false) {
|
||||
@ -1133,10 +1130,10 @@ int orte_wait_event(opal_event_t **event, orte_trigger_event_t *trig,
|
||||
trig->channel = p[1];
|
||||
|
||||
/* define the event to fire when someone writes to the pipe */
|
||||
opal_event.set(opal_event_base, *event, p[0], OPAL_EV_READ, cbfunc, NULL);
|
||||
opal_event_set(opal_event_base, *event, p[0], OPAL_EV_READ, cbfunc, NULL);
|
||||
|
||||
/* Add it to the active events, without a timeout */
|
||||
opal_event.add(*event, NULL);
|
||||
opal_event_add(*event, NULL);
|
||||
|
||||
/* all done */
|
||||
return ORTE_SUCCESS;
|
||||
|
@ -189,7 +189,7 @@ ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_message_event_t);
|
||||
__FILE__, __LINE__)); \
|
||||
now.tv_sec = delay/1000000; \
|
||||
now.tv_usec = delay%1000000; \
|
||||
opal_event.evtimer_add(mev->ev, &now); \
|
||||
opal_event_evtimer_add(mev->ev, &now); \
|
||||
} while(0);
|
||||
|
||||
#if OPAL_ENABLE_DEBUG
|
||||
@ -208,11 +208,11 @@ ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_message_event_t);
|
||||
mev->tag = (tg); \
|
||||
mev->file = strdup((buf)->parent.cls_init_file_name); \
|
||||
mev->line = (buf)->parent.cls_init_lineno; \
|
||||
opal_event.evtimer_set(opal_event_base, \
|
||||
opal_event_evtimer_set(opal_event_base, \
|
||||
mev->ev, (cbfunc), mev); \
|
||||
now.tv_sec = 0; \
|
||||
now.tv_usec = 0; \
|
||||
opal_event.evtimer_add(mev->ev, &now); \
|
||||
opal_event_evtimer_add(mev->ev, &now); \
|
||||
} while(0);
|
||||
|
||||
#else
|
||||
@ -229,11 +229,11 @@ ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_message_event_t);
|
||||
mev->sender.vpid = (sndr)->vpid; \
|
||||
opal_dss.copy_payload(mev->buffer, (buf)); \
|
||||
mev->tag = (tg); \
|
||||
opal_event.evtimer_set(opal_event_base, \
|
||||
opal_event_evtimer_set(opal_event_base, \
|
||||
mev->ev, (cbfunc), mev); \
|
||||
now.tv_sec = 0; \
|
||||
now.tv_usec = 0; \
|
||||
opal_event.evtimer_add(mev->ev, &now); \
|
||||
opal_event_evtimer_add(mev->ev, &now); \
|
||||
} while(0);
|
||||
|
||||
#endif
|
||||
@ -256,14 +256,14 @@ ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_notify_event_t);
|
||||
tmp = OBJ_NEW(orte_notify_event_t); \
|
||||
tmp->proc.jobid = (data)->jobid; \
|
||||
tmp->proc.vpid = (data)->vpid; \
|
||||
opal_event.evtimer_set(opal_event_base, \
|
||||
opal_event_evtimer_set(opal_event_base, \
|
||||
tmp->ev, (cbfunc), tmp); \
|
||||
now.tv_sec = 0; \
|
||||
now.tv_usec = 0; \
|
||||
OPAL_OUTPUT_VERBOSE((1, orte_debug_output, \
|
||||
"defining notify event at %s:%d", \
|
||||
__FILE__, __LINE__)); \
|
||||
opal_event.evtimer_add(tmp->ev, &now); \
|
||||
opal_event_evtimer_add(tmp->ev, &now); \
|
||||
} while(0); \
|
||||
|
||||
/**
|
||||
@ -287,8 +287,8 @@ ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_notify_event_t);
|
||||
struct timeval now; \
|
||||
opal_event_t *tmp; \
|
||||
int timeout; \
|
||||
tmp = OBJ_NEW(opal_event_t); \
|
||||
opal_event.evtimer_set(opal_event_base, \
|
||||
tmp = (opal_event_t *) malloc(sizeof(opal_event_t)); \
|
||||
opal_event_evtimer_set(opal_event_base, \
|
||||
tmp, (cbfunc), tmp); \
|
||||
timeout = (deltat) * (n); \
|
||||
if ((maxwait) > 0 && timeout > (maxwait)) { \
|
||||
@ -300,7 +300,7 @@ ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_notify_event_t);
|
||||
"defining timeout: %ld sec %ld usec at %s:%d", \
|
||||
(long)now.tv_sec, (long)now.tv_usec, \
|
||||
__FILE__, __LINE__)); \
|
||||
opal_event.evtimer_add(tmp, &now); \
|
||||
opal_event_evtimer_add(tmp, &now); \
|
||||
*(event) = tmp; \
|
||||
}while(0); \
|
||||
|
||||
@ -314,8 +314,8 @@ ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_notify_event_t);
|
||||
do { \
|
||||
struct timeval now; \
|
||||
opal_event_t *tmp; \
|
||||
tmp = OBJ_NEW(opal_event_t); \
|
||||
opal_event.evtimer_set(opal_event_base, \
|
||||
tmp = (opal_event_t *) malloc(sizeof(opal_event_t)); \
|
||||
opal_event_evtimer_set(opal_event_base, \
|
||||
tmp, (cbfunc), tmp); \
|
||||
now.tv_sec = (sec); \
|
||||
now.tv_usec = (usec); \
|
||||
@ -323,7 +323,7 @@ ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_notify_event_t);
|
||||
"defining timer event: %ld sec %ld usec at %s:%d", \
|
||||
(long)now.tv_sec, (long)now.tv_usec, \
|
||||
__FILE__, __LINE__)); \
|
||||
opal_event.evtimer_add(tmp, &now); \
|
||||
opal_event_evtimer_add(tmp, &now); \
|
||||
}while(0); \
|
||||
|
||||
|
||||
|
@ -124,7 +124,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
orte_grpcomm.barrier(); /* ensure the public recv is ready */
|
||||
}
|
||||
opal_event.dispatch(opal_event_base);
|
||||
opal_event_dispatch(opal_event_base);
|
||||
|
||||
blast:
|
||||
orte_finalize();
|
||||
|
@ -40,7 +40,7 @@ int main(int argc, char* argv[])
|
||||
orte_sensor.start(ORTE_JOBID_INVALID);
|
||||
|
||||
/* just sit here, letting the sensors run */
|
||||
opal_event.dispatch(opal_event_base);
|
||||
opal_event_dispatch(opal_event_base);
|
||||
|
||||
orte_finalize();
|
||||
return 0;
|
||||
|
@ -22,7 +22,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
opal_output(0, "%s RUNNING", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
|
||||
|
||||
opal_event.dispatch(opal_event_base);
|
||||
opal_event_dispatch(opal_event_base);
|
||||
|
||||
orte_finalize();
|
||||
|
||||
|
@ -80,7 +80,7 @@ main(int argc, char **argv)
|
||||
opal_evtimer_add(ev[i], &tv);
|
||||
}
|
||||
|
||||
opal_event.dispatch();
|
||||
opal_event_dispatch();
|
||||
|
||||
opal_finalize();
|
||||
return (called < NEVENT);
|
||||
|
@ -217,14 +217,12 @@ main(int argc, char *argv[])
|
||||
* forward, we need to abort in a manner that allows us
|
||||
* to cleanup
|
||||
*/
|
||||
OBJ_CONSTRUCT(&term_handler, opal_event_t);
|
||||
opal_event.signal_set(opal_event_base, &term_handler, SIGTERM,
|
||||
opal_event_signal_set(opal_event_base, &term_handler, SIGTERM,
|
||||
abort_exit_callback, &term_handler);
|
||||
opal_event.signal_add(&term_handler, NULL);
|
||||
OBJ_CONSTRUCT(&int_handler, opal_event_t);
|
||||
opal_event.signal_set(opal_event_base, &int_handler, SIGINT,
|
||||
opal_event_signal_add(&term_handler, NULL);
|
||||
opal_event_signal_set(opal_event_base, &int_handler, SIGINT,
|
||||
abort_exit_callback, &int_handler);
|
||||
opal_event.signal_add(&int_handler, NULL);
|
||||
opal_event_signal_add(&int_handler, NULL);
|
||||
|
||||
/*
|
||||
* Get the list of available hnp's and setup contact info
|
||||
@ -278,7 +276,7 @@ main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* just wait until the abort is fired */
|
||||
opal_event.dispatch(opal_event_base);
|
||||
opal_event_dispatch(opal_event_base);
|
||||
|
||||
/***************
|
||||
* Cleanup
|
||||
@ -300,10 +298,8 @@ static void abort_exit_callback(int fd, short ign, void *arg)
|
||||
int ret;
|
||||
|
||||
/* Remove the TERM and INT signal handlers */
|
||||
opal_event.signal_del(&term_handler);
|
||||
OBJ_DESTRUCT(&term_handler);
|
||||
opal_event.signal_del(&int_handler);
|
||||
OBJ_DESTRUCT(&int_handler);
|
||||
opal_event_signal_del(&term_handler);
|
||||
opal_event_signal_del(&int_handler);
|
||||
|
||||
/* close the outstanding pull */
|
||||
if (ORTE_SUCCESS != (ret = orte_iof.close(&target_proc, ORTE_IOF_STDOUT))) {
|
||||
|
@ -271,14 +271,12 @@ main(int argc, char *argv[])
|
||||
* forward, we need to abort in a manner that allows us
|
||||
* to cleanup
|
||||
*/
|
||||
OBJ_CONSTRUCT(&term_handler, opal_event_t);
|
||||
opal_event.signal_set(opal_event_base, &term_handler, SIGTERM,
|
||||
opal_event_signal_set(opal_event_base, &term_handler, SIGTERM,
|
||||
abort_exit_callback, &term_handler);
|
||||
opal_event.signal_add(&term_handler, NULL);
|
||||
OBJ_CONSTRUCT(&int_handler, opal_event_t);
|
||||
opal_event.signal_set(opal_event_base, &int_handler, SIGINT,
|
||||
opal_event_signal_add(&term_handler, NULL);
|
||||
opal_event_signal_set(opal_event_base, &int_handler, SIGINT,
|
||||
abort_exit_callback, &int_handler);
|
||||
opal_event.signal_add(&int_handler, NULL);
|
||||
opal_event_signal_add(&int_handler, NULL);
|
||||
|
||||
/*
|
||||
* Must specify the mpirun pid
|
||||
@ -524,17 +522,15 @@ SEND:
|
||||
send_cmd(0, 0, NULL);
|
||||
|
||||
/* now wait until the termination event fires */
|
||||
opal_event.dispatch(opal_event_base);
|
||||
opal_event_dispatch(opal_event_base);
|
||||
|
||||
/***************
|
||||
* Cleanup
|
||||
***************/
|
||||
cleanup:
|
||||
/* Remove the TERM and INT signal handlers */
|
||||
opal_event.signal_del(&term_handler);
|
||||
OBJ_DESTRUCT(&term_handler);
|
||||
opal_event.signal_del(&int_handler);
|
||||
OBJ_DESTRUCT(&int_handler);
|
||||
opal_event_signal_del(&term_handler);
|
||||
opal_event_signal_del(&int_handler);
|
||||
|
||||
while (NULL != (item = opal_list_remove_first(&recvd_stats))) {
|
||||
OBJ_RELEASE(item);
|
||||
@ -554,9 +550,9 @@ static void abort_exit_callback(int fd, short ign, void *arg)
|
||||
opal_list_item_t *item;
|
||||
|
||||
/* Remove the TERM and INT signal handlers */
|
||||
opal_event.signal_del(&term_handler);
|
||||
opal_event_signal_del(&term_handler);
|
||||
OBJ_DESTRUCT(&term_handler);
|
||||
opal_event.signal_del(&int_handler);
|
||||
opal_event_signal_del(&int_handler);
|
||||
OBJ_DESTRUCT(&int_handler);
|
||||
|
||||
while (NULL != (item = opal_list_remove_first(&recvd_stats))) {
|
||||
|
@ -788,7 +788,7 @@ int orterun(int argc, char *argv[])
|
||||
orte_debugger.init_after_spawn(jdata);
|
||||
|
||||
/* now wait until the termination event fires */
|
||||
opal_event.dispatch(opal_event_base);
|
||||
opal_event_dispatch(opal_event_base);
|
||||
|
||||
/* we only reach this point by jumping there due
|
||||
* to an error - so just cleanup and leave
|
||||
|
@ -63,7 +63,7 @@ static void send_cbfunc(int status, orte_process_name_t* sender,
|
||||
{
|
||||
/* cancel the timer */
|
||||
if (NULL != quicktime) {
|
||||
opal_event.evtimer_del(quicktime);
|
||||
opal_event_evtimer_del(quicktime);
|
||||
OBJ_RELEASE(quicktime);
|
||||
}
|
||||
/* declare the work done */
|
||||
@ -78,7 +78,7 @@ static void recv_info(int status, orte_process_name_t* sender,
|
||||
|
||||
/* cancel the timer */
|
||||
if (NULL != quicktime) {
|
||||
opal_event.evtimer_del(quicktime);
|
||||
opal_event_evtimer_del(quicktime);
|
||||
OBJ_RELEASE(quicktime);
|
||||
}
|
||||
/* xfer the answer */
|
||||
@ -189,7 +189,7 @@ int orte_util_comm_report_event(orte_comm_event_t ev)
|
||||
NULL))) {
|
||||
/* cancel the timer */
|
||||
if (NULL != quicktime) {
|
||||
opal_event.evtimer_del(quicktime);
|
||||
opal_event_evtimer_del(quicktime);
|
||||
OBJ_RELEASE(quicktime);
|
||||
}
|
||||
ORTE_ERROR_LOG(rc);
|
||||
@ -276,7 +276,7 @@ int orte_util_comm_query_job_info(const orte_process_name_t *hnp, orte_jobid_t j
|
||||
NULL))) {
|
||||
/* cancel the timer */
|
||||
if (NULL != quicktime) {
|
||||
opal_event.evtimer_del(quicktime);
|
||||
opal_event_evtimer_del(quicktime);
|
||||
OBJ_RELEASE(quicktime);
|
||||
}
|
||||
ORTE_ERROR_LOG(ret);
|
||||
@ -382,7 +382,7 @@ int orte_util_comm_query_node_info(const orte_process_name_t *hnp, char *node,
|
||||
NULL))) {
|
||||
/* cancel the timer */
|
||||
if (NULL != quicktime) {
|
||||
opal_event.evtimer_del(quicktime);
|
||||
opal_event_evtimer_del(quicktime);
|
||||
OBJ_RELEASE(quicktime);
|
||||
}
|
||||
ORTE_ERROR_LOG(ret);
|
||||
@ -493,7 +493,7 @@ int orte_util_comm_query_proc_info(const orte_process_name_t *hnp, orte_jobid_t
|
||||
NULL))) {
|
||||
/* cancel the timer */
|
||||
if (NULL != quicktime) {
|
||||
opal_event.evtimer_del(quicktime);
|
||||
opal_event_evtimer_del(quicktime);
|
||||
OBJ_RELEASE(quicktime);
|
||||
}
|
||||
ORTE_ERROR_LOG(ret);
|
||||
|
@ -463,9 +463,9 @@ static int show_help(const char *filename, const char *topic,
|
||||
if (now > show_help_time_last_displayed + 5 && !show_help_timer_set) {
|
||||
show_accumulated_duplicates(0, 0, NULL);
|
||||
} else if (!show_help_timer_set) {
|
||||
opal_event.evtimer_set(opal_event_base, &show_help_timer_event,
|
||||
opal_event_evtimer_set(opal_event_base, &show_help_timer_event,
|
||||
show_accumulated_duplicates, NULL);
|
||||
opal_event.evtimer_add(&show_help_timer_event, &show_help_interval);
|
||||
opal_event_evtimer_add(&show_help_timer_event, &show_help_interval);
|
||||
show_help_timer_set = true;
|
||||
}
|
||||
}
|
||||
@ -581,11 +581,6 @@ int orte_show_help_init(void)
|
||||
}
|
||||
ready = true;
|
||||
|
||||
/* setup event */
|
||||
if (ORTE_PROC_IS_HNP) {
|
||||
OBJ_CONSTRUCT(&show_help_timer_event, opal_event_t);
|
||||
}
|
||||
|
||||
/* Show help duplicate detection */
|
||||
OBJ_CONSTRUCT(&abd_tuples, opal_list_t);
|
||||
|
||||
@ -604,7 +599,7 @@ void orte_show_help_finalize(void)
|
||||
show_accumulated_duplicates(0, 0, NULL);
|
||||
OBJ_DESTRUCT(&abd_tuples);
|
||||
if (show_help_timer_set) {
|
||||
opal_event.evtimer_del(&show_help_timer_event);
|
||||
opal_event_evtimer_del(&show_help_timer_event);
|
||||
}
|
||||
|
||||
/* cancel the recv */
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user