aboutsummaryrefslogtreecommitdiff
path: root/src/GHExtension.c
diff options
context:
space:
mode:
authortradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>1999-10-28 16:24:58 +0000
committertradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>1999-10-28 16:24:58 +0000
commit07bfa6ab7f02f5db6ca444ad36683b4d4cf72bf7 (patch)
tree2306ea2f3392e798c11e7b47c9fd2707c024a9e0 /src/GHExtension.c
parentb446c2dab4d1a041f9d0dc1c2fcd740a5b512870 (diff)
Added checkpointing for parameters. Still needs some optimization.
Recovery will follow soon. Also reactivated timers for checkpoint/recovery. Output this info needs to be improved somewhat. I like your timer stuff, Tom ! Thomas git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@65 ebee0441-1374-4afa-a3b5-247f3ba15b9a
Diffstat (limited to 'src/GHExtension.c')
-rw-r--r--src/GHExtension.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/GHExtension.c b/src/GHExtension.c
index eebb0cb..38edd5f 100644
--- a/src/GHExtension.c
+++ b/src/GHExtension.c
@@ -31,6 +31,7 @@ void SetupSliceCenter (cGH *GH);
void *IOFlexIO_SetupGH (tFleshConfig *config, int convergence_level, cGH *GH)
{
+ DECLARE_CCTK_PARAMETERS
int i, numvars;
flexioGH *newGH;
@@ -122,8 +123,60 @@ int IOFlexIO_InitGH (cGH *GH)
/* set up 2D planes to plot */
SetupSliceCenter (GH);
+ /* create timers if timing info was requested */
+ if (print_timing_info) {
+ myGH->dumpVarsTimer = CCTK_TimerCreateI ();
+ myGH->dumpParamsTimer = CCTK_TimerCreateI ();
+ myGH->checkpointTotalTimer = CCTK_TimerCreateI ();
+ myGH->recoverVarsTimer = CCTK_TimerCreateI ();
+ myGH->recoverParamsTimer = CCTK_TimerCreateI ();
+ myGH->recoverTotalTimer = CCTK_TimerCreateI ();
+
+ if (myGH->dumpVarsTimer < 0)
+ CCTK_WARN (1, "Could not create timer ! Timing info on dumping datasets "
+ "will not be available.");
+ if (myGH->dumpParamsTimer < 0)
+ CCTK_WARN (1, "Could not create timer ! Timing info on dumping parameters"
+ " will not be available.");
+ if (myGH->checkpointTotalTimer < 0)
+ CCTK_WARN (1, "Could not create timer ! Timing info on total checkpoint "
+ "time will not be available.");
+
+ if (myGH->recoverVarsTimer < 0)
+ CCTK_WARN (1, "Could not create timer ! Timing info on recovering "
+ "datasets will not be available.");
+ if (myGH->recoverParamsTimer < 0)
+ CCTK_WARN (1, "Could not create timer ! Timing info on recovering "
+ " parameters will not be available.");
+ if (myGH->recoverTotalTimer < 0)
+ CCTK_WARN (1, "Could not create timer ! Timing info on total recovery "
+ "time will not be available.");
+
+ CCTK_TimerResetI (myGH->checkpointTotalTimer);
+ CCTK_TimerResetI (myGH->recoverTotalTimer);
+ }
+
+ return (0);
+}
+
+
+#if 0
+int IOFlexIO_Terminate (cGH *GH)
+{
+ DECLARE_CCTK_PARAMETERS
+
+ if (print_timing_info) {
+ CCTK_TimerDestroyI (myGH->dumpVarsTimer);
+ CCTK_TimerDestroyI (myGH->dumpParamsTimer);
+ CCTK_TimerDestroyI (myGH->checkpointTotalTimer);
+ CCTK_TimerDestroyI (myGH->recoverVarsTimer);
+ CCTK_TimerDestroyI (myGH->recoverParamsTimer);
+ CCTK_TimerDestroyI (myGH->recoverTotalTimer);
+ }
+
return (0);
}
+#endif
/****************************************************************************/