After a discussion with Rajeev and Rob, we found that the deprecated MPI_LB and MPI_UB
markers are still being used in the implementation of MPI_Type_create_subarray() and/or darray.
These markers were mistakenly carried over in MPI_Type_create_struct() causing an incorrect
lower bound for the newly created datatype. A test program that can reproduce the error is
attached. Below is its description.
The test program tries to concatenate two data types.
The first datatype is a contiguous space of 16 bytes at displacement 0.
The second is a subarray type at displacement 32, named bodytype created by MPI_Type_create_subarray().
The global array is 5*nprocs integers and subarray is of size 5 integers.
The two types were concatenated by MPI_Type_create_struct() to create
a new datatype named ftype. Here is the stdout for running it on 1 process.
--- the stdout from both mpich and openmpi ----
HEADER_EXTENT = 16 VAR_BEGIN = 32
bodytype lb= 0 ub=20 extent=20 size=20
ftype lb=32 ub=52 extent=20 size=36 true_lb= 0 true_extent=52
Problems:
1. ftype's lower bound should be 0. (mpich shows 32)
2. ftype's extent should be 52. (mpich shows 20)
3. packing 3 of ftypes to a contiguous array (27 integers) and its contents are incorrect.
ps. explicitly resizing ftype with lb=0 and extent=52 produces correct packed results, though.