- /*
- #ifdef MPICH2_REDUCTION
- MPI_User_function * uop = MPIR_Op_table[op % 16 - 1];
- #else
- MPI_User_function *uop;
- struct MPIR_OP *op_ptr;
- op_ptr = MPIR_ToPointer(op);
- uop = op_ptr->op;
- #endif
- */
-
- MPI_Comm_size(comm, &comm_size);
- MPI_Comm_rank(comm, &rank);
- MPI_Aint extent;
- MPI_Type_extent(dtype, &extent);
- tmp_buf = (void *) malloc(count * extent);
+
+ comm_size=smpi_comm_size(comm);
+ rank=smpi_comm_rank(comm);
+ MPI_Aint extent, lb;
+ smpi_datatype_extent(dtype, &lb, &extent);
+ tmp_buf = (void *) smpi_get_tmp_sendbuffer(count * extent);