X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f3ae712a1b95294052b6e8136d0f0f2d4b30e6eb..ce1289d4421b08ce6f69d8203784ee648671972e:/src/smpi/smpi_mpi_dt.c diff --git a/src/smpi/smpi_mpi_dt.c b/src/smpi/smpi_mpi_dt.c index ee348b8eb9..7cb76b7949 100644 --- a/src/smpi/smpi_mpi_dt.c +++ b/src/smpi/smpi_mpi_dt.c @@ -123,14 +123,18 @@ CREATE_MPI_DATATYPE_NULL(MPI_PACKED); // Internal use only CREATE_MPI_DATATYPE(MPI_PTR, void*); +/** Check if the datatype is usable for communications + */ +int is_datatype_valid(MPI_Datatype datatype) { + return datatype != MPI_DATATYPE_NULL + && (datatype->flags & DT_FLAG_COMMITED); +} size_t smpi_datatype_size(MPI_Datatype datatype) { return datatype->size; } - - MPI_Aint smpi_datatype_lb(MPI_Datatype datatype) { return datatype->lb; @@ -157,7 +161,9 @@ int smpi_datatype_copy(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype) { int count; - + if(smpi_privatize_global_variables){ + switch_data_segment(smpi_process_index()); + } /* First check if we really have something to do */ if (recvcount > 0 && recvbuf != sendbuf) { /* FIXME: treat packed cases */ @@ -324,7 +330,7 @@ void smpi_datatype_free(MPI_Datatype* type){ xbt_free((*type)->substruct); } xbt_free(*type); - + *type = MPI_DATATYPE_NULL; } void smpi_datatype_use(MPI_Datatype type){