<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi,<br>
<br>
maybe a construct like this helps?:<br>
<br>
int exceptionThrown = 0;<br>
try {<br>
// Code that might throw<br>
}<br>
catch ... {<br>
exceptionThrown = 1;<br>
}<br>
exceptionThrown = gridView_().comm().max(exceptionThrown);<br>
if (exceptionThrown) {<br>
// do something about it<br>
}<br>
<br>
By this, every process gets to know if an exception has been
thrown by at least one process. If the "// Code that might throw"
contains MPI routines after the throws, this won't help.<br>
<br>
Kind regards<br>
Bernd<br>
<br>
On 11/08/2016 11:31 AM, Steffen Müthing wrote:<br>
</div>
<blockquote
cite="mid:C08851AB-9948-4437-B967-5C4347AC0F96@iwr.uni-heidelberg.de"
type="cite">
<pre wrap="">Hi Aleksejs,
</pre>
<blockquote type="cite">
<pre wrap="">Am 08.11.2016 um 10:27 schrieb Aleksejs Fomins <a class="moz-txt-link-rfc2396E" href="mailto:aleksejs.fomins@lspr.swiss"><aleksejs.fomins@lspr.swiss></a>:
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?
</pre>
</blockquote>
<pre wrap="">
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
</pre>
<blockquote type="cite">
<pre wrap="">
Best regards,
Aleksejs
_______________________________________________
Dune mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Dune@dune-project.org">Dune@dune-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.dune-project.org/mailman/listinfo/dune">http://lists.dune-project.org/mailman/listinfo/dune</a>
</pre>
</blockquote>
<pre wrap="">
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Dune mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Dune@dune-project.org">Dune@dune-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.dune-project.org/mailman/listinfo/dune">http://lists.dune-project.org/mailman/listinfo/dune</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
_______________________________________________________________
Bernd Flemisch phone: +49 711 685 69162
IWS, Universität Stuttgart fax: +49 711 685 60430
Pfaffenwaldring 61 email: <a class="moz-txt-link-abbreviated" href="mailto:bernd@iws.uni-stuttgart.de">bernd@iws.uni-stuttgart.de</a>
D-70569 Stuttgart url: <a class="moz-txt-link-abbreviated" href="http://www.hydrosys.uni-stuttgart.de">www.hydrosys.uni-stuttgart.de</a>
_______________________________________________________________
</pre>
</body>
</html>