int smpi_datatype_copy(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype)
{
- int retval, count;
+ int count;
/* First check if we really have something to do */
- if (recvcount == 0) {
- retval = sendcount == 0 ? MPI_SUCCESS : MPI_ERR_TRUNCATE;
- } else {
+ if (recvcount > 0 && recvbuf != sendbuf) {
/* FIXME: treat packed cases */
sendcount *= smpi_datatype_size(sendtype);
recvcount *= smpi_datatype_size(recvtype);
free(buf_tmp);
}
- retval = sendcount > recvcount ? MPI_ERR_TRUNCATE : MPI_SUCCESS;
}
- return retval;
+ return sendcount > recvcount ? MPI_ERR_TRUNCATE : MPI_SUCCESS;
}
/*
if ((*type)->has_subtype == 1){
((s_smpi_subtype_t *)(*type)->substruct)->subtype_free(type);
+ xbt_free((*type)->substruct);
}
xbt_free(*type);