Re: Exit code (aka call-backs in finalize)

Steve Huss-Lederman (lederman@cs.wisc.edu)
Mon, 16 Sep 1996 09:34:54 -0500

Leslie raises some good points. Due to our computer problems here I
did not see them before I began rewriting the external chapter. I
think I too was concerned about the same ideas and touched on each of
them. However, some are not clear exactly what to do. I'll summarize
the changes here to start a discussion. I hope to have the full
chapter out soon (assuming our computer problems are finally solved.)

>
> I generally like using the call-back functions attached to MPI_COMM_WORLD
> to cause exit code to be invoked in MPI_Finalize. There are a few
> flaws I think we can clean up with a few sentences.
>
> 1) Does this apply only to MPI_COMM_WORLD? I think that is the intent.

I changed to text to cause finalize to "free" all communicators. The
last one is MPI_COMM_WORLD, next to last MPI_COMM_SELF and the rest
are in implementation dependent order. I see both advantages and
problems with this way. The pluses are it is more general, the
negatives are it can lead to problems (see below).

>
> 2) Is MPI_COMM_SELF better? Maybe, maybe not.

See above.

>
> 3) When do the call-backs get executed?
> I think we need to make this painfully clear. We need to say
> that the call-backs are called in reverse order (which is already
> said). We also need to say that it is AS THOUGH they were
> called immediately before MPI_Finalize. We also need to say
> that MPI_COMM_WORLD is not yet freed (maybe we need to rephrase
> the part that indicates that the call-backs are invoked by
> something a free of MPI_COMM_WORLD).

Right now an implementation may not need to make MPI_Finalize
collective. If we inforse that MPI_COMM_WORLD is still valid on all
processes then it will likely have to be. I also raised the issue of
whether one can call MPI functions inside the callbacks. Users may
want this but it may have unexpected results are the system begins to
shut down.

Steve