git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8167
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
/* First check if we really have something to do */
if(recvcount == 0) {
retval = sendcount == 0 ? MPI_SUCCESS : MPI_ERR_TRUNCATE;
/* First check if we really have something to do */
if(recvcount == 0) {
retval = sendcount == 0 ? MPI_SUCCESS : MPI_ERR_TRUNCATE;
- } else if(sendtype == recvtype) {
- /* If same datatypes used, just copy. */
- count = sendcount < recvcount ? sendcount : recvcount;
- memcpy(recvbuf, sendbuf, smpi_datatype_size(sendtype) * count);
- retval = sendcount > recvcount ? MPI_ERR_TRUNCATE : MPI_SUCCESS;
- } else {
- /* FIXME: cases
- * - If receive packed.
- * - If send packed
- * to be treated once we have the MPI_Pack things ...
- **/
- retval = MPI_SUCCESS;
- }
- return retval;
+ } else {
+ /* FIXME: treat packed cases */
+ sendcount *= smpi_datatype_size(sendtype);
+ recvcount *= smpi_datatype_size(recvtype);
+ count = sendcount < recvcount ? sendcount : recvcount;
+ memcpy(recvbuf, sendbuf, count);
+ retval = sendcount > recvcount ? MPI_ERR_TRUNCATE : MPI_SUCCESS;
+ }
+ return retval;
}
typedef struct s_smpi_mpi_op {
}
typedef struct s_smpi_mpi_op {