<div dir="ltr">For the meeting tomorrow, I would like you all to consider the following:<div><br></div><div>There is consensus regarding the following to get type safety:</div><div>typedef struct MPI_ABI_Handle * MPI_Handle;<br></div><div><br></div><div>We have two choices for predefined handles:</div><div><br></div><div>Option 1:</div><div>#define MPI_INT (MPI_Datatype)0x3</div><div><br></div><div>Option 2:</div><div>#define MPI_INT (MPI_Datatype)&MPI_ABI_INT</div><div><br></div><div>Option 1 relies on implementation defined behavior regarding the casting of integers to pointers, but it is safe.  Gonzalo and I had a long discussion of this, and the only issue is that (intptr_t)MPI_INT == 0x3 is not guaranteed to be true, but (intptr_t)MPI_INT == (intptr_t)(void*)0x3 is.  Both MPICH and Open-MPI already rely on this technique for MPI_IN_PLACE, among others.</div><div><br></div><div>The advantage of Option 1 - assuming we use a sensible set of integer values - is that ABI compatibility layers can do translation via a table.  This is most useful for datatypes, where there are ~100 predefined handles, and to a lesser extent ops.  For all other handles, there are no more than 3 predefined handles (IIRC).</div><div><br></div><div>Option 2 allows run-time resolution of predefined handles, which I thought was good until I implemented it in <a href="https://github.com/jeffhammond/mukautuva">https://github.com/jeffhammond/mukautuva</a>.  While it works and means I can avoid predefined handle translations in the forward direction, I still have it in the backwards direction, and it's not exactly simple to resolve all the symbols.  I think Hui also implemented this in his compatibility layer, although I don't know if he hates it as much as I do.</div><div><br></div><div>The second question is whether to #define MPI_HANDLE_NULL (MPI_Handle*)0.  Lisandro argues for this, and it would make a lot of things easy.</div><div><br></div><div>I hope that we can decide these two questions today.  For the second meeting, we will address predefined integer constants.</div><div><br></div><div>Jeff<br><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Jeff Hammond<br><a href="mailto:jeff.science@gmail.com" target="_blank">jeff.science@gmail.com</a><br><a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a></div></div></div>