-int PMPI_Type_create_resized(MPI_Datatype oldtype,MPI_Aint lb, MPI_Aint extent, MPI_Datatype *newtype){
- if (oldtype == MPI_DATATYPE_NULL) {
+
+int PMPI_Type_create_subarray(int ndims, const int* array_of_sizes,
+ const int* array_of_subsizes, const int* array_of_starts,
+ int order, MPI_Datatype oldtype, MPI_Datatype *newtype) {
+ CHECK_NEGATIVE(1, MPI_ERR_COUNT, ndims)
+ if (ndims==0){
+ *newtype = MPI_DATATYPE_NULL;
+ return MPI_SUCCESS;
+ } else if (ndims==1){
+ simgrid::smpi::Datatype::create_contiguous( array_of_subsizes[0], oldtype, array_of_starts[0]*oldtype->get_extent(), newtype);
+ return MPI_SUCCESS;
+ } else if (oldtype == MPI_DATATYPE_NULL || not oldtype->is_valid() ) {