[dune-pdelab] Fwd: Re: Fwd: Fwd: solver fails to reset correctly after FMatrixError (singular matrix)

Shubhangi Gupta sgupta at geomar.de
Wed Jul 24 10:43:02 CEST 2019




-------- Forwarded Message --------
Subject: 	Re: [dune-pdelab] Fwd: Fwd: solver fails to reset correctly 
after FMatrixError (singular matrix)
Date: 	Wed, 24 Jul 2019 09:42:01 +0200
From: 	Shubhangi Gupta <sgupta at geomar.de>
Organisation: 	GEOMAR Helmholtz Center for Ocean Research Kiel
To: 	Markus Blatt <markus at dr-blatt.de>



Hi Markus,

Thanks a lot for your reply! I am answering your questions below...

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.

By highest level, I meant **inside** the try clause.

Dune::MPIGuard guard;

         bool exceptionCaught = false;

         while( time < t_END ){

             try{

                 // reactivate the guard for the next critical operation
guard.reactivate();

                 osm.apply( time, dt, uold, unew );

                 exceptionCaught = false;

             }catch ( Dune::Exception &e ) {
                 exceptionCaught = true;

                 // tell the guard that you successfully passed a 
critical operation
guard.finalize();

                 unew = uold;

                 dt *= 0.5;

                 osm_tch.getPDESolver().discardMatrix();

                 continue;
             }

             uold = unew;
             time += dt;
         }

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.

Yes, freezes means stopping at the iteration and never finishing it.

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...

3. ....have you tried the poor-man's solution, below? ...

Yes, I tried that, but the problem is if the apply step doesn't finish, 
then nothing really happens...

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...)

Thanks a lot once again, and warm wishes, Shubhangi


On 23.07.19 16:12, Markus Blatt wrote:
> On Thu, Jul 11, 2019 at 02:56:35PM +0200, Shubhangi Gupta wrote:
>> 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...
> 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.
>
>> Indeed, the one step method now proceeds
>> as it should, but the BiCGSTab freezes...
> 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

-- 
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:sgupta at geomar.de

-- 
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: sgupta at geomar.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune-pdelab/attachments/20190724/5c5303b6/attachment.htm>


More information about the dune-pdelab mailing list