On Wed, Dec 25, 2013 at 9:36 PM, Jed Brown <jedbrown@mcs.anl.gov> wrote:
Junchao Zhang <jczhang@mcs.anl.gov> writes:

> To strictly obey MPI standard, we should declare MPI_2INT's type attribute
> as
>
> typedef int mpich_array_mpi_2int[2];
> static const MPI_Datatype mpich_mpi_2int
> MPICH_ATTR_TYPE_TAG_LAYOUT_COMPATIBLE (mpich_array_mpi_2int) =
> MPI_2INT;

Why would you want this?  How is this a more "strict" interpretation of
the standard?  Note that for heterogeneous pairs, such as
MPI_DOUBLE_INT, the struct definition is the only one that really makes
sense and gets padding correct.

I tried to literally interpret "MPI_TYPE_CONTIGUOUS(2, MPI_REAL, MPI_2REAL)" stated in the standard. I agree in reality it is not more strict.
 
> The warning happens again. In reality, struct {int value; int loc; } should
> have the same layout as int[2].

Guaranteed to be the same, yes.