Skip to content

Commit de5086c

Browse files
committed
Merge pull request open-mpi#670 from jsquyres/pr/v2.0.0/opal-progress-thread
Bring over opal_progress_thread from master
2 parents a0d2a93 + 34cef64 commit de5086c

File tree

23 files changed

+280
-186
lines changed

23 files changed

+280
-186
lines changed

ompi/mca/crcp/bkmrk/crcp_bkmrk_pml.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Copyright (c) 2010-2012 Oracle and/or its affiliates. All rights reserved.
99
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
1010
* reserved.
11+
* Copyright (c) 2015 Intel, Inc. All rights reserved.
1112
* $COPYRIGHT$
1213
*
1314
* Additional copyrights may follow
@@ -32,7 +33,6 @@
3233

3334
#include "opal/util/opal_environ.h"
3435
#include "ompi/mca/mca.h"
35-
#include "opal/mca/base/base.h"
3636
#include "opal/mca/pmix/pmix.h"
3737

3838
#include "ompi/request/request.h"
@@ -4440,7 +4440,7 @@ static int ft_event_exchange_bookmarks(void)
44404440
/* Wait for all bookmarks to arrive */
44414441
START_TIMER(CRCP_TIMER_CKPT_EX_WAIT);
44424442
while( total_recv_bookmarks > 0 ) {
4443-
opal_event_loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
4443+
opal_event_loop(opal_sync_event_base, OPAL_EVLOOP_NONBLOCK);
44444444
}
44454445
total_recv_bookmarks = 0;
44464446
END_TIMER(CRCP_TIMER_CKPT_EX_WAIT);
@@ -5227,7 +5227,7 @@ static int wait_quiesce_drain_ack(void)
52275227
}
52285228
}
52295229

5230-
opal_event_loop(opal_event_base, OPAL_EVLOOP_NONBLOCK);
5230+
opal_event_loop(opal_sync_event_base, OPAL_EVLOOP_NONBLOCK);
52315231
}
52325232

52335233
/* Clear the ack queue if it isn't already clear (it should already be) */

