Skip to content

Commit 2d0dcae

Browse files
authored
Merge pull request #7018 from rhc54/cmr40/oob
v4.0.x: Cleanup stale code in ORTE/OOB
2 parents 2ea5548 + edbfcf0 commit 2d0dcae

10 files changed

+17
-96
lines changed

orte/mca/oob/base/base.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,12 @@ BEGIN_C_DECLS
5555
* Convenience Typedef
5656
*/
5757
typedef struct {
58-
opal_event_base_t *ev_base;
5958
char *include;
6059
char *exclude;
6160
opal_list_t components;
6261
opal_list_t actives;
6362
int max_uri_length;
6463
opal_hash_table_t peers;
65-
int num_threads;
6664
#if OPAL_ENABLE_TIMING
6765
bool timing;
6866
#endif
@@ -121,7 +119,7 @@ ORTE_DECLSPEC void orte_oob_base_send_nb(int fd, short args, void *cbdata);
121119
__FILE__, __LINE__); \
122120
cd = OBJ_NEW(orte_oob_send_t); \
123121
cd->msg = (m); \
124-
ORTE_THREADSHIFT(cd, orte_oob_base.ev_base, \
122+
ORTE_THREADSHIFT(cd, orte_event_base, \
125123
orte_oob_base_send_nb, ORTE_MSG_PRI); \
126124
}while(0)
127125

orte/mca/oob/base/oob_base_frame.c

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* reserved.
1616
* Copyright (c) 2015-2016 Research Organization for Information Science
1717
* and Technology (RIST). All rights reserved.
18-
* Copyright (c) 2017 Intel, Inc. All rights reserved.
18+
* Copyright (c) 2017-2019 Intel, Inc. All rights reserved.
1919
* $COPYRIGHT$
2020
*
2121
* Additional copyrights may follow
@@ -55,14 +55,6 @@ orte_oob_base_t orte_oob_base = {0};
5555

5656
static int orte_oob_base_register(mca_base_register_flag_t flags)
5757
{
58-
orte_oob_base.num_threads = 0;
59-
(void)mca_base_var_register("orte", "oob", "base", "num_progress_threads",
60-
"Number of independent progress OOB messages for each interface",
61-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
62-
OPAL_INFO_LVL_9,
63-
MCA_BASE_VAR_SCOPE_READONLY,
64-
&orte_oob_base.num_threads);
65-
6658
#if OPAL_ENABLE_TIMING
6759
/* Detailed timing setup */
6860
orte_oob_base.timing = false;
@@ -91,10 +83,6 @@ static int orte_oob_base_close(void)
9183
OBJ_RELEASE(cli);
9284
}
9385

94-
if (!ORTE_PROC_IS_APP && !ORTE_PROC_IS_TOOL) {
95-
opal_progress_thread_finalize("OOB-BASE");
96-
}
97-
9886
/* destruct our internal lists */
9987
OBJ_DESTRUCT(&orte_oob_base.actives);
10088

@@ -122,13 +110,6 @@ static int orte_oob_base_open(mca_base_open_flag_t flags)
122110
opal_hash_table_init(&orte_oob_base.peers, 128);
123111
OBJ_CONSTRUCT(&orte_oob_base.actives, opal_list_t);
124112

125-
if (ORTE_PROC_IS_APP || ORTE_PROC_IS_TOOL) {
126-
orte_oob_base.ev_base = orte_event_base;
127-
} else {
128-
orte_oob_base.ev_base = opal_progress_thread_init("OOB-BASE");
129-
}
130-
131-
132113
#if OPAL_ENABLE_FT_CR == 1
133114
/* register the FT events callback */
134115
orte_state.add_job_state(ORTE_JOB_STATE_FT_CHECKPOINT, orte_oob_base_ft_event, ORTE_ERROR_PRI);

orte/mca/oob/tcp/oob_tcp.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,6 @@ static void ping(const orte_process_name_t *proc)
141141
return;
142142
}
143143

