20#include "libmesh/libmesh.h"
21#include "libmesh/libmesh_common.h"
22#include "libmesh/print_trace.h"
23#include "libmesh/threads.h"
26#ifdef LIBMESH_HAVE_SYS_TYPES_H
29#ifdef LIBMESH_HAVE_UNISTD_H
33#ifdef LIBMESH_HAVE_CSIGNAL
37#if defined(LIBMESH_HAVE_GCC_ABI_DEMANGLE)
45namespace MacroFunctions
47void here(
const char * file,
int line,
const char * date,
const char * time, std::ostream & os)
52 <<
", compiled " << date
59void stop(
const char * file,
int line,
const char * date,
const char * time)
64#if defined(LIBMESH_HAVE_CSIGNAL) && defined(SIGSTOP)
65 libMesh::out <<
"Stopping process " << getpid() <<
"..." << std::endl;
67 libMesh::out <<
"Continuing process " << getpid() <<
"..." << std::endl;
69 libMesh::out <<
"WARNING: libmesh_stop() does not work; no operating system support." << std::endl;
77void report_error(
const char * file,
int line,
const char * date,
const char * time, std::ostream & os)
84 static bool reporting_error =
false;
89 os <<
"libMesh encountered an error while attempting to report_error." << std::endl;
92 reporting_error =
true;
102 reporting_error =
false;
111#if defined(LIBMESH_HAVE_GCC_ABI_DEMANGLE)
115 std::string ret = name;
118 char * demangled_name = abi::__cxa_demangle(name, 0, 0, &status);
122 ret = demangled_name;
126 std::free(demangled_name);
131std::string
demangle(
const char * name) {
return std::string(name); }
void here(const char *file, int line, const char *date, const char *time, std::ostream &os=libMesh::err)
Threads::spin_mutex report_error_spin_mtx
void stop(const char *file, int line, const char *date, const char *time)
void report_error(const char *file, int line, const char *date, const char *time, std::ostream &os=libMesh::err)
The libMesh namespace provides an interface to certain functionality in the library.
processor_id_type global_processor_id()
void write_traceout()
Writes a stack trace to a uniquely named file if –enable-tracefiles has been set by configure,...
std::string demangle(const char *name)
Mostly system independent demangler.
processor_id_type global_n_processors()
void print_trace(std::ostream &out_stream=std::cerr)
Print a stack trace (for code compiled with gcc)
bool on_command_line(std::string arg)