Index: src/mpi/coll/bcast.c =================================================================== --- src/mpi/coll/bcast.c (revision 8992) +++ src/mpi/coll/bcast.c (working copy) @@ -842,8 +842,9 @@ Otherwise it invokes bcast_fn_ with the given args. NOTE: calls MPIU_ERR_POP on any failure, so a fn_fail label is needed. */ -#define MPIR_Bcast_fn_or_override(bcast_fn_,mpi_errno_,buffer_,count_,datatype_,root_,comm_ptr_,errflag_) \ +#define MPIR_Bcast_fn_or_override(bcast_fn_,mpi_errno_ret_,buffer_,count_,datatype_,root_,comm_ptr_,errflag_) \ do { \ + int mpi_errno_ = MPI_SUCCESS; \ if (comm_ptr_->coll_fns != NULL && comm_ptr_->coll_fns->Bcast != NULL) \ { \ /* --BEGIN USEREXTENSION-- */ \ @@ -855,11 +856,11 @@ { \ mpi_errno_ = bcast_fn_(buffer_, count_, datatype_, root_, comm_ptr_, errflag_); \ } \ - if (mpi_errno) { \ + if (mpi_errno_) { \ /* for communication errors, just record the error but continue */ \ *(errflag_) = TRUE; \ - MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**fail"); \ - MPIU_ERR_ADD(mpi_errno_ret, mpi_errno); \ + MPIU_ERR_SET(mpi_errno_, MPI_ERR_OTHER, "**fail"); \ + MPIU_ERR_ADD(mpi_errno_ret_, mpi_errno); \ } \ } while (0) @@ -869,6 +870,10 @@ * be able to make changes along these lines almost exclusively in this function * and some new functions. [goodell@ 2008/01/07] */ +#undef FUNCNAME +#define FUNCNAME MPIR_SMP_Bcast +#undef FCNAME +#define FCNAME MPIU_QUOTE(FUNCNAME) static int MPIR_SMP_Bcast( void *buffer, int count, @@ -949,7 +954,7 @@ /* perform the internode broadcast */ if (comm_ptr->node_roots_comm != NULL) { - MPIR_Bcast_fn_or_override(MPIR_Bcast_binomial, mpi_errno, + MPIR_Bcast_fn_or_override(MPIR_Bcast_binomial, mpi_errno_ret, buffer, count, datatype, MPIU_Get_internode_rank(comm_ptr, root), comm_ptr->node_roots_comm, errflag); @@ -958,7 +963,7 @@ /* perform the intranode broadcast on all except for the root's node */ if (comm_ptr->node_comm != NULL) { - MPIR_Bcast_fn_or_override(MPIR_Bcast_binomial, mpi_errno, + MPIR_Bcast_fn_or_override(MPIR_Bcast_binomial, mpi_errno_ret, buffer, count, datatype, 0, comm_ptr->node_comm, errflag); } } @@ -978,7 +983,7 @@ /* FIXME binomial may not be the best algorithm for on-node bcast. We need a more comprehensive system for selecting the right algorithms here. */ - MPIR_Bcast_fn_or_override(MPIR_Bcast_binomial, mpi_errno, + MPIR_Bcast_fn_or_override(MPIR_Bcast_binomial, mpi_errno_ret, buffer, count, datatype, MPIU_Get_intranode_rank(comm_ptr, root), comm_ptr->node_comm, errflag); @@ -989,14 +994,14 @@ { if (MPIU_is_pof2(comm_ptr->node_roots_comm->local_size, NULL)) { - MPIR_Bcast_fn_or_override(MPIR_Bcast_scatter_doubling_allgather, mpi_errno, + MPIR_Bcast_fn_or_override(MPIR_Bcast_scatter_doubling_allgather, mpi_errno_ret, buffer, count, datatype, MPIU_Get_internode_rank(comm_ptr, root), comm_ptr->node_roots_comm, errflag); } else { - MPIR_Bcast_fn_or_override(MPIR_Bcast_scatter_ring_allgather, mpi_errno, + MPIR_Bcast_fn_or_override(MPIR_Bcast_scatter_ring_allgather, mpi_errno_ret, buffer, count, datatype, MPIU_Get_internode_rank(comm_ptr, root), comm_ptr->node_roots_comm, errflag); @@ -1010,7 +1015,7 @@ /* FIXME binomial may not be the best algorithm for on-node bcast. We need a more comprehensive system for selecting the right algorithms here. */ - MPIR_Bcast_fn_or_override(MPIR_Bcast_binomial, mpi_errno, + MPIR_Bcast_fn_or_override(MPIR_Bcast_binomial, mpi_errno_ret, buffer, count, datatype, 0, comm_ptr->node_comm, errflag); } }