]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Provide a second error for Trilinos sparsity pattern problems. 13452/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 25 Feb 2022 21:31:08 +0000 (14:31 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 28 Feb 2022 18:20:56 +0000 (11:20 -0700)
source/lac/trilinos_sparsity_pattern.cc

index 71111b2b6ea016f02e54ba4cca19602becd39c25..692c623d7b7d085104b74dde17bafd750044e706 100644 (file)
@@ -710,7 +710,25 @@ namespace TrilinosWrappers
         AssertThrow(ierr == 0, ExcTrilinosError(ierr));
       }
 
-    ierr = graph->OptimizeStorage();
+    try
+      {
+        ierr = graph->OptimizeStorage();
+      }
+    catch (const int error_code)
+      {
+        AssertThrow(
+          false,
+          ExcMessage(
+            "The Epetra_CrsGraph::OptimizeStorage() function "
+            "has thrown an error with code " +
+            std::to_string(error_code) +
+            ". You will have to look up the exact meaning of this error "
+            "in the Trilinos source code, but oftentimes, this function "
+            "throwing an error indicates that you are trying to allocate "
+            "more than 2,147,483,647 nonzero entries in the sparsity "
+            "pattern on the local process; this will not work because "
+            "Epetra indexes entries with a simple 'signed int'."));
+      }
     AssertThrow(ierr == 0, ExcTrilinosError(ierr));
   }
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.