Dear Hai,

I forwarded this mail to the mailing list because I think it is of general interest. The version 2.6 is not updated with the bug fix. The new version 2.7 which will be released on 10. April will contain the bug fix. You can either switch to svn trunk or use the patch attached to this mail.

Execute the following command in your dumux folder.

patch -p0 <ParallelFreeze.patch

Best regards
Alex


On 03/24/2015 09:21 PM, Thanh Hai Ong wrote:
Dear Alexander,

I saw your comment about "the bug described in FS#221 concerning freezes during parallel runs
because of DUNE-THROWS thrown from processes with rank greater than zero
has been fixed", concern your email below.
Please let me know if the version dumux 2.6 has been updated with
the needed function in implicitmodel.hh

Thanks
Hai



On Tuesday, March 24, 2015 2:00 PM, "[email protected]" <[email protected]> wrote:


Send Dumux mailing list submissions to
[email protected] <mailto:[email protected]>

To subscribe or unsubscribe via the World Wide Web, visit
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux
or, via email, send a message with subject or body 'help' to
[email protected] <mailto:[email protected]>

You can reach the person managing the list at
[email protected] <mailto:[email protected]>

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Dumux digest..."


Today's Topics:

  1. Flyspray Activity for Task 221 (Exceptions lead to freeze    or
      fatal error during parallel computations) (DuMuX)
  2. Bug fix for parallel runs (Alexander Kissinger)


----------------------------------------------------------------------

Message: 1
Date: Mon, 23 Mar 2015 17:37:55 +0000
From: DuMuX <[email protected] <mailto:[email protected]>> To: [email protected] <mailto:[email protected]>
Subject: [DuMuX] Flyspray Activity for Task 221 (Exceptions lead to
    freeze    or fatal error during parallel computations)
Message-ID: <[email protected] <mailto:[email protected]>>
Content-Type: text/plain; charset=utf-8

THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

The following task is now closed:

FS#221 - Exceptions lead to freeze or fatal error during parallel computations
User who did this - Alexander Kissinger (alexk)

Reason for closing: Fixed
Additional comments about closing: With r14431 this bug has been fixed.
The error occurs in the compositional multi-phase models 2p2c, 3p3c and co2 during the update of the static data
- The problem has been fixed for the three models
- Additionally another check in the implicitmodel.hh update() function was added to make sure that no process converges if all the other processes have not converged as well.


More information can be found at the following URL:
http://www.dumux.org/flyspray/index.php?do=details&task_id=221

You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.


------------------------------

Message: 2
Date: Mon, 23 Mar 2015 18:50:46 +0100
From: Alexander Kissinger <[email protected] <mailto:[email protected]>> To: DuMuX User Forum <[email protected] <mailto:[email protected]>>
Subject: [DuMuX] Bug fix for parallel runs
Message-ID: <[email protected] <mailto:[email protected]>>
Content-Type: text/plain; charset=windows-1252; format=flowed

Dear Dumux,

the bug described in FS#221 concerning freezes during parallel runs
because of DUNE-THROWS thrown from processes with rank greater than zero
has been fixed. This bug concerns all compositional multi-phase models
(2p2c, co2 and 3p3c). It should now be possible to uncomment the
DUNE-THROWS in the fluidsystem or the component files. If an error is
thrown the time step should be reduced as for single process runs.
Please report if you notice otherwise.

Best regards
Alex

--
Alexander Kissinger
Institut f?r Wasser- und Umweltsystemmodellierung
Lehrstuhl f?r Hydromechanik und Hydrosystemmodellierung
Pfaffenwaldring 61
D-70569 Stuttgart

Telefon: +49 (0) 711 685-64729
E-Mail: [email protected] <mailto:[email protected]>



------------------------------

Subject: Digest Footer

_______________________________________________
Dumux mailing list
[email protected] <mailto:[email protected]>
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux


------------------------------

End of Dumux Digest, Vol 50, Issue 8
************************************




--
Alexander Kissinger
Institut für Wasser- und Umweltsystemmodellierung
Lehrstuhl für Hydromechanik und Hydrosystemmodellierung
Pfaffenwaldring 61
D-70569 Stuttgart

Telefon: +49 (0) 711 685-64729
E-Mail:  [email protected]

