[Dune] DUNE_THROW behaviour in parallel

Steffen Müthing steffen.muething at iwr.uni-heidelberg.de
Tue Nov 8 11:31:35 CET 2016


Hi Aleksejs,

> Am 08.11.2016 um 10:27 schrieb Aleksejs Fomins <aleksejs.fomins at lspr.swiss>:
> 
> Dear Dune,
> 
> In my experience DUNE_THROW (or the way I am using it) is working imperfectly in parallel.
> 
> It is frequent that an exception is thrown on one or two of the many processes that are running my code. However, this does not terminate the entire code, as the other processes continue running. Further, if some of the processes start MPI communication at the same time, this causes a deadlock, and the program never crashes, as the remaining processes are waiting for the processes already crashed. As a result, if I am starting a large calculation and miss one line of error text in the output, I end up waiting in vain.
> 
> I am not an expert in MPI, so perhaps some of you could advise me:
> 
> Is it possible to throw an exception in such a way, that all processes running the job would crash, not just one of them?

no, that won’t work without support by some kind of runtime - in general, you don’t even know what code the remote processes
are currently executing, so there is no way to make them throw an exception from the outside.

The only thing that might be feasible would be to install an exception handler at main scope (i.e. you exit main without handling
the exception) that sends some kind of abort message via MPI to the other processes. However, that would require the other
processes to listen to such a request, which will only work if you dedicate a separate thread to the job (and have a truly multithreaded
MPI implementation).

So, I don’t really see a way.

Steffen

> 
> 
> Best regards,
> 
> Aleksejs
> 
> 
> 
> 
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20161108/7b464c20/attachment.sig>


More information about the Dune mailing list