From: Augustin Degomme Date: Thu, 24 Jul 2014 13:20:49 +0000 (+0200) Subject: protect these calls against MPI_DATATYPE_NULL errors X-Git-Tag: v3_12~893^2~2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b1fca7adebaf94e19266f2564f2e6623581550e8?hp=8ec703af1cf974ed8097c2e96cc051f1f0d38ac7 protect these calls against MPI_DATATYPE_NULL errors --- diff --git a/src/smpi/smpi_mpi_dt.c b/src/smpi/smpi_mpi_dt.c index 852b4d4a9c..07bec7c55e 100644 --- a/src/smpi/smpi_mpi_dt.c +++ b/src/smpi/smpi_mpi_dt.c @@ -182,12 +182,20 @@ MPI_Datatype smpi_datatype_dup(MPI_Datatype datatype) int smpi_datatype_extent(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent) { + if(datatype == MPI_DATATYPE_NULL){ + *lb=0; + *extent=0; + return MPI_SUCCESS; + } *lb = datatype->lb; *extent = datatype->ub - datatype->lb; return MPI_SUCCESS; } MPI_Aint smpi_datatype_get_extent(MPI_Datatype datatype){ + if(datatype == MPI_DATATYPE_NULL){ + return 0; + } return datatype->ub - datatype->lb; }