summaryrefslogtreecommitdiff
path: root/src/main/ScheduleInterface.c
diff options
context:
space:
mode:
authortradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2001-09-20 11:02:01 +0000
committertradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2001-09-20 11:02:01 +0000
commit69f2e0710ec9088e0a1120f5f773493034a2003e (patch)
treebf713df523e8b28510a90ed9ad9ae51cf1632b8e /src/main/ScheduleInterface.c
parent31b3bf61d3ddb551b3aa6777b7655091b86d8733 (diff)
Added timing and output of total time.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@2370 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/ScheduleInterface.c')
-rw-r--r--src/main/ScheduleInterface.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main/ScheduleInterface.c b/src/main/ScheduleInterface.c
index e876a9b7..dc941c1d 100644
--- a/src/main/ScheduleInterface.c
+++ b/src/main/ScheduleInterface.c
@@ -190,6 +190,8 @@ static int n_scheduled_storage_groups = 0;
static int *scheduled_storage_groups = NULL;
static cTimerData *timerinfo = NULL;
+static int total_timer = -1;
+
/********************************************************************
********************* External Routines **********************
@@ -751,6 +753,20 @@ int CCTKi_ScheduleGHInit(void *GH)
{
int i;
+
+ /* create and start the CCTK total timer */
+ total_timer = CCTK_TimerCreate ("CCTK total time");
+ if (total_timer >= 0)
+ {
+ CCTK_TimerStartI (total_timer);
+ }
+ else
+ {
+ CCTK_VWarn (1, __LINE__, __FILE__, "Cactus",
+ "Couldn't create CCTK total timer. "
+ "No timing information will be available.");
+ }
+
for(i = 0; i < n_scheduled_storage_groups; i++)
{
CCTK_EnableGroupStorageI(GH,scheduled_storage_groups[i]);
@@ -951,6 +967,17 @@ int CCTK_SchedulePrintTimes(const char *where)
CCTK_TimerDestroyData(data.total_time);
+ /* also print total time at the bottom */
+ if (total_timer >= 0)
+ {
+ CCTK_TimerStopI (total_timer);
+ CCTK_TimerI (total_timer, timerinfo);
+ CCTKi_SchedulePrintTimerInfo (timerinfo, NULL, "", "Total time");
+
+ /* just in case this is not at termination yet ... */
+ CCTK_TimerStartI (total_timer);
+ }
+
return 0;
}