From 30af775d40fbc9183ca968325d5fa272f6e1eb29 Mon Sep 17 00:00:00 2001 From: Edgar Gabriel Date: Thu, 13 Oct 2005 17:34:42 +0000 Subject: [PATCH] further fixes. The first hierarchical MPI_Bcast works! Its just ~ 100 times slower then basic at the moment :-) This commit was SVN r7754. --- ompi/mca/coll/hierarch/coll_hierarch.c | 35 +++++++++++++++++--- ompi/mca/coll/hierarch/coll_hierarch_bcast.c | 8 ++--- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/ompi/mca/coll/hierarch/coll_hierarch.c b/ompi/mca/coll/hierarch/coll_hierarch.c index 0e0d7c1c7c..330789b96e 100644 --- a/ompi/mca/coll/hierarch/coll_hierarch.c +++ b/ompi/mca/coll/hierarch/coll_hierarch.c @@ -99,6 +99,34 @@ static const mca_coll_base_module_1_0_0_t intra = { }; +static const mca_coll_base_module_1_0_0_t null_intra = { + + /* Initialization / finalization functions */ + + mca_coll_hierarch_module_init, + mca_coll_hierarch_module_finalize, + + /* Collective function pointers */ + /* function pointers marked with NULL are not yet implemented + and will use the functions provided in the basic module */ + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL +}; + /* @@ -239,8 +267,7 @@ mca_coll_hierarch_comm_query(struct ompi_communicator_t *comm, int *priority, tdata->hier_level = level; *data = tdata; - /* return &intra; */ - goto exit; + return &null_intra; } } @@ -417,7 +444,7 @@ struct ompi_communicator_t* mca_coll_hierarch_get_llcomm (int rank, return NULL; } - for (i=0;ihier_max_llead; i++ ) { + for (i=0;ihier_num_llead; i++ ) { llead = &(data->hier_llead[i]); llcomm = llead->llcomm; rc = ompi_comm_group ( llcomm, &llgroup); @@ -433,7 +460,7 @@ struct ompi_communicator_t* mca_coll_hierarch_get_llcomm (int rank, /* ompi_group_decrement_proc_count (llgroup); OBJ_RELEASE(llgroup); */ if ( MPI_UNDEFINED != *lrank ) { - found = 0; + found = 1; break; } } diff --git a/ompi/mca/coll/hierarch/coll_hierarch_bcast.c b/ompi/mca/coll/hierarch/coll_hierarch_bcast.c index 3c09db89d8..82182ac134 100644 --- a/ompi/mca/coll/hierarch/coll_hierarch_bcast.c +++ b/ompi/mca/coll/hierarch/coll_hierarch_bcast.c @@ -62,10 +62,10 @@ int mca_coll_hierarch_bcast_intra(void *buff, llcomm = mca_coll_hierarch_get_llcomm ( root, data, &llroot); /* Bcast on the upper level among the local leaders */ - if ( MPI_UNDEFINED == llroot ) { - llcomm->c_coll.coll_bcast(buff, count, datatype, llroot, llcomm); - if ( OMPI_SUCCESS != ret ) { - return ret; + if ( MPI_UNDEFINED != llroot ) { + ret = llcomm->c_coll.coll_bcast(buff, count, datatype, llroot, llcomm); + if ( OMPI_SUCCESS != ret ) { + return ret; } }