aboutsummaryrefslogtreecommitdiff
path: root/src/DumpGH.c
diff options
context:
space:
mode:
authortradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2001-05-18 20:54:35 +0000
committertradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2001-05-18 20:54:35 +0000
commitd0fc526c816504d83744a6edc7bb3d0dc901cfce (patch)
tree7acf0d468b3f39ca17e807e93a3215edba59aca3 /src/DumpGH.c
parentc8e2cb9a0a6f9ef0a71bdbb5ca2b4de6a8e03e16 (diff)
Before checkpointing, synchronize only those groups which have storage assigned.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@201 ebee0441-1374-4afa-a3b5-247f3ba15b9a
Diffstat (limited to 'src/DumpGH.c')
-rw-r--r--src/DumpGH.c57
1 files changed, 30 insertions, 27 deletions
diff --git a/src/DumpGH.c b/src/DumpGH.c
index 6eb3b02..14d1a83 100644
--- a/src/DumpGH.c
+++ b/src/DumpGH.c
@@ -251,7 +251,7 @@ void IOFlexIOi_DumpGHExtensions (cGH *GH, IOFile iof)
version = CCTK_FullVersion ();
CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "Cactus version", FLEXIO_CHAR,
- strlen (version) + 1, (void *) version));
+ strlen (version) + 1, (const void *) version));
}
@@ -284,8 +284,9 @@ void IOFlexIO_DumpGH (cGH *GH, int called_from)
DECLARE_CCTK_PARAMETERS
char dumpfname [1024], tmpfname [1024];
IOFile iof;
- int vindex;
- int timelevel;
+ int first_vindex, vindex, gindex;
+ int timelevel, last_timelevel;
+ cGroup gdata;
int *old_downsample;
int old_out_single;
ioGH *ioUtilGH;
@@ -373,36 +374,38 @@ void IOFlexIO_DumpGH (cGH *GH, int called_from)
CCTK_TimerStartI (myGH->timers[1]);
}
- /* ... now the variables */
- for (vindex = 0; vindex < CCTK_NumVars (); vindex++) {
- const char *thorn, *impl = CCTK_ImpFromVarI (vindex);
-
- /* find out the thorn implementing variable with index */
- thorn = CCTK_ImplementationThorn (impl);
- if (! thorn)
- thorn = impl;
-
- /* let only variables pass which belong to an active thorn and
- have storage assigned */
- if (! CCTK_IsThornActive (thorn) ||
- ! CCTK_QueryGroupStorageI (GH, CCTK_GroupIndexFromVarI (vindex)))
+ /* ... now the variables, sorted by groups */
+ for (gindex = CCTK_NumGroups () - 1; gindex >= 0; gindex--)
+ {
+ /* only dump groups which have storage assigned */
+ if (CCTK_QueryGroupStorageI (GH, gindex) <= 0)
+ {
continue;
+ }
- if (verbose)
- CCTK_VInfo (CCTK_THORNSTRING, " %s", CCTK_VarName (vindex));
+ /* sync the group */
+ CCTK_SyncGroupI (GH, gindex);
- /* now dump all timelevels, if there is more than one timelevel
- we don't dump the oldest */
- timelevel = CCTK_NumTimeLevelsFromVarI (vindex) - 1;
- if (timelevel > 0)
+ /* dump all timelevels except the oldest (for multi-level groups) */
+ CCTK_GroupData (gindex, &gdata);
+ last_timelevel = gdata.numtimelevels;
+ if (last_timelevel > 1)
{
- timelevel--;
+ last_timelevel--;
}
- while (timelevel >= 0)
+ first_vindex = CCTK_FirstVarIndexI (gindex);
+
+ for (vindex = first_vindex; vindex < first_vindex + gdata.numvars; vindex++)
{
- IOFlexIO_DumpVar (GH, vindex, timelevel--, iof);
- }
- } /* end of loop over all variables */
+ if (verbose)
+ CCTK_VInfo (CCTK_THORNSTRING, " %s", CCTK_VarName (vindex));
+
+ for (timelevel = 0; timelevel < last_timelevel; timelevel++)
+ {
+ IOFlexIO_DumpVar (GH, vindex, timelevel--, iof);
+ }
+ } /* end of loop over all variables */
+ } /* end of loop over all groups */
/* stop timer for dumping datasets */
if (myGH->print_timing_info)