Skip to content

Commit e0d77d5

Browse files
author
rhc54
authored
Merge pull request #2576 from hjelmn/v1.10_datatype_fix
v1.10.5: ompi/datatype: fix bug in darray that causes MPI/IO failures
2 parents 7a870cd + 518b372 commit e0d77d5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

ompi/datatype/ompi_datatype_create_darray.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* -*- Mode: C; c-basic-offset:4 ; -*- */
1+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
33
* Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
44
* University Research and Technology
@@ -14,6 +14,8 @@
1414
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
1515
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
1616
* Copyright (c) 2015 Bull SAS. All rights reserved.
17+
* Copyright (c) 2016 Los Alamos National Security, LLC. All rights
18+
* reserved.
1719
* $COPYRIGHT$
1820
*
1921
* Additional copyrights may follow
@@ -278,14 +280,13 @@ int32_t ompi_datatype_create_darray(int size,
278280
rc = ompi_datatype_create_hindexed( 1, blength_hindexed, displs_hindexed, lastType, newtype);
279281
}
280282
ompi_datatype_destroy(&lastType);
281-
opal_datatype_resize( &(*newtype)->super, 0, displs[1] );
283+
opal_datatype_resize( &(*newtype)->super, 0, displs[2] );
282284
/* need to destroy the old type even in error condition, so
283285
don't check return code from above until after cleanup. */
284-
if (MPI_SUCCESS != rc) goto cleanup;
285286
}
286287

287288
cleanup:
288-
if (NULL != st_offsets) free(st_offsets);
289-
if (NULL != coords) free(coords);
290-
return OMPI_SUCCESS;
289+
free (st_offsets);
290+
free (coords);
291+
return rc;
291292
}

0 commit comments

Comments
 (0)