1313 * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
1414 * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
1515 * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
16- * Copyright (c) 2014 Research Organization for Information Science
16+ * Copyright (c) 2014-2015 Research Organization for Information Science
1717 * and Technology (RIST). All rights reserved.
1818 * $COPYRIGHT$
1919 *
@@ -36,7 +36,7 @@ int32_t ompi_datatype_create_subarray(int ndims,
3636 const ompi_datatype_t * oldtype ,
3737 ompi_datatype_t * * newtype )
3838{
39- MPI_Datatype last_type ;
39+ ompi_datatype_t * last_type ;
4040 int32_t i , step , end_loop ;
4141 MPI_Aint size , displ , extent ;
4242
@@ -102,6 +102,7 @@ int32_t ompi_datatype_create_subarray(int ndims,
102102 * newtype = ompi_datatype_create ( last_type -> super .desc .used );
103103 ompi_datatype_add ( * newtype , last_type , 1 , displ * extent , size * extent );
104104 ompi_datatype_destroy ( & last_type );
105+ opal_datatype_resize ( & (* newtype )-> super , 0 , size * extent );
105106
106107 return OMPI_SUCCESS ;
107108}
0 commit comments