From 533dfff56d9ea7e59c80348eea28922524d209ac Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Mon, 26 Feb 2007 22:24:44 +0000 Subject: [PATCH] Only do the preconnection stage if we found the local proc. It's mostly to make some compilers complain less about uninitialized values. This commit was SVN r13805. --- ompi/runtime/ompi_mpi_preconnect.c | 40 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/ompi/runtime/ompi_mpi_preconnect.c b/ompi/runtime/ompi_mpi_preconnect.c index 21a1a3327f..983b7c5dd9 100644 --- a/ompi/runtime/ompi_mpi_preconnect.c +++ b/ompi/runtime/ompi_mpi_preconnect.c @@ -118,29 +118,29 @@ int ompi_init_do_oob_preconnect(void) for (i = 0 ; i < world_size ; ++i) { if (ompi_proc_local() == procs[i]) { my_index = i; + /* Do all required preconnections */ + for (i = 1 ; i <= world_size / 2 ; ++i) { + next = (my_index + i) % world_size; + prev = (my_index - i + world_size) % world_size; + + /* sends do not wait for a match */ + ret = orte_rml.send(&procs[next]->proc_name, + msg, + 1, + ORTE_RML_TAG_WIREUP, + 0); + if (ret < 0) return ret; + + ret = orte_rml.recv(&procs[prev]->proc_name, + msg, + 1, + ORTE_RML_TAG_WIREUP, + 0); + if (ret < 0) return ret; + } break; } } - - for (i = 1 ; i <= world_size / 2 ; ++i) { - next = (my_index + i) % world_size; - prev = (my_index - i + world_size) % world_size; - - /* sends do not wait for a match */ - ret = orte_rml.send(&procs[next]->proc_name, - msg, - 1, - ORTE_RML_TAG_WIREUP, - 0); - if (ret < 0) return ret; - - ret = orte_rml.recv(&procs[prev]->proc_name, - msg, - 1, - ORTE_RML_TAG_WIREUP, - 0); - if (ret < 0) return ret; - } } return OMPI_SUCCESS;