15
15
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
16
16
* Copyright (c) 2016 Los Alamos National Security, LLC. All rights
17
17
* reserved.
18
+ * Copyright (c) 2017 IBM Corporation. All rights reserved.
18
19
* $COPYRIGHT$
19
20
*
20
21
* Additional copyrights may follow
@@ -35,7 +36,7 @@ block(const int *gsize_array, int dim, int ndims, int nprocs,
35
36
ptrdiff_t * st_offset )
36
37
{
37
38
int blksize , global_size , mysize , i , j , rc , start_loop , step ;
38
- ptrdiff_t stride ;
39
+ ptrdiff_t stride , disps [ 2 ] ;
39
40
40
41
global_size = gsize_array [dim ];
41
42
@@ -71,6 +72,20 @@ block(const int *gsize_array, int dim, int ndims, int nprocs,
71
72
/* in terms of no. of elements of type oldtype in this dimension */
72
73
if (mysize == 0 ) * st_offset = 0 ;
73
74
75
+ /* need to set the UB for block-cyclic to work */
76
+ disps [0 ] = 0 ; disps [1 ] = orig_extent ;
77
+ if (order == MPI_ORDER_FORTRAN ) {
78
+ for (i = 0 ; i <=dim ; i ++ ) {
79
+ disps [1 ] *= gsize_array [i ];
80
+ }
81
+ } else {
82
+ for (i = ndims - 1 ; i >=dim ; i -- ) {
83
+ disps [1 ] *= gsize_array [i ];
84
+ }
85
+ }
86
+ rc = opal_datatype_resize ( & (* type_new )-> super , disps [0 ], disps [1 ] );
87
+ if (OMPI_SUCCESS != rc ) return rc ;
88
+
74
89
return OMPI_SUCCESS ;
75
90
}
76
91
0 commit comments