aboutsummaryrefslogtreecommitdiff
path: root/src/RecoverGH.c
diff options
context:
space:
mode:
authortradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2000-06-29 14:22:34 +0000
committertradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2000-06-29 14:22:34 +0000
commit4a2d88e44064c311cfa5eb8d40d03e578f312bb6 (patch)
tree9bf93dc0708d35758c061646a6775eebe4692123 /src/RecoverGH.c
parentff4d81c3a464af73675a0dfc5221ad4f3818e6a3 (diff)
Fixed the timer stuff for checkpointing/recovery which now is organized
as an array of timers. Also routine IOUtil_PrintTimings() is called to output timer info for all available timers. And I shortened the trailing line in this output (BR CactusPUGHIO-IOFlexIO/382). git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@133 ebee0441-1374-4afa-a3b5-247f3ba15b9a
Diffstat (limited to 'src/RecoverGH.c')
-rw-r--r--src/RecoverGH.c40
1 files changed, 12 insertions, 28 deletions
diff --git a/src/RecoverGH.c b/src/RecoverGH.c
index de38b62..b33b88e 100644
--- a/src/RecoverGH.c
+++ b/src/RecoverGH.c
@@ -108,9 +108,13 @@ int IOFlexIO_Recover (cGH *GH, const char *basename, int called_from)
myGH = NULL;
/* start the total timer */
- if (GH && print_timing_info) {
+ if (GH)
+ {
myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")];
- CCTK_TimerStartI (myGH->recoverTotalTimer);
+ if (myGH->print_timing_info)
+ {
+ CCTK_TimerStartI (myGH->timers[3]);
+ }
}
/* open the file if it wasn't already opened at CCTK_RECOVER_PARAMETERS */
@@ -158,34 +162,14 @@ int IOFlexIO_Recover (cGH *GH, const char *basename, int called_from)
}
/* stop total recovery timer and print timing info */
- if (print_timing_info && called_from == CP_RECOVER_DATA) {
- cTimerData *info;
-
- CCTK_TimerStopI (myGH->recoverTotalTimer);
-
- CCTK_INFO ("timing information for recovery:");
-
-/*** FIXME: select timer to get info from at runtime ***/
-#ifdef HAVE_TIME_GETTIMEOFDAY
- info = CCTK_TimerCreateData ();
- if (info) {
+ if (called_from == CP_RECOVER_DATA && myGH->print_timing_info)
+ {
+ const char *timer_description = "Time to recover:";
- if (myGH->recoverTotalTimer >= 0) {
- CCTK_TimerI (myGH->recoverTotalTimer, info);
- CCTK_VInfo (CCTK_THORNSTRING, "Time to recover: %5.1f sec",
- info->vals[0].val.d);
- }
-
- CCTK_TimerDestroyData (info);
- } else
- CCTK_WARN (1, "Couldn't create timer info structure ! No timing output "
- "available.");
-#else
- CCTK_WARN (1, "No GETTIMEOFDAY timer available.");
-#endif
- CCTK_INFO ("--------------------------------------------------------------"
- "-----------");
+ CCTK_TimerStopI (myGH->timers[3]);
+ IOUtil_PrintTimings ("Timing information for recovery in IOFlexIO:", 1,
+ &myGH->timers[3], &timer_description);
}
return (result);