Re: Comment on new INTENT paragraph

Dick Treumann (treumann@kgn.ibm.com)
Tue, 13 May 1997 12:37:48 -0400

Michael Hennecke wrote:

> If there are problems with the proper specification of some arguments as
> being OUT or INOUT, why not simply specify them as INOUT??? Which are these
> controversial procedures/arguments?

One area where problems exist relate to the fact that many MPI routines
are passed handles that represent opaque objects. To the user thinking
about his code it is often the state of the object which is of primary
interest. That is, is the object created or modified by the call. All
the compiler cares about (and all INTENT in Fortran refers to in the
case of handles and objects) is the handle. If, from the start of MPI 1
it had been decided that the IN, OUT, INOUT refered only to the actual
parameter then more of the labels would have been correct for C const
and Fortran INTENT. For better or worse, the decision was made that in
some cases IN/OUT/INOUT would reflect the impact on the object.

A second area is arguments to calls like MPI_Start or MPI_Type_commit
where some MPI implementations may actually modify the handle while
others will not.

I suspect that most deviations do involve labeling arguments as INOUT
when the language binding can be declared INTENT IN or const. I think a
quality implementation could use the optimal qualifier but the author of
portable MPI code must sometimes assume the more general case.

Does anyone argue that the MPI Standard saying the argument to MPI_Start
is an INOUT rules out an MPI implementation choosing to provide the
function prototype:
int MPI_Start(const MPI_Request *handle)
if that implementation does not change the handle when an MPI_Start is
done?

Dick

-- 
Dick Treumann                               IBM RS/6000 Division
(Internet) treumann@pok.ibm.com             Poughkeepsie, NY
(VNET)     TREUMANN at KGNVMC               Tel: (914) 433-7846
(internal) treumann@windsurf.pok.ibm.com    Fax: (914) 433-8363