diff options
Diffstat (limited to 'src/GHExtension.c')
-rw-r--r-- | src/GHExtension.c | 53 |
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 /****************************************************************************/ |