<div dir="ltr"><div>I'm entangled in a discussion with Open MPI folks about whether the struct datatype constructor should or should not add padding depending on the oldtypes having or not explicit lb/ub markers. <a href="https://github.com/open-mpi/ompi/issues/8560">https://github.com/open-mpi/ompi/issues/8560</a></div><div><br></div><div>Please see the attached example. It basically creates a simple struct datatype with type signature {unsigned short, unsigned char} in different ways (which I would expect to be all equivalent).</div><div><br></div><div>Running it with latest MPICH 3.4.1</div><div><br></div><div><font face="monospace">$ for i in `seq 0 5`; do mpicc -DCASE=$i align.c; ./a.out; done<br>c-sizeof=4  mpi-extent=4<br>c-sizeof=4  mpi-extent=4<br>c-sizeof=4  mpi-extent=4<br>c-sizeof=4  mpi-extent=4<br>c-sizeof=4  mpi-extent=4<br>c-sizeof=4  mpi-extent=4<br></font></div><div><br></div><div>For Open MPI, up to v4.0.x, that was the case, too. </div><div>However, with latest Open 4.1.0, now I get:</div><div><br></div><div><font face="monospace">$ for i in `seq 0 5`; do mpicc -DCASE=$i align.c; ./a.out; done<br>c-sizeof=4  mpi-extent=4<br>c-sizeof=4  mpi-extent=4<br>c-sizeof=4  mpi-extent=4<br>c-sizeof=4  mpi-extent=4<br>c-sizeof=4  mpi-extent=3<br>c-sizeof=4  mpi-extent=2<br></font></div><div><br></div><div>Open MPI folks claim that their behavior is correct and in line with the MPI standard. Maybe they have a point regarding the ub/lb definition in page 105 of MPI-3.1, despite such behavior being quite unintuitive.</div><div><br></div><div>On the other hand, MPICH's struct datatype constructor always adjusts the ub to account for padding. Open MPI obviously don't. I don't see any wording in the standard where this could be implementation-defined behavior. If Open MPI folks are right, then MPICH is wrong, or the other way around. But we cannot have the two major competing implementations disagree on this.</div><div><br></div><div>Regards,</div><div><br></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Lisandro Dalcin<br>============<br>Senior Research Scientist<br>Extreme Computing Research Center (ECRC)<br>King Abdullah University of Science and Technology (KAUST)<br><a href="http://ecrc.kaust.edu.sa/" target="_blank">http://ecrc.kaust.edu.sa/</a><br></div></div></div></div>