19 int rankWhichHasSetNonCriticalAssertion = -1;
32 int assertionExchangeTag;
35 bool useNonCriticalAssertions =
true;
40 useNonCriticalAssertions = value;
63 if (rankWhichHasSetNonCriticalAssertion>=0 and useNonCriticalAssertions) {
64 logDebug(
"triggerNonCriticalAssertion(...)",
"noncritical assertion " << expression <<
" failed in (" << file <<
":" << line <<
")" );
66 logDebug(
"triggerNonCriticalAssertion(...)",
"there has been a non-critical assertion before, so node should already be in shutdown mode" );
68 if (rankWhichHasSetNonCriticalAssertion<0 and useNonCriticalAssertions) {
69 logError(
"triggerNonCriticalAssertion(...)",
"noncritical assertion " << expression <<
" failed in (" << file <<
":" << line <<
")" );
70 logError(
"triggerNonCriticalAssertion(...)", parameterValuePairs );
71 logError(
"triggerNonCriticalAssertion(...)",
"inform rank 0 to dump solution and to shutdown application" );
95 if (rankWhichHasSetNonCriticalAssertion<0) {
104 assertionExchangeTag,
107 rankWhichHasSetNonCriticalAssertion = message.
getValue();
108 logError(
"triggerNonCriticalAssertion(...)",
"received non-critical assertion from rank " << status.MPI_SOURCE );
113 return rankWhichHasSetNonCriticalAssertion>=0;
#define logError(methodName, logMacroMessageStream)
Wrapper macro around tarch::tarch::logging::Log to improve logging.
#define logDebug(methodName, logMacroMessageStream)
static int getGlobalMasterRank()
Get the global master.
static Rank & getInstance()
This operation returns the singleton instance.
int getRank() const
Return rank of this node.
static int reserveFreeTag(const std::string &fullQualifiedMessageName, int numberOfTags=1)
Return a Free Tag.
static void releaseTag(int tag)
MPI_Comm getCommunicator() const
Create a lock around a boolean semaphore region.
tarch::logging::Log _log("exahype2::fv")
bool hasNonCriticalAssertionBeenViolated()
void shutdownNonCriticalAssertionEnvironment()
peano4::shutdownParallelEnvironment().
void initNonCriticalAssertionEnvironment()
Register the assertion tag from the global communicator.
void enableNonCriticalAssertions(bool value)
Switch noncritical assertions on/off.
void triggerNonCriticalAssertion(std::string file, int line, std::string expression, std::string parameterValuePairs)
Trigger a non-critical assertion.
static void receive(tarch::mpi::IntegerMessage &buffer, int source, int tag, MPI_Comm communicator)
static void send(const tarch::mpi::IntegerMessage &buffer, int destination, int tag, MPI_Comm communicator)
In DaStGen (the first version), I had a non-static version of the send as well as the receive.