+MPI_Datatype smpi_datatype_dup(MPI_Datatype datatype)
+{
+ MPI_Datatype new_t= xbt_new(s_smpi_mpi_datatype_t,1);
+ memcpy(new_t, datatype, sizeof(s_smpi_mpi_datatype_t));
+ if (datatype->has_subtype)
+ memcpy(new_t->substruct, datatype->substruct, sizeof(s_smpi_subtype_t));
+ return new_t;
+}
+