Index: src/coll/intra_fns_new.c =================================================================== RCS file: /MPIhome/mpich/src/coll/intra_fns_new.c,v retrieving revision 1.20 retrieving revision 1.21 diff -r1.20 -r1.21 2c2 < * $Id: intra_fns_new.c,v 1.20 2002/12/04 23:01:04 thakur Exp $ --- > * $Id: intra_fns_new.c,v 1.21 2003/02/10 21:32:37 thakur Exp $ 3207c3207 < int nprocs_completed, tmp_mask, tree_root; --- > int nprocs_completed, tmp_mask, tree_root, received; 3365c3365,3367 < --- > > received = 0; > 3375a3378 > received = 1; 3427a3431 > received = 1; 3429,3453d3432 < < if ((op_ptr->commute) || (dst_tree_root < < my_tree_root)) { < (*uop)(tmp_recvbuf, tmp_results, &blklens[0], < &datatype->self); < (*uop)(((char *)tmp_recvbuf + dis[1]*extent), < ((char *)tmp_results + dis[1]*extent), < &blklens[1], &datatype->self); < } < else { < (*uop)(tmp_results, tmp_recvbuf, &blklens[0], < &datatype->self); < (*uop)(((char *)tmp_results + dis[1]*extent), < ((char *)tmp_recvbuf + dis[1]*extent), < &blklens[1], &datatype->self); < /* copy result back into tmp_results */ < mpi_errno = MPI_Sendrecv(tmp_recvbuf, 1, < recvtype, rank, < MPIR_REDUCE_SCATTER_TAG, < tmp_results, 1, < recvtype, rank, < MPIR_REDUCE_SCATTER_TAG, < comm->self, &status); < if (mpi_errno) return mpi_errno; < } 3460,3463c3439,3443 < /* the following could have been done just after the < MPI_Sendrecv above in the (if dst < size) case . however, < for a noncommutative op, we would need an extra temp buffer so < as not to overwrite temp_recvbuf, because temp_recvbuf may have --- > /* The following reduction is done here instead of after > the MPI_Sendrecv or MPI_Recv above. This is > because to do it above, in the noncommutative > case, we would need an extra temp buffer so as not to > overwrite temp_recvbuf, because temp_recvbuf may have 3467,3468c3447 < dst = rank ^ mask; < if (dst < size) { --- > if (received) { .