diff options
author | tradke <tradke@7842ec3a-9562-4be5-9c5b-06ba18f2b668> | 2001-05-18 21:00:48 +0000 |
---|---|---|
committer | tradke <tradke@7842ec3a-9562-4be5-9c5b-06ba18f2b668> | 2001-05-18 21:00:48 +0000 |
commit | 55fbce955242ab0381d3ccee78f6b35e569c1ae3 (patch) | |
tree | 68d474fbd4a7c5e3092242dffa2ef113dbf795ae | |
parent | ec2211fdd7401bd581382bba03d7c99f9780629c (diff) |
Before checkpointing, synchronize only those groups which have storage assigned.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOHDF5Util/trunk@32 7842ec3a-9562-4be5-9c5b-06ba18f2b668
-rw-r--r-- | src/DumpUtils.c | 64 |
1 files changed, 30 insertions, 34 deletions
diff --git a/src/DumpUtils.c b/src/DumpUtils.c index d8249d4..50e7c56 100644 --- a/src/DumpUtils.c +++ b/src/DumpUtils.c @@ -58,13 +58,12 @@ int IOHDF5Util_DumpGH (cGH *GH, hid_t file) { DECLARE_CCTK_PARAMETERS - int vindex; int maxdim; - int timelevel; + int first_vindex, vindex, gindex; + int timelevel, last_timelevel; + cGroup gdata; int old_out_single; ioGH *ioUtilGH; - const char *thorn; - const char *impl; ioHDF5Geo_t request; @@ -132,45 +131,42 @@ int IOHDF5Util_DumpGH (cGH *GH, CCTK_TimerStartI (timers[CP_VARIABLES_TIMER]); } - /* ... now the variables */ - for (vindex = CCTK_NumVars () - 1; vindex >= 0; vindex--) + /* ... now the variables, sorted by groups */ + for (gindex = CCTK_NumGroups () - 1; gindex >= 0; gindex--) { - /* find out the thorn implementing variable with index */ - impl = CCTK_ImpFromVarI (vindex); - 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))) + /* only dump groups which have storage assigned */ + if (CCTK_QueryGroupStorageI (GH, gindex) <= 0) { continue; } - if (verbose && file >= 0) - { - CCTK_VInfo (CCTK_THORNSTRING, " %s", CCTK_VarName (vindex)); - } + /* sync the group */ + CCTK_SyncGroupI (GH, gindex); - request.sdim = request.vdim = CCTK_GroupDimFromVarI (vindex); - - /* 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) - { - timelevel--; - } - while (timelevel >= 0) + /* dump all timelevels except the oldest (for multi-level groups) */ + CCTK_GroupData (gindex, &gdata); + last_timelevel = gdata.numtimelevels; + if (last_timelevel > 1) { - IOHDF5Util_DumpVar (GH, vindex, timelevel--, &request, file, 0); + last_timelevel--; } + request.sdim = request.vdim = gdata.dim; + first_vindex = CCTK_FirstVarIndexI (gindex); - } /* end of loop over all variables */ + for (vindex = first_vindex; vindex < first_vindex + gdata.numvars; vindex++) + { + if (verbose && file >= 0) + { + CCTK_VInfo (CCTK_THORNSTRING, " %s", CCTK_VarName (vindex)); + } + + for (timelevel = 0; timelevel < last_timelevel; timelevel++) + { + IOHDF5Util_DumpVar (GH, vindex, timelevel, &request, file, 0); + } + + } /* end of loop over all variables */ + } /* end of loop over all groups */ /* stop CP_VARIABLES_TIMER timer */ if (timers) |