From b1fca7adebaf94e19266f2564f2e6623581550e8 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Thu, 24 Jul 2014 15:20:49 +0200 Subject: [PATCH 1/1] protect these calls against MPI_DATATYPE_NULL errors --- src/smpi/smpi_mpi_dt.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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; } -- 2.20.1