Re: dynamic chapter changes

William Saphir (wcs@nsgi3.lbl.gov)
Mon, 19 May 1997 13:47:41 -0700

On May 19, 4:21pm, Dick Treumann wrote:
> Subject: Re: dynamic chapter changes
> William Saphir wrote:
> >
>
> > - changed MPI_COMM_GET_PARENT to return MPI_COMM_NULL if parent
> > has been freed or disconnected. Changed advice to users to reflect
> > this.
> >
> It seems to me that MPI_COMM_FREE on the communicator returned by
> MPI_COMM_GET_PARENT is about as reasonable as MPI_REQUEST_FREE on a
> receive request. MPI-1 does not call it erroneous but does point out
> that no reasonable program will do this.
> Is there a circumstance where an MPI spawn group could SAFELY follow a
> return from MPI_Comm_free on this communicator with a call to
> MPI_Abort(MPI_COMM_WORLD) or a segfault? I am refering to SAFE for the
> parent.
>
> If not, I would suggest either pointing this out in the new advice or
> even declaring MPI_COMM_FREE on this communicator an error.
>

I agree that MPI_COMM_FREE on the parent intercommunicator is
fairly useless. We have essentially deprecated MPI_COMM_FREE
in favor of MPI_COMM_DISCONNECT. I'd be happy to put in an
advice to users to this effect if there is no objection.
Seems to me though that disallowing COMM_FREE would just
confuse the issue (because it would be a special case
with no precedent).

Do any implementors expect that MPI_COMM_DISCONNECT might be
substantially more expensive than MPI_COMM_FREE? If so, there
is one case where a library might want to use COMM_FREE for its
side effect of hiding the fact that there is a parent.
For instance, user code might do:
MPI_Comm_get_parent(&parent);
if (parent == MPI_COMM_NULL) {
/* I'm a parent... */
spawn children...

} else {
/* I'm a child ... */
be a child
}
Now imagine that the parent is spawned by a library that wants
to allow the above user code to work.
The hiding can also be done with MPI_COMM_DISCONNECT, so the
only benefit to COMM_FREE might be performance.
I'm not advocating we recommend COMM_FREE for this, just trying
to make sure we don't miss anything.

Bill