summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorknarf <knarf@17b73243-c579-4c4c-a9d2-2d5706c11dac>2012-10-24 20:03:13 +0000
committerknarf <knarf@17b73243-c579-4c4c-a9d2-2d5706c11dac>2012-10-24 20:03:13 +0000
commitc1ee98289170c1bc140fb3519580c9f7eceb8baf (patch)
tree7ab9e1934433382fed5b3a3d2673780f83950ffa /src/main
parent7b408d1cc5125e2a9ef4da8194cbd752312ffe13 (diff)
Added CCTK_TimerRunning and CCTK_TimerRunningI
These functions return whether a Cactus timer is running or not (either by name or by handle). git-svn-id: http://svn.cactuscode.org/flesh/trunk@4890 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main')
-rw-r--r--src/main/ScheduleInterface.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/ScheduleInterface.c b/src/main/ScheduleInterface.c
index 5f549dc1..e267e0b4 100644
--- a/src/main/ScheduleInterface.c
+++ b/src/main/ScheduleInterface.c
@@ -1253,13 +1253,20 @@ int CCTK_SchedulePrintTimesToFile(const char *where, FILE *file)
/* also print total time at the bottom */
if (total_timer >= 0)
{
- CCTK_TimerStopI (total_timer);
+ int total_timer_running = CCTK_TimerIsRunningI(total_timer);
+ if (total_timer_running)
+ {
+ CCTK_TimerStopI (total_timer);
+ }
CCTK_TimerI (total_timer, timerinfo);
CCTKi_SchedulePrintTimerInfo
(timerinfo, NULL, "", "Total time for simulation", file);
/* just in case this is not at termination yet ... */
- CCTK_TimerStartI (total_timer);
+ if (total_timer_running)
+ {
+ CCTK_TimerStartI (total_timer);
+ }
}
return 0;