From 6eeca66475abba1e6a7531d6cef47ac3b2cd9ab6 Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Mon, 21 May 2012 19:56:15 +0000 Subject: [PATCH] add an option to enable static ports. diabled by default This commit was SVN r26462. --- orte/config/orte_configure_options.m4 | 15 +++++++++++++++ orte/mca/ess/base/ess_base_std_orted.c | 2 ++ orte/mca/oob/tcp/oob_tcp.c | 8 +++++++- orte/util/nidmap.c | 2 ++ orte/util/nidmap.h | 2 ++ 5 files changed, 28 insertions(+), 1 deletion(-) diff --git a/orte/config/orte_configure_options.m4 b/orte/config/orte_configure_options.m4 index c7ad235714..4387f8cc08 100644 --- a/orte/config/orte_configure_options.m4 +++ b/orte/config/orte_configure_options.m4 @@ -134,4 +134,19 @@ AC_DEFINE_UNQUOTED([ORTE_ENABLE_PROGRESS_THREADS], [$orte_enable_progress_threads], [Whether we want orte progress threads enabled]) +AC_MSG_CHECKING([if want orte static ports]) +AC_ARG_ENABLE([orte-static-ports], + [AC_HELP_STRING([--enable-orte-static-ports], + [Enable orte static ports for tcp oob. (default: disabled)])]) +if test "$enable_orte_static_ports" = "yes"; then + AC_MSG_RESULT([yes]) + orte_enable_static_ports=1 +else + AC_MSG_RESULT([no]) + orte_enable_static_ports=0 +fi +AC_DEFINE_UNQUOTED([ORTE_ENABLE_STATIC_PORTS], + [$orte_enable_static_ports], + [Whether we want static ports enabled]) + ])dnl diff --git a/orte/mca/ess/base/ess_base_std_orted.c b/orte/mca/ess/base/ess_base_std_orted.c index 0635339dec..d86bdd49fe 100644 --- a/orte/mca/ess/base/ess_base_std_orted.c +++ b/orte/mca/ess/base/ess_base_std_orted.c @@ -303,6 +303,7 @@ int orte_ess_base_orted_setup(char **hosts) error = "orte_util_nidmap_init"; goto error; } +#if ORTE_ENABLE_STATIC_PORTS /* if we are using static ports, then we need to setup * the daemon info so the RML can function properly * without requiring a wireup stage. This must be done @@ -324,6 +325,7 @@ int orte_ess_base_orted_setup(char **hosts) goto error; } } +#endif /* be sure to update the routing tree so the initial "phone home" * to mpirun goes through the tree if static ports were enabled - still * need to do it anyway just to initialize things diff --git a/orte/mca/oob/tcp/oob_tcp.c b/orte/mca/oob/tcp/oob_tcp.c index e6067197d1..ec933d17dd 100644 --- a/orte/mca/oob/tcp/oob_tcp.c +++ b/orte/mca/oob/tcp/oob_tcp.c @@ -293,6 +293,7 @@ static int mca_oob_tcp_component_register(void) mca_oob_tcp_component.tcp_listen_thread_tv.tv_sec = tmp / (1000); mca_oob_tcp_component.tcp_listen_thread_tv.tv_usec = (tmp % 1000) * 1000; +#if ORTE_ENABLE_STATIC_PORTS mca_base_param_reg_string(&mca_oob_tcp_component.super.oob_base, "static_ports", "Static ports for daemons and procs (IPv4)", false, false, @@ -311,6 +312,7 @@ static int mca_oob_tcp_component_register(void) orte_static_ports = false; mca_oob_tcp_component.tcp4_static_ports = NULL; } +#endif mca_base_param_reg_string(&mca_oob_tcp_component.super.oob_base, "dynamic_ports", "Range of ports to be dynamically used by daemons and procs (IPv4)", @@ -340,6 +342,7 @@ static int mca_oob_tcp_component_register(void) 0, &mca_oob_tcp_component.disable_family); #if OPAL_WANT_IPV6 +#if ORTE_ENABLE_STATIC_PORTS mca_base_param_reg_string(&mca_oob_tcp_component.super.oob_base, "static_ports_v6", "Static ports for daemons and procs (IPv6)", false, false, @@ -357,6 +360,7 @@ static int mca_oob_tcp_component_register(void) orte_static_ports = false; mca_oob_tcp_component.tcp6_static_ports = NULL; } +#endif mca_base_param_reg_string(&mca_oob_tcp_component.super.oob_base, "dynamic_ports_v6", "Range of ports to be dynamically used by daemons and procs (IPv4)", @@ -1627,7 +1631,8 @@ int mca_oob_tcp_resolve(mca_oob_tcp_peer_t* peer) mca_oob_tcp_peer_resolved(peer, addr); return ORTE_SUCCESS; } - + +#if ORTE_ENABLE_STATIC_PORTS /* if we don't know it, and we are using static ports, try * to compute the address and port */ @@ -1730,6 +1735,7 @@ int mca_oob_tcp_resolve(mca_oob_tcp_peer_t* peer) free(uri); } } +#endif unlock: return rc; diff --git a/orte/util/nidmap.c b/orte/util/nidmap.c index 29ed875170..22490a6f0b 100644 --- a/orte/util/nidmap.c +++ b/orte/util/nidmap.c @@ -205,6 +205,7 @@ int orte_util_setup_local_nidmap_entries(void) return ORTE_SUCCESS; } +#if ORTE_ENABLE_STATIC_PORTS int orte_util_build_daemon_nidmap(char **nodes) { orte_nid_t *node; @@ -292,6 +293,7 @@ int orte_util_build_daemon_nidmap(char **nodes) return rc; } +#endif int orte_util_encode_nodemap(opal_byte_object_t *boptr) { diff --git a/orte/util/nidmap.h b/orte/util/nidmap.h index bac7c8935b..0b612a92a9 100644 --- a/orte/util/nidmap.h +++ b/orte/util/nidmap.h @@ -58,7 +58,9 @@ ORTE_DECLSPEC int orte_util_encode_pidmap(opal_byte_object_t *boptr); ORTE_DECLSPEC int orte_util_decode_pidmap(opal_byte_object_t *boptr); ORTE_DECLSPEC int orte_util_decode_daemon_pidmap(opal_byte_object_t *bo); +#if ORTE_ENABLE_STATIC_PORTS ORTE_DECLSPEC int orte_util_build_daemon_nidmap(char **nodes); +#endif ORTE_DECLSPEC void orte_nidmap_dump(void); ORTE_DECLSPEC void orte_jmap_dump(orte_jmap_t *jmap);