nmm1 at cam.ac.uk
Fri Feb 4 14:51:00 CST 2011
On Feb 4 2011, Jeff Squyres wrote:
> Question about MPI_UNDEFINED (and all the constants in the top table in
> MPI-2.2 p515): its type in C is listed as (const int) or unnamed (enum).
> But in Open MPI, we have this value in mpi.h as:
> #define MPI_UNDEFINED -32766
>So does MPICH2.
> A #define of an integer constant will work just fine with other const
> int's, but it technically isn't a const int or unnamed enum.
Er, technically there isn't any such animal as a const int type! const
is a type qualifier, that has effect only on lvalues (and which is
ignored on rvalues).
> Are we wrong? Or should I propose a ticket to change the wording of this
> table from:
> C type: const int (or unnamed enum)
> C type: const int, unnamed enum, or integer constant
That isn't any better - an integer constant isn't a type, and you need
to be specific about what you mean by one of those if you are nitpicking,
anyway - C has several different integer constant concepts.
In any case, it isn't a problem. The first paragraph of A.1.1 states
that a const int may be a literal integer constant. While the wording
isn't ideal, there are a LOT of places where the MPI specification uses
dubious (but not misleading) Fortran and C terminology.
More information about the mpi-forum