144-
/* has this peer had a progress thread assigned yet? */
145-
if (NULL == peer->ev_base) {
146-
/* nope - assign one */
147-
ORTE_OOB_TCP_NEXT_BASE(peer);
148-
}
149-
150144
/* if we are already connected, there is nothing to do */
151145
if (MCA_OOB_TCP_CONNECTED == peer->state) {
152146
opal_output_verbose(2, orte_oob_base_framework.framework_output,
@@ -204,11 +198,7 @@ static void send_nb(orte_rml_send_t *msg)
204198
__FILE__, __LINE__,
205199
ORTE_NAME_PRINT(&msg->dst), msg->tag, msg->seq_num,
206200
ORTE_NAME_PRINT(&peer->name));
207-
/* has this peer had a progress thread assigned yet? */
208-
if (NULL == peer->ev_base) {
209-
/* nope - assign one */
210-
ORTE_OOB_TCP_NEXT_BASE(peer);
211-
}
201+
212202
/* add the msg to the hop's send queue */
213203
if (MCA_OOB_TCP_CONNECTED == peer->state) {
214204
opal_output_verbose(2, orte_oob_base_framework.framework_output,

orte/mca/oob/tcp/oob_tcp_component.c

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,8 @@ mca_oob_tcp_component_t mca_oob_tcp_component = {
147147
*/
148148
static int tcp_component_open(void)
149149
{
150-
mca_oob_tcp_component.next_base = 0;
151150
OBJ_CONSTRUCT(&mca_oob_tcp_component.peers, opal_hash_table_t);
152151
opal_hash_table_init(&mca_oob_tcp_component.peers, 32);
153-
OBJ_CONSTRUCT(&mca_oob_tcp_component.ev_bases, opal_pointer_array_t);
154-
opal_pointer_array_init(&mca_oob_tcp_component.ev_bases,
155-
orte_oob_base.num_threads, 256, 8);
156152

157153
OBJ_CONSTRUCT(&mca_oob_tcp_component.listeners, opal_list_t);
158154
if (ORTE_PROC_IS_HNP) {
@@ -206,8 +202,6 @@ static int tcp_component_close(void)
206202
}
207203
#endif
208204

209-
OBJ_DESTRUCT(&mca_oob_tcp_component.ev_bases);
210-
211205
return ORTE_SUCCESS;
212206
}
213207
static char *static_port_string;
@@ -664,27 +658,11 @@ static orte_rml_pathway_t* component_query_transports(void)
664658
static int component_startup(void)
665659
{
666660
int rc = ORTE_SUCCESS;
667-
int i;
668-
char *tmp;
669-
opal_event_base_t *evb;
670661

671662
opal_output_verbose(2, orte_oob_base_framework.framework_output,
672663
"%s TCP STARTUP",
673664
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
674665

675-
/* initialize state */
676-
if (0 == orte_oob_base.num_threads) {
677-
opal_pointer_array_add(&mca_oob_tcp_component.ev_bases, orte_oob_base.ev_base);
678-
} else {
679-
for (i=0; i < orte_oob_base.num_threads; i++) {
680-
asprintf(&tmp, "OOB-TCP-%d", i);
681-
evb = opal_progress_thread_init(tmp);
682-
opal_pointer_array_add(&mca_oob_tcp_component.ev_bases, evb);
683-
opal_argv_append_nosize(&mca_oob_tcp_component.ev_threads, tmp);
684-
free(tmp);
685-
}
686-
}
687-
688666
/* if we are a daemon/HNP, or we are a standalone app,
689667
* then it is possible that someone else may initiate a
690668
* connection to us. In these cases, we need to start the
@@ -712,14 +690,6 @@ static void component_shutdown(void)
712690
"%s TCP SHUTDOWN",
713691
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
714692

715-
if (0 < orte_oob_base.num_threads) {
716-
for (i=0; i < orte_oob_base.num_threads; i++) {
717-
opal_progress_thread_finalize(mca_oob_tcp_component.ev_threads[i]);
718-
opal_pointer_array_set_item(&mca_oob_tcp_component.ev_bases, i, NULL);
719-
}
720-
opal_argv_free(mca_oob_tcp_component.ev_threads);
721-
}
722-
723693
if (ORTE_PROC_IS_HNP && mca_oob_tcp_component.listen_thread_active) {
724694
mca_oob_tcp_component.listen_thread_active = false;
725695
/* tell the thread to exit */
@@ -1366,7 +1336,6 @@ static char **split_and_resolve(char **orig_str, char *name)
13661336

13671337
static void peer_cons(mca_oob_tcp_peer_t *peer)
13681338
{
1369-
peer->ev_base = NULL;
13701339
peer->auth_method = NULL;
13711340
peer->sd = -1;
13721341
OBJ_CONSTRUCT(&peer->addrs, opal_list_t);

orte/mca/oob/tcp/oob_tcp_component.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Copyright (c) 2006-2013 Los Alamos National Security, LLC.
1313
* All rights reserved.
1414
* Copyright (c) 2010-2011 Cisco Systems, Inc. All rights reserved.
15-
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
15+
* Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
1616
* $COPYRIGHT$
1717
*
1818
* Additional copyrights may follow
@@ -48,9 +48,6 @@ typedef struct {
4848
int max_retries; /**< max number of retries before declaring peer gone */
4949
opal_list_t events; /**< events for monitoring connections */
5050
int peer_limit; /**< max size of tcp peer cache */
51-
opal_pointer_array_t ev_bases; // event base array for progress threads
52-
char** ev_threads; // event progress thread names
53-
int next_base; // counter to load-level thread use
5451
opal_hash_table_t peers; // connection addresses for peers
5552

5653
/* Port specifications */
@@ -96,13 +93,4 @@ ORTE_MODULE_DECLSPEC void mca_oob_tcp_component_failed_to_connect(int fd, short
9693
ORTE_MODULE_DECLSPEC void mca_oob_tcp_component_no_route(int fd, short args, void *cbdata);
9794
ORTE_MODULE_DECLSPEC void mca_oob_tcp_component_hop_unknown(int fd, short args, void *cbdata);
9895

99-
#define ORTE_OOB_TCP_NEXT_BASE(p) \
100-
do { \
101-
++mca_oob_tcp_component.next_base; \
102-
if (orte_oob_base.num_threads <= mca_oob_tcp_component.next_base) { \
103-
mca_oob_tcp_component.next_base = 0; \
104-
} \
105-
(p)->ev_base = (opal_event_base_t*)opal_pointer_array_get_item(&mca_oob_tcp_component.ev_bases, mca_oob_tcp_component.next_base); \
106-
} while(0)
107-
10896
#endif /* _MCA_OOB_TCP_COMPONENT_H_ */

orte/mca/oob/tcp/oob_tcp_connection.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -515,10 +515,7 @@ static void tcp_peer_event_init(mca_oob_tcp_peer_t* peer)
515515
{
516516
if (peer->sd >= 0) {
517517
assert(!peer->send_ev_active && !peer->recv_ev_active);
518-
if (NULL == peer->ev_base) {
519-
ORTE_OOB_TCP_NEXT_BASE(peer);
520-
}
521-
opal_event_set(peer->ev_base,
518+
opal_event_set(orte_event_base,
522519
&peer->recv_event,
523520
peer->sd,
524521
OPAL_EV_READ|OPAL_EV_PERSIST,
@@ -530,7 +527,7 @@ static void tcp_peer_event_init(mca_oob_tcp_peer_t* peer)
530527
peer->recv_ev_active = false;
531528
}
532529

533-
opal_event_set(peer->ev_base,
530+
opal_event_set(orte_event_base,
534531
&peer->send_event,
535532
peer->sd,
536533
OPAL_EV_WRITE|OPAL_EV_PERSIST,
@@ -811,7 +808,6 @@ int mca_oob_tcp_peer_recv_connect_ack(mca_oob_tcp_peer_t* pr,
811808
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
812809
peer = OBJ_NEW(mca_oob_tcp_peer_t);
813810
peer->name = hdr.origin;
814-
ORTE_OOB_TCP_NEXT_BASE(peer); // assign it an event base
815811
peer->state = MCA_OOB_TCP_ACCEPTING;
816812
ui64 = (uint64_t*)(&peer->name);
817813
if (OPAL_SUCCESS != opal_hash_table_set_value_uint64(&mca_oob_tcp_component.peers, (*ui64), peer)) {

orte/mca/oob/tcp/oob_tcp_connection.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Copyright (c) 2006-2013 Los Alamos National Security, LLC.
1313
* All rights reserved.
1414
* Copyright (c) 2010-2011 Cisco Systems, Inc. All rights reserved.
15-
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
15+
* Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
1616
* $COPYRIGHT$
1717
*
1818
* Additional copyrights may follow
@@ -60,14 +60,14 @@ OBJ_CLASS_DECLARATION(mca_oob_tcp_conn_op_t);
6060
ORTE_NAME_PRINT((&(p)->name))); \
6161
cop = OBJ_NEW(mca_oob_tcp_conn_op_t); \
6262
cop->peer = (p); \
63-
ORTE_THREADSHIFT(cop, (p)->ev_base, (cbfunc), ORTE_MSG_PRI); \
63+
ORTE_THREADSHIFT(cop, orte_event_base, (cbfunc), ORTE_MSG_PRI); \
6464
} while(0);
6565

6666
#define ORTE_ACTIVATE_TCP_ACCEPT_STATE(s, a, cbfunc) \
6767
do { \
6868
mca_oob_tcp_conn_op_t *cop; \
6969
cop = OBJ_NEW(mca_oob_tcp_conn_op_t); \
70-
opal_event_set(orte_oob_base.ev_base, &cop->ev, s, \
70+
opal_event_set(orte_event_base, &cop->ev, s, \
7171
OPAL_EV_READ, (cbfunc), cop); \
7272
opal_event_set_priority(&cop->ev, ORTE_MSG_PRI); \
7373
ORTE_POST_OBJECT(cop); \
@@ -84,7 +84,7 @@ OBJ_CLASS_DECLARATION(mca_oob_tcp_conn_op_t);
8484
ORTE_NAME_PRINT((&(p)->name))); \
8585
cop = OBJ_NEW(mca_oob_tcp_conn_op_t); \
8686
cop->peer = (p); \
87-
opal_event_evtimer_set((p)->ev_base, \
87+
opal_event_evtimer_set(orte_event_base, \
8888
&cop->ev, \
8989
(cbfunc), cop); \
9090
ORTE_POST_OBJECT(cop); \

orte/mca/oob/tcp/oob_tcp_listener.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ int orte_oob_tcp_start_listening(void)
157157
/* otherwise, setup to listen via the event lib */
158158
OPAL_LIST_FOREACH(listener, &mca_oob_tcp_component.listeners, mca_oob_tcp_listener_t) {
159159
listener->ev_active = true;
160-
opal_event_set(orte_oob_base.ev_base, &listener->event,
160+
opal_event_set(orte_event_base, &listener->event,
161161
listener->sd,
162162
OPAL_EV_READ|OPAL_EV_PERSIST,
163163
connection_event_handler,
@@ -744,7 +744,7 @@ static void* listen_thread(opal_object_t *obj)
744744
* OS might start rejecting connections due to timeout.
745745
*/
746746
pending_connection = OBJ_NEW(mca_oob_tcp_pending_connection_t);
747-
opal_event_set(orte_oob_base.ev_base, &pending_connection->ev, -1,
747+
opal_event_set(orte_event_base, &pending_connection->ev, -1,
748748
OPAL_EV_WRITE, connection_handler, pending_connection);
749749
opal_event_set_priority(&pending_connection->ev, ORTE_MSG_PRI);
750750
pending_connection->fd = accept(sd,

orte/mca/oob/tcp/oob_tcp_peer.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ typedef struct {
5252
mca_oob_tcp_addr_t *active_addr;
5353
mca_oob_tcp_state_t state;
5454
int num_retries;
55-
opal_event_base_t *ev_base; // progress thread this peer is assigned to
5655
opal_event_t send_event; /**< registration with event thread for send events */
5756
bool send_ev_active;
5857
opal_event_t recv_event; /**< registration with event thread for recv events */
@@ -88,7 +87,7 @@ OBJ_CLASS_DECLARATION(mca_oob_tcp_peer_op_t);
8887
if (NULL != proxy) { \
8988
pop->rtmod = strdup(proxy); \
9089
} \
91-
ORTE_THREADSHIFT(pop, orte_oob_base.ev_base, \
90+
ORTE_THREADSHIFT(pop, orte_event_base, \
9291
(cbfunc), ORTE_MSG_PRI); \
9392
} while(0);
9493

orte/mca/oob/tcp/oob_tcp_sendrecv.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ OBJ_CLASS_DECLARATION(mca_oob_tcp_recv_t);
8282
do { \
8383
(s)->peer = (struct mca_oob_tcp_peer_t*)(p); \
8484
(s)->activate = (f); \
85-
ORTE_THREADSHIFT((s), (p)->ev_base, \
85+
ORTE_THREADSHIFT((s), orte_event_base, \
8686
mca_oob_tcp_queue_msg, ORTE_MSG_PRI); \
8787
} while(0)
8888

@@ -235,7 +235,7 @@ OBJ_CLASS_DECLARATION(mca_oob_tcp_msg_op_t);
235235
ORTE_NAME_PRINT(&((ms)->dst))); \
236236
mop = OBJ_NEW(mca_oob_tcp_msg_op_t); \
237237
mop->msg = (ms); \
238-
ORTE_THREADSHIFT(mop, (ms)->peer->ev_base, \
238+
ORTE_THREADSHIFT(mop, orte_event_base, \
239239
(cbfunc), ORTE_MSG_PRI); \
240240
} while(0);
241241

@@ -281,7 +281,7 @@ OBJ_CLASS_DECLARATION(mca_oob_tcp_msg_error_t);
281281
mop->hop.jobid = (h)->jobid; \
282282
mop->hop.vpid = (h)->vpid; \
283283
/* this goes to the OOB framework, so use that event base */ \
284-
ORTE_THREADSHIFT(mop, orte_oob_base.ev_base, \
284+
ORTE_THREADSHIFT(mop, orte_event_base, \
285285
(cbfunc), ORTE_MSG_PRI); \
286286
} while(0)
287287

@@ -299,7 +299,7 @@ OBJ_CLASS_DECLARATION(mca_oob_tcp_msg_error_t);
299299
mop->hop.vpid = (h)->vpid; \
300300
/* this goes to the component, so use the framework \
301301
* event base */ \
302-
ORTE_THREADSHIFT(mop, orte_oob_base.ev_base, \
302+
ORTE_THREADSHIFT(mop, orte_event_base, \
303303
(c), ORTE_MSG_PRI); \
304304
} while(0)
305305

0 commit comments

Comments
 (0)