Skip to content

Commit d03ccec

Browse files
authored
Merge pull request #7014 from rhc54/cmr30/oob
v3.0.x: Cleanup stale code in ORTE/OOB
2 parents 3ee28a5 + 0766559 commit d03ccec

File tree

11 files changed

+17
-98
lines changed

11 files changed

+17
-98
lines changed

opal/mca/pmix/pmix2x/pmix/src/mca/pnet/base/pnet_base_fns.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ void pmix_pnet_base_child_finalized(pmix_peer_t *peer)
110110

111111
/* protect against bozo inputs */
112112
if (NULL == peer) {
113-
PMIX_ERROR_LOG(PMIX_ERR_BAD_PARAM);
114113
return;
115114
}
116115

@@ -133,7 +132,6 @@ void pmix_pnet_base_local_app_finalized(char *nspace)
133132

134133
/* protect against bozo inputs */
135134
if (NULL == nspace) {
136-
PMIX_ERROR_LOG(PMIX_ERR_BAD_PARAM);
137135
return;
138136
}
139137

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
@@ -143,12 +143,8 @@ mca_oob_tcp_component_t mca_oob_tcp_component = {
143143
*/
144144
static int tcp_component_open(void)
145145
{
146-
mca_oob_tcp_component.next_base = 0;
147146
OBJ_CONSTRUCT(&mca_oob_tcp_component.peers, opal_hash_table_t);
148147
opal_hash_table_init(&mca_oob_tcp_component.peers, 32);
149-
OBJ_CONSTRUCT(&mca_oob_tcp_component.ev_bases, opal_pointer_array_t);
150-
opal_pointer_array_init(&mca_oob_tcp_component.ev_bases,
151-
orte_oob_base.num_threads, 256, 8);
152148

153149
OBJ_CONSTRUCT(&mca_oob_tcp_component.listeners, opal_list_t);
154150
if (ORTE_PROC_IS_HNP) {
@@ -205,8 +201,6 @@ static int tcp_component_close(void)
205201
}
206202
#endif
207203

208-
OBJ_DESTRUCT(&mca_oob_tcp_component.ev_bases);
209-
210204
return ORTE_SUCCESS;
211205
}
212206
static char *static_port_string;
@@ -658,27 +652,11 @@ static orte_rml_pathway_t* component_query_transports(void)
658652
static int component_startup(void)
659653
{
660654
int rc = ORTE_SUCCESS;
661-
int i;
662-
char *tmp;
663-
opal_event_base_t *evb;
664655

665656
opal_output_verbose(2, orte_oob_base_framework.framework_output,
666657
"%s TCP STARTUP",
667658
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
668659

669-
/* initialize state */
670-
if (0 == orte_oob_base.num_threads) {
671-
opal_pointer_array_add(&mca_oob_tcp_component.ev_bases, orte_oob_base.ev_base);
672-
} else {
673-
for (i=0; i < orte_oob_base.num_threads; i++) {
674-
asprintf(&tmp, "OOB-TCP-%d", i);
675-
evb = opal_progress_thread_init(tmp);
676-
opal_pointer_array_add(&mca_oob_tcp_component.ev_bases, evb);
677-
opal_argv_append_nosize(&mca_oob_tcp_component.ev_threads, tmp);
678-
free(tmp);
679-
}
680-
}
681-
682660
/* if we are a daemon/HNP, or we are a standalone app,
683661
* then it is possible that someone else may initiate a
684662
* connection to us. In these cases, we need to start the
@@ -706,14 +684,6 @@ static void component_shutdown(void)
706684
"%s TCP SHUTDOWN",
707685
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
708686

709-
if (0 < orte_oob_base.num_threads) {
710-
for (i=0; i < orte_oob_base.num_threads; i++) {
711-
opal_progress_thread_finalize(mca_oob_tcp_component.ev_threads[i]);
712-
opal_pointer_array_set_item(&mca_oob_tcp_component.ev_bases, i, NULL);
713-
}
714-
opal_argv_free(mca_oob_tcp_component.ev_threads);
715-
}
716-
717687
if (ORTE_PROC_IS_HNP && mca_oob_tcp_component.listen_thread_active) {
718688
mca_oob_tcp_component.listen_thread_active = false;
719689
/* tell the thread to exit */
@@ -1348,7 +1318,6 @@ static char **split_and_resolve(char **orig_str, char *name)
13481318

13491319
static void peer_cons(mca_oob_tcp_peer_t *peer)
13501320
{
1351-
peer->ev_base = NULL;
13521321
peer->auth_method = NULL;
13531322
peer->sd = -1;
13541323
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
@@ -492,10 +492,7 @@ static void tcp_peer_event_init(mca_oob_tcp_peer_t* peer)
492492
{
493493
if (peer->sd >= 0) {
494494
assert(!peer->send_ev_active && !peer->recv_ev_active);
495-
if (NULL == peer->ev_base) {
496-
ORTE_OOB_TCP_NEXT_BASE(peer);
497-
}
498-
opal_event_set(peer->ev_base,
495+
opal_event_set(orte_event_base,
499496
&peer->recv_event,
500497
peer->sd,
501498
OPAL_EV_READ|OPAL_EV_PERSIST,
@@ -507,7 +504,7 @@ static void tcp_peer_event_init(mca_oob_tcp_peer_t* peer)
507504
peer->recv_ev_active = false;
508505
}
509506

510-
opal_event_set(peer->ev_base,
507+
opal_event_set(orte_event_base,
511508
&peer->send_event,
512509
peer->sd,
513510
OPAL_EV_WRITE|OPAL_EV_PERSIST,
@@ -787,7 +784,6 @@ int mca_oob_tcp_peer_recv_connect_ack(mca_oob_tcp_peer_t* pr,
787784
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
788785
peer = OBJ_NEW(mca_oob_tcp_peer_t);
789786
peer->name = hdr.origin;
790-
ORTE_OOB_TCP_NEXT_BASE(peer); // assign it an event base
791787
peer->state = MCA_OOB_TCP_ACCEPTING;
792788
ui64 = (uint64_t*)(&peer->name);
793789
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,
@@ -742,7 +742,7 @@ static void* listen_thread(opal_object_t *obj)
742742
* OS might start rejecting connections due to timeout.
743743
*/
744744
pending_connection = OBJ_NEW(mca_oob_tcp_pending_connection_t);
745-
opal_event_set(orte_oob_base.ev_base, &pending_connection->ev, -1,
745+
opal_event_set(orte_event_base, &pending_connection->ev, -1,
746746
OPAL_EV_WRITE, connection_handler, pending_connection);
747747
opal_event_set_priority(&pending_connection->ev, ORTE_MSG_PRI);
748748
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)