Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git] / src / smpi / smpi_pmpi.cpp
index 089ce46..5a3cd2a 100644 (file)
@@ -159,7 +159,7 @@ int PMPI_Type_free(MPI_Datatype * datatype)
   if (*datatype == MPI_DATATYPE_NULL) {
     retval = MPI_ERR_ARG;
   } else {
-    smpi_datatype_free(datatype);
+    smpi_datatype_unuse(*datatype);
     retval = MPI_SUCCESS;
   }
   return retval;
@@ -718,7 +718,7 @@ int PMPI_Comm_group(MPI_Comm comm, MPI_Group * group)
   } else {
     *group = smpi_comm_group(comm);
     if(*group!= smpi_comm_group(MPI_COMM_WORLD) && *group != MPI_GROUP_NULL
-              && *group != smpi_comm_group(MPI_COMM_SELF) && *group != MPI_GROUP_EMPTY)
+              && *group != MPI_GROUP_EMPTY)
     smpi_group_use(*group);
     retval = MPI_SUCCESS;
   }
@@ -775,7 +775,7 @@ int PMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm * newcomm)
     *newcomm= MPI_COMM_NULL;
     retval = MPI_SUCCESS;
   }else{
-
+    smpi_group_use(group);
     *newcomm = smpi_comm_new(group, NULL);
     retval = MPI_SUCCESS;
   }
@@ -2635,7 +2635,7 @@ int PMPI_Type_create_resized(MPI_Datatype oldtype,MPI_Aint lb, MPI_Aint extent,
     MPI_Datatype types[3] = { MPI_LB, oldtype, MPI_UB };
 
     s_smpi_mpi_struct_t* subtype = smpi_datatype_struct_create( blocks, disps, 3, types);
-    smpi_datatype_create(newtype,oldtype->size, lb, lb + extent, 1 , subtype, DT_FLAG_VECTOR);
+    smpi_datatype_create(newtype,oldtype->size, lb, lb + extent, sizeof(s_smpi_mpi_struct_t) , subtype, DT_FLAG_VECTOR);
 
     (*newtype)->flags &= ~DT_FLAG_COMMITED;
     return MPI_SUCCESS;
@@ -3223,7 +3223,7 @@ int PMPI_Info_get_nthkey( MPI_Info info, int n, char *key){
 
 int PMPI_Info_get_valuelen( MPI_Info info, char *key, int *valuelen, int *flag){
   *flag=false;
-  if (info == NULL || key == NULL || valuelen==NULL || *valuelen <0)
+  if (info == NULL || key == NULL || valuelen==NULL)
     return MPI_ERR_ARG;
   char* tmpvalue=(char*)xbt_dict_get_or_null(info->info_dict, key);
   if(tmpvalue){