From 07bfa6ab7f02f5db6ca444ad36683b4d4cf72bf7 Mon Sep 17 00:00:00 2001 From: tradke Date: Thu, 28 Oct 1999 16:24:58 +0000 Subject: 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 --- src/GHExtension.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'src/GHExtension.c') 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 /****************************************************************************/ -- cgit v1.2.3