46 gethostname(hostname,
sizeof(hostname));
49 MPI_Comm_rank(MPI_COMM_WORLD,&mpirank);
50 if (p >= 0 && p != mpirank)
52 std::cout <<
"[" << mpirank <<
"] has PID " << getpid() <<
" on " << hostname <<
" continuing" << std::endl;
56 std::cout <<
"[" << mpirank <<
"] has PID " << getpid() <<
" on " << hostname <<
" ready to attach" << std::endl;
58 std::cout <<
"PID " << getpid() <<
" on " << hostname <<
" ready to attach" << std::endl;
68 typedef int (*AssertHandler)(
char const*,
char const*, int);
69 int default_assert_handler(
char const* expr,
char const* file,
int line)
73 MPI_Comm_rank(MPI_COMM_WORLD,&mpirank);
74 std::cout <<
"[" << mpirank <<
"]: ";
76 std::cerr <<
"Assertion " << expr <<
" failed in " << file <<
":" <<
line << std::endl;
79 AssertHandler assert_handler = default_assert_handler;
85#if defined(ASSERTATTACH)
86#define ASSERT_HALT(p) attach(p)
87#elif defined(ASSERTCONTINUE)
88#define ASSERT_HALT(p) ((void)sizeof(p)), std::cout << "... trying to continue ..." << std::endl
90#define ASSERT_HALT(p) ((void)sizeof(p)), abort()
95#define dune_assert_(x,p) ((void)(!(x) && assert_handler(#x, __FILE__, __LINE__) && (ASSERT_HALT(p), 1)))
97#define dune_assert_(x,p) ((void)sizeof(x),sizeof(p))
101#define dune_assert0_(x) dune_assert_(x,-1)
102#define dune_assert1_(x,p) dune_assert_(x,p)
103#define GET_ASSERT_MACRO(_1,_2,NAME,...) NAME
104#define dune_assert(...) GET_ASSERT_MACRO(__VA_ARGS__, dune_assert1_, dune_assert0_)(__VA_ARGS__)
constexpr GeometryType line
GeometryType representing a line.
Definition: type.hh:512