13
13
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
14
14
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
15
15
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
16
+ * Copyright (c) 2015 Research Organization for Information Science
17
+ * and Technology (RIST). All rights reserved.
16
18
* $COPYRIGHT$
17
19
*
18
20
* Additional copyrights may follow
@@ -36,9 +38,7 @@ int32_t ompi_datatype_create_indexed( int count, const int* pBlockLength, const
36
38
OPAL_PTRDIFF_TYPE extent ;
37
39
38
40
if ( 0 == count ) {
39
- * newType = ompi_datatype_create ( 0 );
40
- ompi_datatype_add ( * newType , & ompi_mpi_datatype_null .dt , 0 , 0 , 0 );
41
- return OMPI_SUCCESS ;
41
+ return ompi_datatype_duplicate ( & ompi_mpi_datatype_null .dt , newType );
42
42
}
43
43
44
44
disp = pDisp [0 ];
@@ -113,12 +113,13 @@ int32_t ompi_datatype_create_indexed_block( int count, int bLength, const int* p
113
113
114
114
ompi_datatype_type_extent ( oldType , & extent );
115
115
if ( (count == 0 ) || (bLength == 0 ) ) {
116
- * newType = ompi_datatype_create ( 1 );
117
- if ( 0 == count )
118
- ompi_datatype_add ( * newType , & ompi_mpi_datatype_null . dt , 0 , 0 , 0 );
119
- else
116
+ if ( 0 == count ) {
117
+ return ompi_datatype_duplicate ( & ompi_mpi_datatype_null . dt , newType );
118
+ } else {
119
+ * newType = ompi_datatype_create ( 1 );
120
120
ompi_datatype_add ( * newType , oldType , 0 , pDisp [0 ] * extent , extent );
121
- return OMPI_SUCCESS ;
121
+ return OMPI_SUCCESS ;
122
+ }
122
123
}
123
124
pdt = ompi_datatype_create ( count * (2 + oldType -> super .desc .used ) );
124
125
disp = pDisp [0 ];
0 commit comments