9 {
10
11 static int cnt = 1;
15
16 int rank = 0;
17 if (comm != PETSC_COMM_SELF)
18 MPI_Comm_rank(comm, &rank);
19
20 if (!rank) {
21
22 if (
p == PETSC_ERROR_INITIAL) {
23
24 char petsc_version[255];
25 PetscGetVersion(petsc_version, 255);
27
29 "--------------------- MoFEM Error Message "
30 "---------------------------------------------------");
31
32 MOFEM_LOG_C(
"SELF", MoFEM::Sev::error,
"MoFEM version %d.%d.%d (%s %s)",
33 MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD,
34 MOAB_VERSION_STRING, petsc_version);
35
36 MOFEM_LOG_C(
"SELF", MoFEM::Sev::error,
"MoFEM git commit id %s",
37 GIT_SHA1_NAME);
38
40 "See http://mofem.eng.gla.ac.uk/mofem/html/ "
41 "guidelines_bug_reporting.html for bug reporting.");
42
44 "SELF", MoFEM::Sev::error, "%s",
45 "Write to https://groups.google.com/forum/#!forum/mofem-group to "
46 "seek help.");
47 }
48
50
51 if (
p == PETSC_ERROR_INITIAL) {
52 if (mess)
54 }
55 MOFEM_LOG_C(
"SELF", MoFEM::Sev::error,
"#%d %s() line %d in %s", cnt++,
57
58 } else {
59 PetscTraceBackErrorHandler(PETSC_COMM_SELF, line,
fun, file,
n,
p, mess,
60 ctx);
61 }
62
63 PetscBool ismain, isunknown;
64 PetscStrncmp(
fun,
"main", 4, &ismain);
65 PetscStrncmp(
fun,
"unknown", 7, &isunknown);
66 if (ismain || isunknown) {
67
69#if PETSC_VERSION_GE(3, 7, 0)
70 PetscOptionsView(NULL, PETSC_VIEWER_STDERR_SELF);
71#else
72 PetscOptionsView(PETSC_VIEWER_STDERR_SELF);
73#endif
74 }
75
76
78 "-- MoFEM End of Error Message -- send entire error "
79 "message to mofem-group@googlegroups.com --");
80
81 }
82
83 } else {
84
85
86
87 PetscSleep(10.0);
88 abort();
89 }
90
92}
PetscErrorCode PetscVFPrintfDefault(FILE *fd, const char *format, va_list Argp)
#define MOFEM_LOG_C(channel, severity, format,...)
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
auto fun
Function to approximate.
FTensor::Index< 'n', SPACE_DIM > n
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
static FILE * dummy_mofem_fd
Dummy file pointer (DO NOT USE)