<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<div class="moz-forward-container"><br>
<br>
-------- Forwarded Message --------
<table class="moz-email-headers-table" cellspacing="0"
cellpadding="0" border="0">
<tbody>
<tr>
<th valign="BASELINE" nowrap="nowrap" align="RIGHT">Subject:
</th>
<td>Re: [dune-pdelab] Fwd: Fwd: solver fails to reset
correctly after FMatrixError (singular matrix)</td>
</tr>
<tr>
<th valign="BASELINE" nowrap="nowrap" align="RIGHT">Date: </th>
<td>Wed, 24 Jul 2019 09:42:01 +0200</td>
</tr>
<tr>
<th valign="BASELINE" nowrap="nowrap" align="RIGHT">From: </th>
<td>Shubhangi Gupta <a class="moz-txt-link-rfc2396E" href="mailto:sgupta@geomar.de"><sgupta@geomar.de></a></td>
</tr>
<tr>
<th valign="BASELINE" nowrap="nowrap" align="RIGHT">Organisation:
</th>
<td>GEOMAR Helmholtz Center for Ocean Research Kiel</td>
</tr>
<tr>
<th valign="BASELINE" nowrap="nowrap" align="RIGHT">To: </th>
<td>Markus Blatt <a class="moz-txt-link-rfc2396E" href="mailto:markus@dr-blatt.de"><markus@dr-blatt.de></a></td>
</tr>
</tbody>
</table>
<br>
<br>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<p>Hi Markus,</p>
<p>Thanks a lot for your reply! I am answering your questions
below...<br>
</p>
<pre class="moz-quote-pre" wrap="">1. Does at the highest level mean outside the try clause? That might be wrong as it will throw if something went wrong. It needs to be inside the try clause.</pre>
<p>By highest level, I meant **inside** the try clause.</p>
<p><font size="-1"> <font color="#3333ff"> Dune::MPIGuard
guard;</font></font></p>
<p><font size="-1"> bool exceptionCaught = false;</font></p>
<p><font size="-1"> while( time < t_END ){<br>
<br>
try{<br>
<br>
// reactivate the guard for the next critical
operation<br>
<font color="#3333ff">guard.reactivate();</font><br>
<br>
osm.apply( time, dt, uold, unew );<br>
<br>
exceptionCaught = false;<br>
<br>
}catch ( Dune::Exception &e ) {<br>
exceptionCaught = true;</font></p>
<p><font size="-1"> // tell the guard that you
successfully passed a critical operation<br>
<font color="#3333ff">guard.finalize();</font><br>
<br>
unew = uold;<br>
<br>
dt *= 0.5;<br>
<br>
osm_tch.getPDESolver().discardMatrix();<br>
<br>
continue;<br>
}<br>
<br>
uold = unew;<br>
time += dt;<br>
}</font></p>
<pre class="moz-quote-pre" wrap="">2. freezes means deadlock (stopping at an iteration and never finishing)? That will happen in your code if the MPIGuard is before the try clause.
</pre>
<p>Yes, freezes means stopping at the iteration and never
finishing it. <br>
</p>
<p>So first, this was happening right after FMatrixError (singular
matrix). The osm froze without initiating Newton solver...
After I put the MPIGuard, this problem was solved... Newton
solver restarts as it should... But now the freezing happens
with the linear solver (BiCGStab, in this case). Nils said to
solve this I will have to put the MPIGuard also on lower levels
(inside newton and linear solver...). I, on the other hand,
prefer to not touch the dune core code and risk introducing more
errors along the way...</p>
<pre class="moz-quote-pre" wrap="">3. ....have you tried the poor-man's solution, below? ...</pre>
<p>Yes, I tried that, but the problem is if the apply step doesn't
finish, then nothing really happens...</p>
<p>My question: I was thinking, as a very quick and dirt
solution.... Is it possible to put some kind of a 'timeout
exception' around apply? If yes, what should that look like? (as
in, a rough outline of the code...) </p>
<p>Thanks a lot once again, and warm wishes, Shubhangi<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 23.07.19 16:12, Markus Blatt
wrote:<br>
</div>
<blockquote type="cite" cite="mid:20190723141233.GB124226@smaug">
<pre class="moz-quote-pre" wrap="">On Thu, Jul 11, 2019 at 02:56:35PM +0200, Shubhangi Gupta wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Dear Jö and Nils,
Thanks a lot for your replies.
I actually tried putting the mpiguard within the time loop (at the highest
level) just to see what happens...
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">Does at the highest level mean outside the try clause? That might be wrong as
it will throw if something went wrong. It needs to be inside the try clause.
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Indeed, the one step method now proceeds
as it should, but the BiCGSTab freezes...
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">freezes means deadlock (stopping at an iteration and never finishing)? That will
happen in your code if the MPIGuard is before the try clause.
Cheers,
Markus
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Dr. Shubhangi Gupta
Marine Geosystems
GEOMAR Helmholtz Center for Ocean Research
Wischhofstraße 1-3,
D-24148 Kiel
Room: 12-206
Phone: +49 431 600-1402
Email: <a class="moz-txt-link-abbreviated" href="mailto:sgupta@geomar.de" moz-do-not-send="true">sgupta@geomar.de</a></pre>
</div>
<pre class="moz-signature" cols="72">--
Dr. Shubhangi Gupta
Marine Geosystems
GEOMAR Helmholtz Center for Ocean Research
Wischhofstraße 1-3,
D-24148 Kiel
Room: 12-206
Phone: +49 431 600-1402
Email: <a class="moz-txt-link-abbreviated" href="mailto:sgupta@geomar.de">sgupta@geomar.de</a></pre>
</body>
</html>