[MPI3 Fortran] [Mpi3-tools] Issues with Fortran bindings for MPI_Pcontrol

Jeff Squyres (jsquyres) jsquyres at cisco.com
Mon Apr 15 15:03:53 CDT 2013


On Apr 14, 2013, at 9:01 PM, Jeff Hammond <jhammond at alcf.anl.gov> wrote:

> It seems better to correct the text than to break the existing
> definition of MPI_PCONTROL.  What error code would be returned
> anyways?


I think the point is that we don't know what could/would be returned by Pcontrol, because Pcontrol can be subsumed by a profiling library, and therefore it can do whatever it wants.

The issue here is that the C API is varargs, and therefore allows you to pass in whatever you want to Pcontrol (at least in C), and therefore a tool (or the underlying C MPI API) can document what arguments it expects.

There's (at least) two problems with this:

1. If a profiling library and the MPI library have differing arguments that they expect, even though varargs makes the different signatures compile-time safe, there could still be run-time errors (this is a contradiction that I've never understood in the definition of Pcontrol).

2. Fortran has no varargs.  Prior to MPI 2.2, we actually did have a "..." in the Fortran prototype to indicate that you could do whatever you wanted for this signature.  And that was fine in the days before strict dummy argument type checking.  But now we mandate struct signature checking, and ... had to go, because it's not legal Fortran.  And now the text doesn't say "Fortran implementations can add whatever parameters they want" (which has problems, anyway).

I'm really in favor of ditching the PMPI layer and putting something better there.

-- 
Jeff Squyres
jsquyres at cisco.com
For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/





More information about the mpiwg-fortran mailing list