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
We should'nt allow the use of uncommited datatypes in communications.
[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
2b42d05
..
7cb76b7
100644
(file)
--- 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*);
// 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;
}
size_t smpi_datatype_size(MPI_Datatype datatype)
{
return datatype->size;
}
-
-
MPI_Aint smpi_datatype_lb(MPI_Datatype datatype)
{
return datatype->lb;
MPI_Aint smpi_datatype_lb(MPI_Datatype datatype)
{
return datatype->lb;
@@
-326,7
+330,7
@@
void smpi_datatype_free(MPI_Datatype* type){
xbt_free((*type)->substruct);
}
xbt_free(*type);
xbt_free((*type)->substruct);
}
xbt_free(*type);
-
+ *type = MPI_DATATYPE_NULL;
}
void smpi_datatype_use(MPI_Datatype type){
}
void smpi_datatype_use(MPI_Datatype type){