<div dir="ltr"><div class="gmail_quote"><br><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="im">On Wed, Dec 25, 2013 at 9:36 PM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>Junchao Zhang <<a href="mailto:jczhang@mcs.anl.gov" target="_blank">jczhang@mcs.anl.gov</a>> writes:<br>
<br>
> To strictly obey MPI standard, we should declare MPI_2INT's type attribute<br>
> as<br>
><br>
> typedef int mpich_array_mpi_2int[2];<br>
> static const MPI_Datatype mpich_mpi_2int<br>
> MPICH_ATTR_TYPE_TAG_LAYOUT_COMPATIBLE (mpich_array_mpi_2int) =<br>
> MPI_2INT;<br>
<br>
</div>Why would you want this? How is this a more "strict" interpretation of<br>
the standard? Note that for heterogeneous pairs, such as<br>
MPI_DOUBLE_INT, the struct definition is the only one that really makes<br>
sense and gets padding correct.<br>
<div><br></div></blockquote></div><div>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.</div><div class="im"><div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div>
> The warning happens again. In reality, struct {int value; int loc; } should<br>
> have the same layout as int[2].<br>
<br>
</div>Guaranteed to be the same, yes.<br>
</blockquote></div></div><br></div></div>
</div><br></div>