A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
protect these calls against MPI_DATATYPE_NULL errors
[simgrid.git]
/
src
/
smpi
/
smpi_mpi_dt.c
diff --git
a/src/smpi/smpi_mpi_dt.c
b/src/smpi/smpi_mpi_dt.c
index
852b4d4
..
07bec7c
100644
(file)
--- 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)
{
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){
*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;
}
return datatype->ub - datatype->lb;
}