@@ -33,17 +33,13 @@ mca_common_ompio_decode_datatype ( ompi_datatype_t *datatype,
3333 uint32_t * iovec_count ,
3434 int increment )
3535{
36-
37-
38-
3936 opal_convertor_t * convertor ;
4037 size_t remaining_length = 0 ;
4138 uint32_t i ;
4239 uint32_t temp_count ;
4340 struct iovec * temp_iov = NULL ;
4441 size_t temp_data ;
4542
46-
4743 convertor = opal_convertor_create ( opal_local_arch , 0 );
4844
4945 if (OMPI_SUCCESS != opal_convertor_prepare_for_send (convertor ,
@@ -55,9 +51,9 @@ mca_common_ompio_decode_datatype ( ompi_datatype_t *datatype,
5551 }
5652
5753 if ( 0 == datatype -> super .size ) {
58- * iovec_count = 0 ;
59- * iov = NULL ;
60- return OMPI_SUCCESS ;
54+ * iovec_count = 0 ;
55+ * iov = NULL ;
56+ return OMPI_SUCCESS ;
6157 }
6258
6359 remaining_length = count * datatype -> super .size ;
@@ -69,18 +65,16 @@ mca_common_ompio_decode_datatype ( ompi_datatype_t *datatype,
6965 return OMPI_ERR_OUT_OF_RESOURCE ;
7066 }
7167
72- while (0 == opal_convertor_raw (convertor ,
73- temp_iov ,
74- & temp_count ,
75- & temp_data )) {
68+ while (0 == opal_convertor_raw (convertor , temp_iov ,
69+ & temp_count , & temp_data )) {
7670 * iovec_count = * iovec_count + temp_count ;
7771 * iov = (struct iovec * ) realloc (* iov , * iovec_count * sizeof (struct iovec ));
7872 if (NULL == * iov ) {
7973 opal_output (1 , "OUT OF MEMORY\n" );
8074 free (temp_iov );
8175 return OMPI_ERR_OUT_OF_RESOURCE ;
8276 }
83- for (i = 0 ; i < temp_count ; i ++ ) {
77+ for (i = 0 ; i < temp_count ; i ++ ) {
8478 (* iov )[i + (* iovec_count - temp_count )].iov_base = temp_iov [i ].iov_base ;
8579 (* iov )[i + (* iovec_count - temp_count )].iov_len = temp_iov [i ].iov_len ;
8680 }
@@ -90,12 +84,12 @@ mca_common_ompio_decode_datatype ( ompi_datatype_t *datatype,
9084 }
9185 * iovec_count = * iovec_count + temp_count ;
9286 if ( temp_count > 0 ) {
93- * iov = (struct iovec * ) realloc (* iov , * iovec_count * sizeof (struct iovec ));
94- if (NULL == * iov ) {
95- opal_output (1 , "OUT OF MEMORY\n" );
87+ * iov = (struct iovec * ) realloc (* iov , * iovec_count * sizeof (struct iovec ));
88+ if (NULL == * iov ) {
89+ opal_output (1 , "OUT OF MEMORY\n" );
9690 free (temp_iov );
97- return OMPI_ERR_OUT_OF_RESOURCE ;
98- }
91+ return OMPI_ERR_OUT_OF_RESOURCE ;
92+ }
9993 }
10094 for (i = 0 ; i < temp_count ; i ++ ) {
10195 (* iov )[i + (* iovec_count - temp_count )].iov_base = temp_iov [i ].iov_base ;
@@ -342,7 +336,6 @@ int main (int argc, char *argv[]) {
342336 struct iovec * iov_1 = NULL ;
343337 mca_common_ompio_decode_datatype ( datatype , 1 , & iov_1 , & iovec_count_1 , 1 );
344338
345-
346339 assert (iovec_count_300 == iovec_count_10 );
347340 assert (iovec_count_300 == iovec_count_1 );
348341 // assert(iov[100].iov_base == iov2[100].iov_base);
0 commit comments