On Thu, Jul 14, 2011 at 23:34, Tobias Burnus <bur...@net-b.de> wrote: > Janne Blomqvist wrote: >> >> * caf/mpi.c (caf_runtime_error): Remove "error" parameter. >> Return EXIT_FAILURE instead. >> > From the patch: >> >> /* FIXME: Shutdown the Fortran RTL to flush the buffer. PR 43849. */ >> >> This is unnecessary, as the call to exit() will call the libgfortran >> destructor which will close all units, as explained in comment #3 in >> the PR. > > While I think it should be sufficient for single-processor usage, I am not > sure that that way all I/O buffers gets written before one calls > MPI_Finalize - nor am I sure how one would handle ERROR STOP with regards to > I/O.
Ah, I read that comment from caf/single.c, but now I see it in the caf/mpi.c part of the patch as well. Yeah, in that case it might matter, depending on how the MPI library implements MPI_Abort(). That is, does it call exit() (in which case the destructor will be called) or will it call abort() or raise some other fatal signal. At least Open MPI seems to implement it by sending SIGTERM http://www.open-mpi.org/doc/v1.4/man3/MPI_Abort.3.php Come to think of it, in this case, if you want to use MPI_Abort() rather than MPI_Finalize() + exit(), you should probably reset the fatal signal handlers to the default one unless you want the backtrace to be printed. -- Janne Blomqvist