Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move some content to the SynchroRaw dtor
[simgrid.git] / src / smpi / smpi_mpi_dt.cpp
index 36eba9b..6e6410f 100644 (file)
@@ -201,6 +201,7 @@ int smpi_datatype_dup(MPI_Datatype datatype, MPI_Datatype* new_t)
           if(ret!=MPI_SUCCESS){
             smpi_datatype_unuse(*new_t);
             *new_t=MPI_DATATYPE_NULL;
+            xbt_dict_cursor_free(&cursor);
             return ret;
           }
           if(flag)
@@ -410,6 +411,7 @@ void smpi_datatype_free(MPI_Datatype* type){
       if(elem &&  elem->delete_fn)
         elem->delete_fn(*type,*key, value, &flag);
     }
+    xbt_dict_free(&(*type)->attributes);
   }
 
   if ((*type)->sizeof_substruct != 0){
@@ -498,6 +500,7 @@ void use_contiguous(MPI_Datatype* d){
  * erived from s_smpi_subtype which required the functions unserialize and serialize */
 s_smpi_mpi_contiguous_t* smpi_datatype_contiguous_create( MPI_Aint lb, int block_count, MPI_Datatype old_type,
                                                   int size_oldtype){
+  if(block_count==0)return NULL;
   s_smpi_mpi_contiguous_t *new_t= xbt_new(s_smpi_mpi_contiguous_t,1);
   new_t->base.serialize = &serialize_contiguous;
   new_t->base.unserialize = &unserialize_contiguous;