[Mpi-forum] Reserved MPI_ prefix & namespace in C and Fortran

Jeremiah Willcock jewillco at osl.iu.edu
Fri Aug 24 17:22:44 CDT 2012


On Fri, 24 Aug 2012, N.M. Maclaren wrote:

> On Aug 24 2012, Rolf Rabenseifner wrote:
>> 
>> Nick, I chose the examples mainly based on what is really
>> used in the MPI standard.
>> Fortran, yes procedures is the combination of functions and subroutines,
>> change is really needed, because it is wording about Fortran.
>> The other things in Fortran are not used in MPI, but still touched by
>> the general word "names", because future MPI versions can use them.
>
> The trouble is that even things that you DON'T use can conflict!
> For example, in Fortran, COMMON block names will clash with external
> procedure names and BIND(C) variable names in modules.  C is, as always,
> orders of magnitude more complicated :-(
>
> However, if they are merely examples, it doesn't matter.  Forbidding
> even local names is harsher than needed, but is at least simple.
> Like you, I teach the students not to use ANY name beginning with
> MPI_, anywhere, though I personally know when it is safe to do so!
>
> Well, I assume that you teach that :-)

Forbidding use as a local name is important if you want to use that name 
as a macro in C or C++ (or Fortran with a CPP-like preprocessor).  Thus, 
it might make sense to do that for at least some names as well, at least 
for the C and mpif.h bindings.

-- Jeremiah Willcock



More information about the mpi-forum mailing list