From ad395fa825f780181da9c30c4bd79e1d7e22348d Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Thu, 23 Sep 2004 14:32:31 +0000 Subject: [PATCH] First commit of the revised startup system. Having noted the existence of the wondrous Open MPI "statistics" tracker, I feel compelled to commit these changes one file at a time. This will, of course, provide me with wonderful statistics for the number of commits I have done, thus ensuring that those who watch such things become truly impressed by the magnitude of my contribution. Of course, I will also do a commit for each time I correct a typo in my own software, and each time I add a comment to a file - a comment that, ordinarily, one might expect to have already been in place before the first commit. But then....I wouldn't look as impressive if I did it that way! No, no...far better to add the comments - and do a commit after each one - separately! So, enjoy all. Ralph aka. The longtime Don Quixote crusader against the asinine use of meaningless statistics in place of true performance metrics. This commit was SVN r2824. --- src/runtime/universe_exists.c | 87 +++++++++++++++++------------------ 1 file changed, 42 insertions(+), 45 deletions(-) diff --git a/src/runtime/universe_exists.c b/src/runtime/universe_exists.c index 2f011485ff..85f9bbbc3d 100644 --- a/src/runtime/universe_exists.c +++ b/src/runtime/universe_exists.c @@ -29,7 +29,7 @@ #include "runtime/runtime.h" -static struct timeval ompi_rte_ping_wait = {5, 0}; +static struct timeval ompi_rte_ping_wait = {2, 0}; int ompi_rte_universe_exists() @@ -40,52 +40,49 @@ int ompi_rte_universe_exists() bool ns_found=false, gpr_found=false, ping_success=false; /* if both ns_replica and gpr_replica were provided, check for contact with them */ - if (NULL != ompi_universe_info.ns_replica && NULL != ompi_universe_info.gpr_replica) { - mca_oob_parse_contact_info(ompi_universe_info.ns_replica, &proc, NULL); - /* ping to verify ns_replica alive */ - if (OMPI_SUCCESS != mca_oob_ping(&proc, &ompi_rte_ping_wait)) { - if (ompi_rte_debug_flag) { - ompi_output(0, "univ_exists: ns_replica ping failed"); - } - free(ompi_universe_info.ns_replica); - if (NULL != ompi_process_info.ns_replica) { - free(ompi_process_info.ns_replica); - ompi_process_info.ns_replica = NULL; - } - } else { /* name server found, now try gpr */ - ns_found = true; - if (NULL != ompi_process_info.ns_replica) { - free(ompi_process_info.ns_replica); - ompi_process_info.ns_replica = NULL; - } - ompi_process_info.ns_replica = ns_base_copy_process_name(&proc); - } - - mca_oob_parse_contact_info(ompi_universe_info.gpr_replica, &proc, NULL); - /* ping to verify gpr_replica alive */ - if (OMPI_SUCCESS != mca_oob_ping(&proc, &ompi_rte_ping_wait)) { - if (ompi_rte_debug_flag) { - ompi_output(0, "univ_exists: gpr_replica ping failed"); - } - free(ompi_universe_info.gpr_replica); - if (NULL != ompi_process_info.gpr_replica) { - free(ompi_process_info.gpr_replica); - ompi_process_info.gpr_replica = NULL; - } - } else { - if (NULL != ompi_process_info.gpr_replica) { - free(ompi_process_info.gpr_replica); - ompi_process_info.gpr_replica = NULL; - } - ompi_process_info.gpr_replica = ns_base_copy_process_name(&proc); - gpr_found = true; - } - - if (ns_found && gpr_found) { /* success on both counts - report it */ - return OMPI_SUCCESS; - } + if (NULL != ompi_process_info.ns_replica && NULL != ompi_process_info.gpr_replica) { + return OMPI_SUCCESS; } +/* /\* ping to verify ns_replica alive *\/ */ +/* if (OMPI_SUCCESS != mca_oob_ping(ompi_process_info.ns_replica, &ompi_rte_ping_wait)) { */ +/* if (ompi_rte_debug_flag) { */ +/* ompi_output(0, "univ_exists: ns_replica ping failed"); */ +/* } */ +/* free(ompi_universe_info.ns_replica); */ +/* if (NULL != ompi_process_info.ns_replica) { */ +/* free(ompi_process_info.ns_replica); */ +/* ompi_process_info.ns_replica = NULL; */ +/* } */ +/* } else { /\* name server found *\/ */ +/* ns_found = true; */ +/* } */ +/* /\* next check gpr - first see if it's the same as ns. if so, don't bother *\/ */ + +/* if (0 != ns_base_compare(OMPI_NS_CMP_ALL, ompi_process_info.ns_replica, */ +/* ompi_process_info.gpr_replica)) { */ +/* /\* ping to verify gpr_replica alive *\/ */ +/* if (OMPI_SUCCESS != mca_oob_ping(ompi_process_info.gpr_replica, &ompi_rte_ping_wait)) { */ +/* if (ompi_rte_debug_flag) { */ +/* ompi_output(0, "univ_exists: gpr_replica ping failed"); */ +/* } */ +/* free(ompi_universe_info.gpr_replica); */ +/* if (NULL != ompi_process_info.gpr_replica) { */ +/* free(ompi_process_info.gpr_replica); */ +/* ompi_process_info.gpr_replica = NULL; */ +/* } */ +/* } else { */ +/* gpr_found = true; */ +/* } */ +/* } else { /\* the same - no point in checking *\/ */ +/* gpr_found = ns_found; */ +/* } */ + +/* if (ns_found && gpr_found) { /\* success on both counts - report it *\/ */ +/* return OMPI_SUCCESS; */ +/* } */ +/* } */ + /* if we are missing one or both, we need to get the missing info. first check * to see if seed_contact_info already provided. if so, then contact that daemon * to get missing info.