[Mpi-forum] C++ types inaccessible after #281

N.M. Maclaren nmm1 at cam.ac.uk
Wed Jun 27 14:59:05 CDT 2012

On Jun 27 2012, Jim Dinan wrote:
>Apologies if I'm missing something, but this seems to be the same 
>situation as the Fortan types, which can be used in the C interface.  If 
>the user can't supply the needed compiler in a particular build, then an 
>implementation should be free to disable these types.

It's not the compiler that is the issue, because MPI needs only the C
facilities that are available in the C subset of C++.  It's what is defined
in the various standards.

I was hoping to get time to respond in a more carefully thought-out message,
but am in a WG5 meeting, so this is in haste.

Using C99 is NOT a solution, largely because the requirement is for use
from C++ and std::complex and std::bool do not have equivalents in C99
(_Complex ,and _Bool are semantically different, and are not required to
match those.  Also, the required language is C90, because C++03 inherits
from it, and C99 has been rejected (for VERY good reasons) by about half
of the C-using communities.

While C++11 nominally inherits from C99, it has not included _Complex or
_Bool, and has kept a lot of C90 semantics in cases where C99 and C90 are
incompatible.  Most of those don't affect this, but one aspect does.

Someone mentioned that C99 _Complex has better semantics than std::complex.
I am afraid that is the converse of the truth, especially when you bring
in the utterly appalling Annex G.  C++11 has included the function calls
for IEEE 754 support, but neither the pragmas nor the semantics, and the
combination is therefore totally undefined.

Yes, this is an ungodly mess.  I don't agree with the forum's decision,
but let's accept it.  The only reasonable approach is the one of having
MPI types for C++'s types, which could still be used via the C interface
from a C++ compiler.  I believe that is what you were referring to, and
what is intended.

Nick Maclaren.

More information about the mpi-forum mailing list