Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
activate tests using resized and handle some corner cases
[simgrid.git] / src / smpi / smpi_pmpi.c
index 3e30e4d..9159a69 100644 (file)
@@ -2685,7 +2685,16 @@ int PMPI_Type_create_resized(MPI_Datatype oldtype,MPI_Aint lb, MPI_Aint extent,
     if(oldtype == MPI_DATATYPE_NULL) {
         return MPI_ERR_TYPE;
     }
-    smpi_datatype_create(newtype,oldtype->size, lb, lb + extent, oldtype->has_subtype,oldtype->substruct, oldtype->flags);
+    int blocks[3] = { 1, 1, 1 };
+    MPI_Aint disps[3] = { lb, 0, lb+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);
 
     (*newtype)->flags &= ~DT_FLAG_COMMITED;
     return MPI_SUCCESS;