1
1

Merge pull request #3672 from markalle/pr/darray_fix

Type_create_darray with mix of BLOCK/CYCLIC
Этот коммит содержится в:
Geoff Paulsen 2017-06-08 10:52:50 -05:00 коммит произвёл GitHub
родитель 20166460c7 aeb2c02d2f
Коммит bdc7206230

Просмотреть файл

@ -15,6 +15,7 @@
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2016 Los Alamos National Security, LLC. All rights * Copyright (c) 2016 Los Alamos National Security, LLC. All rights
* reserved. * reserved.
* Copyright (c) 2017 IBM Corporation. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -35,7 +36,7 @@ block(const int *gsize_array, int dim, int ndims, int nprocs,
ptrdiff_t *st_offset) ptrdiff_t *st_offset)
{ {
int blksize, global_size, mysize, i, j, rc, start_loop, step; int blksize, global_size, mysize, i, j, rc, start_loop, step;
ptrdiff_t stride; ptrdiff_t stride, disps[2];
global_size = gsize_array[dim]; global_size = gsize_array[dim];
@ -71,6 +72,20 @@ block(const int *gsize_array, int dim, int ndims, int nprocs,
/* in terms of no. of elements of type oldtype in this dimension */ /* in terms of no. of elements of type oldtype in this dimension */
if (mysize == 0) *st_offset = 0; if (mysize == 0) *st_offset = 0;
/* need to set the UB for block-cyclic to work */
disps[0] = 0; disps[1] = orig_extent;
if (order == MPI_ORDER_FORTRAN) {
for(i=0; i<=dim; i++) {
disps[1] *= gsize_array[i];
}
} else {
for(i=ndims-1; i>=dim; i--) {
disps[1] *= gsize_array[i];
}
}
rc = opal_datatype_resize( &(*type_new)->super, disps[0], disps[1] );
if (OMPI_SUCCESS != rc) return rc;
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }