> > MPI-1 requires that "all named MPI constants can be used in
> > initialization expressions or assignments like C constants."
>
> > This does not require them to be integers (indices). For example the
> > following works and fulfills the above requirements.
> It's helpful to keep in mind the canonical example:
> extern FILE __sF[];
> #define stdin (&__sF[0])
> #define stdout (&__sF[1])
> #define stderr (&__sF[2])
One big caveat here -- when one says the constants can be used for
initialization like C constants, I believe that means they can be used
before MPI_Init() is called. So, implementations using pointers may
have a problem (and many do), in that the values of the pointers (and
the structures they reference) are set when MPI_Init() is called.
In the canonical example, the file table is initialized before main()
is called, so stdin can be copied (or more precisely, the contents of
stdin can be copied) at any point in the program.
Regards,
Andrew Lumsdaine