aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Carpet/Carpet/src/TimerNode.cc4
-rw-r--r--Carpet/Carpet/src/Timers.cc7
2 files changed, 9 insertions, 2 deletions
diff --git a/Carpet/Carpet/src/TimerNode.cc b/Carpet/Carpet/src/TimerNode.cc
index 59e75a1d1..b081bee3e 100644
--- a/Carpet/Carpet/src/TimerNode.cc
+++ b/Carpet/Carpet/src/TimerNode.cc
@@ -92,7 +92,9 @@ namespace Carpet {
if(d_running)
{
// A timer can only be stopped if it is the current timer
- assert(this==d_current);
+ if(this != d_current)
+ CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Tried to stop non-current timer '%s'", getName().c_str());
timer->stop();
diff --git a/Carpet/Carpet/src/Timers.cc b/Carpet/Carpet/src/Timers.cc
index 4460c0eaa..585677388 100644
--- a/Carpet/Carpet/src/Timers.cc
+++ b/Carpet/Carpet/src/Timers.cc
@@ -50,7 +50,12 @@ namespace Carpet {
/// Stop the timer - it must be the most recently started timer
void Timer::stop ()
{
- TimerNode::getCurrentTimer()->stop();
+ TimerNode *current = TimerNode::getCurrentTimer();
+ if(current->getName() != name())
+ CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Trying to stop enclosing timer '%s' before enclosed time '%s'",
+ name().c_str(), current->getName().c_str());
+ current->stop();
}
/// Return the name of the timer