<div class="gmail_quote">On Sat, Feb 11, 2012 at 10:09 AM, Dmitri Gribenko <span dir="ltr"><<a href="mailto:gribozavr@gmail.com">gribozavr@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":3sv">Hello,<br>
<br>
=== Objective ===<br>
Implement a set of annotations for MPI libraries and a diagnostic for<br>
clang that checks that specified buffer type matches the passed<br>
MPI_Datatype.<br>
<br>
=== Background ===<br>
Many MPI functions take a void* `buffer' and an MPI_Datatype (like<br>
MPI_INT, MPI_LONG etc) that describes how to send/receive that buffer.<br>
 For example,<br>
<br>
int MPI_Send(void *buf, int count, MPI_Datatype datatype, int dest,<br>
    int tag, MPI_Comm comm);<br></div></blockquote></div><br><div>Before I look in much closer detail at this proposal, I'd really like to understand why the solution to the lack of type safety in this C API isn't to use a C++ API.</div>
<div><br></div><div>We have languages that provide strong type safety guarantees and high efficiency. It would be a shame to design and layer a type safety system on top of a C API like this rather than use those languages.</div>
<div><br></div><div>This isn't a hypothetical either, we have such C++ interfaces: <a href="http://www.boost.org/doc/libs/1_48_0/doc/html/mpi.html">http://www.boost.org/doc/libs/1_48_0/doc/html/mpi.html</a></div>