diff options
author | tradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a> | 2002-05-21 11:00:38 +0000 |
---|---|---|
committer | tradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a> | 2002-05-21 11:00:38 +0000 |
commit | ad1083c0ee769ec176beb00f789fd3124a264306 (patch) | |
tree | 5f35ad8d20093eb11b620d87900268f73894e5a0 /src/DumpGH.c | |
parent | 84c0ebabc57c2ef3472a43ea8d4c78e7f8a9cf9e (diff) |
Save the iteration number of the last checkpoint and don't dump a termination
checkpoint if it was already written as an evolution checkpoint before.
This closes PR IO/1058.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@243 ebee0441-1374-4afa-a3b5-247f3ba15b9a
Diffstat (limited to 'src/DumpGH.c')
-rw-r--r-- | src/DumpGH.c | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/src/DumpGH.c b/src/DumpGH.c index 9f23ac7..bee97c7 100644 --- a/src/DumpGH.c +++ b/src/DumpGH.c @@ -64,6 +64,12 @@ void IOFlexIO_InitialDataCheckpoint (const cGH *GH) if (checkpoint && checkpoint_ID) { + if (! CCTK_Equals (verbose, "none")) + { + CCTK_INFO ("---------------------------------------------------------"); + CCTK_INFO ("Dumping initial data checkpoint"); + CCTK_INFO ("---------------------------------------------------------"); + } Checkpoint (GH, CP_INITIAL_DATA); } } @@ -95,11 +101,12 @@ void IOFlexIO_EvolutionCheckpoint (const cGH *GH) ((checkpoint_every > 0 && GH->cctk_iteration % checkpoint_every == 0) || checkpoint_next)) { - if (CCTK_Equals (verbose, "full")) + if (! CCTK_Equals (verbose, "none")) { - CCTK_INFO("------------------------------------------------------------"); - CCTK_VInfo (CCTK_THORNSTRING, "Dumping periodic checkpoint file at " + CCTK_INFO ("---------------------------------------------------------"); + CCTK_VInfo (CCTK_THORNSTRING, "Dumping periodic checkpoint at " "iteration %d", GH->cctk_iteration); + CCTK_INFO ("---------------------------------------------------------"); } Checkpoint (GH, CP_EVOLUTION_DATA); @@ -131,12 +138,32 @@ void IOFlexIO_EvolutionCheckpoint (const cGH *GH) @@*/ void IOFlexIO_TerminationCheckpoint (const cGH *GH) { + const flexioGH *myGH; DECLARE_CCTK_PARAMETERS - if (checkpoint && checkpoint_on_terminate) + myGH = (const flexioGH *) CCTK_GHExtension (GH, "IOHDF5"); + if (checkpoint && checkpoint_on_terminate && myGH) { - Checkpoint (GH, CP_EVOLUTION_DATA); + if (myGH->last_checkpoint_iteration < GH->cctk_iteration) + { + if (! CCTK_Equals (verbose, "none")) + { + CCTK_INFO ("---------------------------------------------------------"); + CCTK_VInfo (CCTK_THORNSTRING, "Dumping termination checkpoint at " + "iteration %d", GH->cctk_iteration); + CCTK_INFO ("---------------------------------------------------------"); + } + Checkpoint (GH, CP_EVOLUTION_DATA); + } + else if (! CCTK_Equals (verbose, "none")) + { + CCTK_INFO ("---------------------------------------------------------"); + CCTK_VInfo (CCTK_THORNSTRING, "Termination checkpoint already dumped " + "as last evolution checkpoint at iteration %d", + myGH->last_checkpoint_iteration); + CCTK_INFO ("---------------------------------------------------------"); + } } } @@ -488,5 +515,8 @@ static int Checkpoint (const cGH *GH, int called_from) myGH->timers, timer_descriptions); } + /* save the iteration number of this checkpoint */ + myGH->last_checkpoint_iteration = GH->cctk_iteration; + return (retval); } |