opal/mca/btl/openib/btl_openib_fd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static int service_pipe_cmd_add_fd(bool use_libevent, cmd_t *cmd)
175175
if (use_libevent) {
176176
/* Make an event for this fd */
177177
ri->ri_event_used = true;
178-
opal_event_set(opal_event_base, &ri->ri_event, ri->ri_fd,
178+
opal_event_set(opal_sync_event_base, &ri->ri_event, ri->ri_fd,
179179
ri->ri_flags | OPAL_EV_PERSIST, service_fd_callback,
180180
ri);
181181
opal_event_add(&ri->ri_event, 0);
@@ -501,7 +501,7 @@ int opal_btl_openib_fd_init(void)
501501

502502
/* Create a libevent event that is used in the main thread
503503
to watch its pipe */
504-
opal_event_set(opal_event_base, &main_thread_event, pipe_to_main_thread[0],
504+
opal_event_set(opal_sync_event_base, &main_thread_event, pipe_to_main_thread[0],
505505
OPAL_EV_READ | OPAL_EV_PERSIST,
506506
main_thread_event_callback, NULL);
507507
opal_event_add(&main_thread_event, 0);

opal/mca/btl/openib/connect/btl_openib_connect_udcm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2207,7 +2207,7 @@ static void udcm_sent_message_constructor (udcm_message_sent_t *message)
22072207
{
22082208
memset ((char *)message + sizeof (message->super), 0,
22092209
sizeof (*message) - sizeof (message->super));
2210-
opal_event_evtimer_set(opal_event_base, &message->event, udcm_send_timeout, message);
2210+
opal_event_evtimer_set(opal_sync_event_base, &message->event, udcm_send_timeout, message);
22112211
}
22122212

22132213
static void udcm_sent_message_destructor (udcm_message_sent_t *message)

opal/mca/btl/tcp/btl_tcp_component.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ static int mca_btl_tcp_component_create_listen(uint16_t af_family)
819819
/* register listen port */
820820
#if OPAL_ENABLE_IPV6
821821
if (AF_INET6 == af_family) {
822-
opal_event_set(opal_event_base, &mca_btl_tcp_component.tcp6_recv_event,
822+
opal_event_set(opal_sync_event_base, &mca_btl_tcp_component.tcp6_recv_event,
823823
mca_btl_tcp_component.tcp6_listen_sd,
824824
OPAL_EV_READ|OPAL_EV_PERSIST,
825825
mca_btl_tcp_component_accept_handler,
@@ -828,7 +828,7 @@ static int mca_btl_tcp_component_create_listen(uint16_t af_family)
828828
} else
829829
#endif
830830
{
831-
opal_event_set(opal_event_base, &mca_btl_tcp_component.tcp_recv_event,
831+
opal_event_set(opal_sync_event_base, &mca_btl_tcp_component.tcp_recv_event,
832832
mca_btl_tcp_component.tcp_listen_sd,
833833
OPAL_EV_READ|OPAL_EV_PERSIST,
834834
mca_btl_tcp_component_accept_handler,
@@ -1050,7 +1050,7 @@ static void mca_btl_tcp_component_accept_handler( int incoming_sd,
10501050

10511051
/* wait for receipt of peers process identifier to complete this connection */
10521052
event = OBJ_NEW(mca_btl_tcp_event_t);
1053-
opal_event_set(opal_event_base, &event->event, sd, OPAL_EV_READ, mca_btl_tcp_component_recv_handler, event);
1053+
opal_event_set(opal_sync_event_base, &event->event, sd, OPAL_EV_READ, mca_btl_tcp_component_recv_handler, event);
10541054
opal_event_add(&event->event, 0);
10551055
}
10561056
}

opal/mca/btl/tcp/btl_tcp_endpoint.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ static inline void mca_btl_tcp_endpoint_event_init(mca_btl_base_endpoint_t* btl_
309309
btl_endpoint->endpoint_cache_pos = btl_endpoint->endpoint_cache;
310310
#endif /* MCA_BTL_TCP_ENDPOINT_CACHE */
311311

312-
opal_event_set(opal_event_base, &btl_endpoint->endpoint_recv_event,
312+
opal_event_set(opal_sync_event_base, &btl_endpoint->endpoint_recv_event,
313313
btl_endpoint->endpoint_sd,
314314
OPAL_EV_READ|OPAL_EV_PERSIST,
315315
mca_btl_tcp_endpoint_recv_handler,
@@ -320,7 +320,7 @@ static inline void mca_btl_tcp_endpoint_event_init(mca_btl_base_endpoint_t* btl_
320320
* will be fired only once, and when the endpoint is marked as
321321
* CONNECTED the event should be recreated with the correct flags.
322322
*/
323-
opal_event_set(opal_event_base, &btl_endpoint->endpoint_send_event,
323+
opal_event_set(opal_sync_event_base, &btl_endpoint->endpoint_send_event,
324324
btl_endpoint->endpoint_sd,
325325
OPAL_EV_WRITE,
326326
mca_btl_tcp_endpoint_send_handler,
@@ -509,7 +509,7 @@ void mca_btl_tcp_endpoint_accept(mca_btl_base_endpoint_t* btl_endpoint,
509509
assert(btl_endpoint->endpoint_sd_next == -1);
510510
btl_endpoint->endpoint_sd_next = sd;
511511

512-
opal_event_evtimer_set(opal_event_base, &btl_endpoint->endpoint_accept_event,
512+
opal_event_evtimer_set(opal_sync_event_base, &btl_endpoint->endpoint_accept_event,
513513
mca_btl_tcp_endpoint_complete_accept, btl_endpoint);
514514
opal_event_add(&btl_endpoint->endpoint_accept_event, &now);
515515
}
@@ -570,7 +570,7 @@ static void mca_btl_tcp_endpoint_connected(mca_btl_base_endpoint_t* btl_endpoint
570570
MCA_BTL_TCP_ENDPOINT_DUMP(1, btl_endpoint, true, "READY [endpoint_connected]");
571571

572572
/* Create the send event in a persistent manner. */
573-
opal_event_set(opal_event_base, &btl_endpoint->endpoint_send_event,
573+
opal_event_set(opal_sync_event_base, &btl_endpoint->endpoint_send_event,
574574
btl_endpoint->endpoint_sd,
575575
OPAL_EV_WRITE | OPAL_EV_PERSIST,
576576
mca_btl_tcp_endpoint_send_handler,

opal/mca/btl/usnic/btl_usnic_component.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ static mca_btl_base_module_t** usnic_component_init(int* num_btl_modules,
10181018
}
10191019

10201020
/* start timer to guarantee synthetic clock advances */
1021-
opal_event_set(opal_event_base, &usnic_clock_timer_event,
1021+
opal_event_set(opal_sync_event_base, &usnic_clock_timer_event,
10221022
-1, 0, usnic_clock_callback,
10231023
&usnic_clock_timeout);
10241024
usnic_clock_timer_event_set = true;

opal/mca/btl/usnic/btl_usnic_endpoint.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ static void endpoint_construct(mca_btl_base_endpoint_t* endpoint)
8686
OBJ_CONSTRUCT(&endpoint->endpoint_hotel, opal_hotel_t);
8787
opal_hotel_init(&endpoint->endpoint_hotel,
8888
WINDOW_SIZE,
89+
opal_sync_event_base,
8990
mca_btl_usnic_component.retrans_timeout,
9091
0,
9192
opal_btl_usnic_ack_timeout);

opal/mca/btl/usnic/btl_usnic_module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2102,7 +2102,7 @@ static void init_async_event(opal_btl_usnic_module_t *module)
21022102
}
21032103

21042104
/* Get the fd to receive events on this device */
2105-
opal_event_set(opal_event_base, &(module->device_async_event), fd,
2105+
opal_event_set(opal_sync_event_base, &(module->device_async_event), fd,
21062106
OPAL_EV_READ | OPAL_EV_PERSIST,
21072107
module_async_event_callback, module);
21082108
opal_event_add(&(module->device_async_event), NULL);

opal/mca/btl/usnic/btl_usnic_stats.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ int opal_btl_usnic_stats_init(opal_btl_usnic_module_t *module)
212212
module->stats.timeout.tv_sec = mca_btl_usnic_component.stats_frequency;
213213
module->stats.timeout.tv_usec = 0;
214214

215-
opal_event_set(opal_event_base, &(module->stats.timer_event),
215+
opal_event_set(opal_sync_event_base, &(module->stats.timer_event),
216216
-1, EV_TIMEOUT | EV_PERSIST,
217217
&usnic_stats_callback, module);
218218
opal_event_add(&(module->stats.timer_event),

opal/mca/event/base/event_base_frame.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
3-
* Copyright (c) 2014 Intel, Inc. All rights reserved.
2+
* Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved.
3+
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
44
* $COPYRIGHT$
55
*
66
* Additional copyrights may follow
@@ -64,7 +64,7 @@ static int opal_event_base_close(void)
6464
/*
6565
* Globals
6666
*/
67-
opal_event_base_t *opal_event_base=NULL;
67+
opal_event_base_t *opal_sync_event_base=NULL;
6868

6969
static int opal_event_base_open(mca_base_open_flag_t flags)
7070
{
@@ -84,13 +84,13 @@ static int opal_event_base_open(mca_base_open_flag_t flags)
8484
opal_event_use_threads();
8585

8686
/* get our event base */
87-
if (NULL == (opal_event_base = opal_event_base_create())) {
87+
if (NULL == (opal_sync_event_base = opal_event_base_create())) {
8888
return OPAL_ERROR;
8989
}
9090

9191
/* set the number of priorities */
9292
if (0 < OPAL_EVENT_NUM_PRI) {
93-
opal_event_base_priority_init(opal_event_base, OPAL_EVENT_NUM_PRI);
93+
opal_event_base_priority_init(opal_sync_event_base, OPAL_EVENT_NUM_PRI);
9494
}
9595

9696
return rc;

0 commit comments

Comments
 (0)