1616 * Copyright (c) 2011 Oak Ridge National Labs. All rights reserved.
1717 * Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
1818 * Copyright (c) 2014 NVIDIA Corporation. All rights reserved.
19- * Copyright (c) 2015 Research Organization for Information Science
20- * and Technology (RIST). All rights reserved.
2119 * $COPYRIGHT$
2220 *
2321 * Additional copyrights may follow
7068#include "orte/util/parse_options.h"
7169#include "orte/util/show_help.h"
7270#include "orte/runtime/orte_globals.h"
73- #include "orte/runtime/orte_wait.h"
7471
7572#include "orte/mca/oob/tcp/oob_tcp.h"
7673#include "orte/mca/oob/tcp/oob_tcp_component.h"
@@ -633,22 +630,10 @@ static int component_startup(void)
633630 return rc ;
634631}
635632
636- static void cleanup (int sd , short args , void * cbdata )
637- {
638- opal_list_item_t * item ;
639- bool * active = (bool * )cbdata ;
640- while (NULL != (item = opal_list_remove_first (& mca_oob_tcp_component .listeners ))) {
641- OBJ_RELEASE (item );
642- }
643- if (NULL != active ) {
644- * active = false;
645- }
646- }
647-
648633static void component_shutdown (void )
649634{
650635 int i = 0 ;
651- bool active ;
636+ opal_list_item_t * item ;
652637
653638 opal_output_verbose (2 , orte_oob_base_framework .framework_output ,
654639 "%s TCP SHUTDOWN" ,
@@ -659,37 +644,16 @@ static void component_shutdown(void)
659644 /* tell the thread to exit */
660645 write (mca_oob_tcp_component .stop_thread [1 ], & i , sizeof (int ));
661646 opal_thread_join (& mca_oob_tcp_component .listen_thread , NULL );
662- } else {
663- opal_output_verbose (2 , orte_oob_base_framework .framework_output ,
664- "no hnp or not active" );
665647 }
666648
667- /* because the listeners are in a separate
668- * async thread for apps, we can't just release them here.
669- * Instead, we push it into that event thread and release
670- * them there */
671- if (ORTE_PROC_IS_APP ) {
672- opal_event_t ev ;
673- active = true;
674- opal_event_set (orte_event_base , & ev , -1 ,
675- OPAL_EV_WRITE , cleanup , & active );
676- opal_event_set_priority (& ev , ORTE_ERROR_PRI );
677- opal_event_active (& ev , OPAL_EV_WRITE , 1 );
678- ORTE_WAIT_FOR_COMPLETION (active );
679- } else {
680- /* we can call the destruct directly */
681- cleanup (0 , 0 , NULL );
682- }
683- opal_output_verbose (2 , orte_oob_base_framework .framework_output ,
684- "all listeners released" );
649+ while (NULL != (item = opal_list_remove_first (& mca_oob_tcp_component .listeners ))) {
650+ OBJ_RELEASE (item );
651+ }
685652
686653 /* shutdown the module */
687654 if (NULL != mca_oob_tcp_module .api .finalize ) {
688655 mca_oob_tcp_module .api .finalize ();
689656 }
690- opal_output_verbose (2 , orte_oob_base_framework .framework_output ,
691- "%s TCP SHUTDOWN done" ,
692- ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ));
693657}
694658
695659static int component_send (orte_rml_send_t * msg )
0 commit comments