From 996d4033c3eb0f7375f9845d9d24ab86b5315ebc Mon Sep 17 00:00:00 2001 From: tradke Date: Mon, 24 Nov 2003 18:29:06 +0000 Subject: When looping over all groups for checkpointing: skip groups with no variables attached to them (eg. vector groups with vector length 0) and zero-sized groups (grid arrays with SIZE= and parameter = 0). git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOHDF5Util/trunk@104 7842ec3a-9562-4be5-9c5b-06ba18f2b668 --- src/DumpUtils.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/DumpUtils.c b/src/DumpUtils.c index 7035879..a37bb93 100644 --- a/src/DumpUtils.c +++ b/src/DumpUtils.c @@ -55,8 +55,9 @@ CCTK_FILEVERSION(CactusPUGHIO_IOHDF5Util_DumpUtils_c) @@*/ int IOHDF5Util_DumpGH (const cGH *GH, const int *timers, hid_t file) { - int first_vindex, gindex, retval; + int dim, groupvarsize, first_vindex, gindex, retval; cGroup gdata; + cGroupDynamicData gdynamicdata; char *fullname; ioRequest *request; DECLARE_CCTK_PARAMETERS @@ -96,6 +97,12 @@ int IOHDF5Util_DumpGH (const cGH *GH, const int *timers, hid_t file) /* ... now the variables, sorted by groups */ for (gindex = CCTK_NumGroups () - 1; gindex >= 0; gindex--) { + /* skip empty groups */ + if (CCTK_NumVarsInGroupI (gindex) <= 0) + { + continue; + } + /* only dump groups which have storage assigned */ if (CCTK_QueryGroupStorageI (GH, gindex) <= 0) { @@ -114,6 +121,18 @@ int IOHDF5Util_DumpGH (const cGH *GH, const int *timers, hid_t file) gdata.numtimelevels--; } + /* skip zero-sized groups */ + CCTK_GroupDynamicData (GH, gindex, &gdynamicdata); + groupvarsize = 1; + for (dim = 0; dim < gdynamicdata.dim; dim++) + { + groupvarsize *= gdynamicdata.gsh[dim]; + } + if (groupvarsize <= 0) + { + continue; + } + first_vindex = CCTK_FirstVarIndexI (gindex); /* get the default I/O request for this group */ -- cgit v1.2.3