From: Wolfgang Bangerth Date: Fri, 25 Feb 2022 21:31:08 +0000 (-0700) Subject: Provide a second error for Trilinos sparsity pattern problems. X-Git-Tag: v9.4.0-rc1~427^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13452%2Fhead;p=dealii.git Provide a second error for Trilinos sparsity pattern problems. --- diff --git a/source/lac/trilinos_sparsity_pattern.cc b/source/lac/trilinos_sparsity_pattern.cc index 71111b2b6e..692c623d7b 100644 --- a/source/lac/trilinos_sparsity_pattern.cc +++ b/source/lac/trilinos_sparsity_pattern.cc @@ -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)); }