Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] MPI Forum question?
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2010-04-30 08:15:02

On Apr 30, 2010, at 5:59 AM, N.M. Maclaren wrote:

> MPI quite rightly does not specify this, because the matter is very system-
> dependent, and it is not possible to return the exit code (or display it)
> in all environments. Sorry, but that is reality.

Correct -- MPI intentionally does not say what happens after MPI_FINALIZE. MPI intentionally doesn't even specify much about how to start an MPI job (just like Fortran, actually).

> The last paragraph of the specification of MPI_Finalize makes it clear
> that it is the USER'S responsibility to return an exit code to the system
> for process 0, and that what happens for other ones is undefined. Or
> fairly clear - it could be stated in so many words, rather than being
> implicit in the requirement on implementors.

I don't think that's quite feasible, because the user doesn't directly control what mpirun returns. So (many) implementations *have* to choose something from their job start agent (mpirun or mpiexec or whatever).

I think OMPI's behavior of returning 0 from mpirun if and only if all processes call MPI_FINALIZE successfully *and* return 0 is good. Return arbitrary nonzero if some process aborts (calling MPI_ABORT, not calling MPI_INIT, not calling MPI_FINALIZE, or otherwise). Return any of the individual MPI processes' non-zero exit status if all call MPI_FINALIZE but some (or all) don't return an exit status of 0 (I don't have a strong opinion about which one to return -- e.g., the *first* one to return a non-zero exit value, the *highest* or *lowest* non-zero exit status, ...etc.).

Jeff Squyres
For corporate legal information go to: