[Mpi-forum] Did we screw up the const bindings in MPI-3?

Marc-Andre Hermanns m.a.hermanns at grs-sim.de
Thu May 23 03:59:27 CDT 2013

Pavan, all,

we had a similar reports from Scalasca users on systems with MPICH3.

I didn't quite follow the constness discussion in details, but I think 
modifying existing prototypes may always end up in some forward or 
backward incompatibility.

We solved it for us with a preprocessor macro that is prepended to all 
relevant buffer parameters. Depending on the MPI version the macro 
resolves to a 'const' or not. Quite low-tech, I know. ;-)

So far that has been working well and it wasn't much work to implement, 
as most of our wrappers are generated anyway. I am sure TAU will be able 
to adapt to this quickly as well. Therefore, I wouldn't speak of a 
complete 'screw-up'.

Personally, I am more concerned about adapting to the MPI-3 Fortran 
changes, because those will probably be more disruptive than this const 
issue. As far as I understood Jeff's explanations in one of the last 
tools telcos, the world as we know it for intercepting Fortran has ended 
and any tools vendor will have to work on their wrappers and their 
internals. Implementing the 'const-fix' along the way is probably not 
such a big deal then.

On 23.05.13 06:17, Pavan Balaji wrote:
> All,
> Some of our users complained that Tau doesn't work with the latest
> version of mpich.  After some investigation we discovered that this was
> an issue with the MPI-3 standard.  Specifically, we added const bindings
> for many of the MPI functions.  The thinking in the Forum was that this
> change is backward compatible since applications using MPI_Send don't
> have to change at all.  However, this seems to be causing problems for
> tools that redefine MPI functions.  Basically, a tool can no longer have
> a function like this:
> int MPI_Send(void *buf, int count, MPI_Datatype datatype, int dest, int
> tag, MPI_Comm comm)
> {
> 	/* Do magic */
> 	ret = PMPI_Send(...);
> 	/* Do some more magic */
> 	return ret;
> }
> The compiler will complain that this doesn't match the prototype in
> mpi.h which is:
> int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int
> dest, int tag, MPI_Comm comm);
> Am I missing something here?  Are all tools now required to have an #if
> MPI_VERSION >= 3 check?  Does this mean that all existing tools are now
> broken for MPI-3 implementations?
>   -- Pavan

Marc-Andre Hermanns
German Research School for
Simulation Sciences GmbH
c/o Laboratory for Parallel Programming
52062 Aachen | Germany

Tel +49 241 80 99753
Fax +49 241 80 6 99753
Web www.grs-sim.de

Members: Forschungszentrum Jülich GmbH | RWTH Aachen University
Registered in the commercial register of the local court of
Düren (Amtsgericht Düren) under registration number HRB 5268
Registered office: Jülich
Executive board: Prof. Marek Behr, Ph.D | Prof. Dr. Sebastian M. Schmidt

More information about the mpi-forum mailing list