Index: dumux/implicit/2p2c/2p2cmodel.hh
===================================================================
--- dumux/implicit/2p2c/2p2cmodel.hh	(revision 14333)
+++ dumux/implicit/2p2c/2p2cmodel.hh	(working copy)
@@ -507,47 +507,68 @@
                           const SolutionVector &oldGlobalSol)
     {
         bool wasSwitched = false;
+        int succeeded;
+        try {
+            for (unsigned i = 0; i < staticDat_.size(); ++i)
+                staticDat_[i].visited = false;
 
-        for (unsigned i = 0; i < staticDat_.size(); ++i)
-            staticDat_[i].visited = false;
-
-        FVElementGeometry fvGeometry;
-        static VolumeVariables volVars;
-        ElementIterator eIt = this->gridView_().template begin<0> ();
-        const ElementIterator &eEndIt = this->gridView_().template end<0> ();
-        for (; eIt != eEndIt; ++eIt)
-        {
-            fvGeometry.update(this->gridView_(), *eIt);
-            for (int scvIdx = 0; scvIdx < fvGeometry.numScv; ++scvIdx)
+            FVElementGeometry fvGeometry;
+            static VolumeVariables volVars;
+            ElementIterator eIt = this->gridView_().template begin<0> ();
+            const ElementIterator &eEndIt = this->gridView_().template end<0> ();
+            for (; eIt != eEndIt; ++eIt)
             {
+                fvGeometry.update(this->gridView_(), *eIt);
+                for (int scvIdx = 0; scvIdx < fvGeometry.numScv; ++scvIdx)
+                {
 #if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
-                int dofIdxGlobal = this->dofMapper().subIndex(*eIt, scvIdx, dofCodim);
+                    int dofIdxGlobal = this->dofMapper().subIndex(*eIt, scvIdx, dofCodim);
 #else
-                int dofIdxGlobal = this->dofMapper().map(*eIt, scvIdx, dofCodim);
+                    int dofIdxGlobal = this->dofMapper().map(*eIt, scvIdx, dofCodim);
 #endif
 
-                if (staticDat_[dofIdxGlobal].visited)
-                    continue;
+                    if (staticDat_[dofIdxGlobal].visited)
+                        continue;
 
-                staticDat_[dofIdxGlobal].visited = true;
-                volVars.update(curGlobalSol[dofIdxGlobal],
-                               this->problem_(),
-                               *eIt,
-                               fvGeometry,
-                               scvIdx,
-                               false);
-                const GlobalPosition &globalPos = fvGeometry.subContVol[scvIdx].global;
-                if (primaryVarSwitch_(curGlobalSol,
-                                      volVars,
-                                      dofIdxGlobal,
-                                      globalPos))
-                {
-                    this->jacobianAssembler().markDofRed(dofIdxGlobal);
-                    wasSwitched = true;
+                    staticDat_[dofIdxGlobal].visited = true;
+                    volVars.update(curGlobalSol[dofIdxGlobal],
+                            this->problem_(),
+                            *eIt,
+                            fvGeometry,
+                            scvIdx,
+                            false);
+                    const GlobalPosition &globalPos = fvGeometry.subContVol[scvIdx].global;
+                    if (primaryVarSwitch_(curGlobalSol,
+                            volVars,
+                            dofIdxGlobal,
+                            globalPos))
+                    {
+                        this->jacobianAssembler().markDofRed(dofIdxGlobal);
+                        wasSwitched = true;
+                    }
                 }
             }
+            succeeded = 1;
         }
+        catch (Dumux::NumericalProblem &e)
+        {
+            std::cout << "\n"
+                      << "Rank " << this->problem_().gridView().comm().rank()
+                      << " caught an exception while updating the static data." << e.what()
+                      << "\n";
+            succeeded = 0;
+        }
+        //make sure that all processes succeeded. If not throw a NumericalProblem to decrease the time step size.
+        if (this->gridView_().comm().size() > 1)
+            succeeded = this->gridView_().comm().min(succeeded);
 
+        if (!succeeded) {
+            if(this->problem_().gridView().comm().rank() == 0)
+                DUNE_THROW(NumericalProblem,
+                        "A process did not succeed in updating the static data.");
+            return;
+        }
+
         // make sure that if there was a variable switch in an
         // other partition we will also set the switch flag
         // for our partition.
Index: dumux/implicit/3p3c/3p3cmodel.hh
===================================================================
--- dumux/implicit/3p3c/3p3cmodel.hh	(revision 14333)
+++ dumux/implicit/3p3c/3p3cmodel.hh	(working copy)
@@ -495,47 +495,69 @@
                           const SolutionVector &oldGlobalSol)
     {
         bool wasSwitched = false;
+        int succeeded;
+        try {
 
-        for (unsigned i = 0; i < staticDat_.size(); ++i)
-            staticDat_[i].visited = false;
+            for (unsigned i = 0; i < staticDat_.size(); ++i)
+                staticDat_[i].visited = false;
 
-        FVElementGeometry fvGeometry;
-        static VolumeVariables volVars;
-        ElementIterator eIt = this->gridView_().template begin<0> ();
-        const ElementIterator &eEndIt = this->gridView_().template end<0> ();
-        for (; eIt != eEndIt; ++eIt)
-        {
-            fvGeometry.update(this->gridView_(), *eIt);
-            for (int scvIdx = 0; scvIdx < fvGeometry.numScv; ++scvIdx)
+            FVElementGeometry fvGeometry;
+            static VolumeVariables volVars;
+            ElementIterator eIt = this->gridView_().template begin<0> ();
+            const ElementIterator &eEndIt = this->gridView_().template end<0> ();
+            for (; eIt != eEndIt; ++eIt)
             {
+                fvGeometry.update(this->gridView_(), *eIt);
+                for (int scvIdx = 0; scvIdx < fvGeometry.numScv; ++scvIdx)
+                {
 #if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
-                int dofIdxGlobal = this->dofMapper().subIndex(*eIt, scvIdx, dofCodim);
+                    int dofIdxGlobal = this->dofMapper().subIndex(*eIt, scvIdx, dofCodim);
 #else
-                int dofIdxGlobal = this->dofMapper().map(*eIt, scvIdx, dofCodim);
+                    int dofIdxGlobal = this->dofMapper().map(*eIt, scvIdx, dofCodim);
 #endif
 
-                if (staticDat_[dofIdxGlobal].visited)
-                    continue;
+                    if (staticDat_[dofIdxGlobal].visited)
+                        continue;
 
-                staticDat_[dofIdxGlobal].visited = true;
-                volVars.update(curGlobalSol[dofIdxGlobal],
-                               this->problem_(),
-                               *eIt,
-                               fvGeometry,
-                               scvIdx,
-                               false);
-                const GlobalPosition &globalPos = fvGeometry.subContVol[scvIdx].global;
-                if (primaryVarSwitch_(curGlobalSol,
-                                      volVars,
-                                      dofIdxGlobal,
-                                      globalPos))
-                {
-                    this->jacobianAssembler().markDofRed(dofIdxGlobal);
-                    wasSwitched = true;
+                    staticDat_[dofIdxGlobal].visited = true;
+                    volVars.update(curGlobalSol[dofIdxGlobal],
+                            this->problem_(),
+                            *eIt,
+                            fvGeometry,
+                            scvIdx,
+                            false);
+                    const GlobalPosition &globalPos = fvGeometry.subContVol[scvIdx].global;
+                    if (primaryVarSwitch_(curGlobalSol,
+                            volVars,
+                            dofIdxGlobal,
+                            globalPos))
+                    {
+                        this->jacobianAssembler().markDofRed(dofIdxGlobal);
+                        wasSwitched = true;
+                    }
                 }
             }
+            succeeded = 1;
         }
+        catch (Dumux::NumericalProblem &e)
+        {
+            std::cout << "\n"
+                      << "Rank " << this->problem_().gridView().comm().rank()
+                      << " caught an exception while updating the static data." << e.what()
+                      << "\n";
+            succeeded = 0;
+        }
+        //make sure that all processes succeeded. If not throw a NumericalProblem to decrease the time step size.
+        if (this->gridView_().comm().size() > 1)
+            succeeded = this->gridView_().comm().min(succeeded);
 
+        if (!succeeded) {
+            if(this->problem_().gridView().comm().rank() == 0)
+                DUNE_THROW(NumericalProblem,
+                        "A process did not succeed in updating the static data.");
+            return;
+        }
+
         // make sure that if there was a variable switch in an
         // other partition we will also set the switch flag
         // for our partition.
Index: dumux/implicit/co2/co2model.hh
===================================================================
--- dumux/implicit/co2/co2model.hh	(revision 14333)
+++ dumux/implicit/co2/co2model.hh	(working copy)
@@ -100,43 +100,66 @@
                            const SolutionVector &oldGlobalSol)
      {
          bool wasSwitched = false;
+         int succeeded;
+         try {
 
-         for (unsigned i = 0; i < ParentType::staticDat_.size(); ++i)
-             ParentType::staticDat_[i].visited = false;
+             for (unsigned i = 0; i < ParentType::staticDat_.size(); ++i)
+                 ParentType::staticDat_[i].visited = false;
 
-         FVElementGeometry fvGeometry;
-         static VolumeVariables volVars;
-         ElementIterator eIt = this->gridView_().template begin<0> ();
-         const ElementIterator &eEndIt = this->gridView_().template end<0> ();
-         for (; eIt != eEndIt; ++eIt)
-         {
-             fvGeometry.update(this->gridView_(), *eIt);
-             for (int scvIdx = 0; scvIdx < fvGeometry.numScv; ++scvIdx)
+             FVElementGeometry fvGeometry;
+             static VolumeVariables volVars;
+             ElementIterator eIt = this->gridView_().template begin<0> ();
+             const ElementIterator &eEndIt = this->gridView_().template end<0> ();
+             for (; eIt != eEndIt; ++eIt)
              {
-                 int dofIdxGlobal = this->dofMapper().map(*eIt, scvIdx, dofCodim);
 
-                 if (ParentType::staticDat_[dofIdxGlobal].visited)
-                     continue;
+                 fvGeometry.update(this->gridView_(), *eIt);
+                 for (int scvIdx = 0; scvIdx < fvGeometry.numScv; ++scvIdx)
+                 {
+                     int dofIdxGlobal = this->dofMapper().map(*eIt, scvIdx, dofCodim);
 
-                 ParentType::staticDat_[dofIdxGlobal].visited = true;
-                 volVars.update(curGlobalSol[dofIdxGlobal],
-                                this->problem_(),
-                                *eIt,
-                                fvGeometry,
-                                scvIdx,
-                                false);
-                 const GlobalPosition &globalPos = eIt->geometry().corner(scvIdx);
-                 if (primaryVarSwitch_(curGlobalSol,
-                                       volVars,
-                                       dofIdxGlobal,
-                                       globalPos))
-                 {
-                     this->jacobianAssembler().markDofRed(dofIdxGlobal);
-                     wasSwitched = true;
+                     if (ParentType::staticDat_[dofIdxGlobal].visited)
+                         continue;
+
+                     ParentType::staticDat_[dofIdxGlobal].visited = true;
+                     volVars.update(curGlobalSol[dofIdxGlobal],
+                             this->problem_(),
+                             *eIt,
+                             fvGeometry,
+                             scvIdx,
+                             false);
+                     const GlobalPosition &globalPos = eIt->geometry().corner(scvIdx);
+                     if (primaryVarSwitch_(curGlobalSol,
+                             volVars,
+                             dofIdxGlobal,
+                             globalPos))
+                     {
+                         this->jacobianAssembler().markDofRed(dofIdxGlobal);
+                         wasSwitched = true;
+                     }
                  }
              }
+             succeeded = 1;
          }
+         catch (Dumux::NumericalProblem &e)
+         {
+             std::cout << "\n"
+                     << "Rank " << this->problem_().gridView().comm().rank()
+                     << " caught an exception while updating the static data." << e.what()
+                     << "\n";
+             succeeded = 0;
+         }
+         //make sure that all processes succeeded. If not throw a NumericalProblem to decrease the time step size.
+         if (this->gridView_().comm().size() > 1)
+             succeeded = this->gridView_().comm().min(succeeded);
 
+         if (!succeeded) {
+             if(this->problem_().gridView().comm().rank() == 0)
+                 DUNE_THROW(NumericalProblem,
+                         "A process did not succeed in updating the static data.");
+             return;
+         }
+
          // make sure that if there was a variable switch in an
          // other partition we will also set the switch flag
          // for our partition.
Index: dumux/implicit/common/implicitmodel.hh
===================================================================
--- dumux/implicit/common/implicitmodel.hh	(revision 14333)
+++ dumux/implicit/common/implicitmodel.hh	(working copy)
@@ -459,7 +459,12 @@
 
         asImp_().updateBegin();
 
-        bool converged = solver.execute(controller);
+        int converged = solver.execute(controller);
+         
+        if (this->gridView_().comm().size() > 1)
+        {
+            converged = this->gridView_().comm().min(converged);
+        }
         if (converged) {
             asImp_().updateSuccessful();
         }
_______________________________________________
Dumux mailing list
[email protected]
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux

Reply via email to