Skip to content

Commit 5e742c7

Browse files
author
Ralph Castain
committed
Only start a listener for processes that will actually receive connection requests. Tools such as orte-submit always initiate connections and thus do not need to start a listener.
(cherry picked from commit 89c80b2)
1 parent 97ba09f commit 5e742c7

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

orte/mca/oob/tcp/oob_tcp_component.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ static int component_available(void)
616616
/* Start all modules */
617617
static int component_startup(void)
618618
{
619-
int rc;
619+
int rc = ORTE_SUCCESS;
620620

621621
opal_output_verbose(2, orte_oob_base_framework.framework_output,
622622
"%s TCP STARTUP",
@@ -627,10 +627,19 @@ static int component_startup(void)
627627
mca_oob_tcp_module.api.init();
628628
}
629629

630-
/* start the listening thread/event */
631-
if (ORTE_SUCCESS != (rc = orte_oob_tcp_start_listening())) {
632-
ORTE_ERROR_LOG(rc);
630+
/* if we are a daemon/HNP, or we are a standalone app,
631+
* then it is possible that someone else may initiate a
632+
* connection to us. In these cases, we need to start the
633+
* listening thread/event. Otherwise, we will be the one
634+
* initiating communication, and there is no need for
635+
* a listener */
636+
if (ORTE_PROC_IS_HNP || ORTE_PROC_IS_DAEMON ||
637+
orte_standalone_operation) {
638+
if (ORTE_SUCCESS != (rc = orte_oob_tcp_start_listening())) {
639+
ORTE_ERROR_LOG(rc);
640+
}
633641
}
642+
634643
return rc;
635644
}
636645

0 commit comments

Comments
 (0)