This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, Fortran] Add caf_runtime_error to libgfortran/caf/single.c


On Thu, Jul 14, 2011 at 23:34, Tobias Burnus <burnus@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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]