aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@7842ec3a-9562-4be5-9c5b-06ba18f2b668>2003-11-24 18:29:06 +0000
committertradke <tradke@7842ec3a-9562-4be5-9c5b-06ba18f2b668>2003-11-24 18:29:06 +0000
commit996d4033c3eb0f7375f9845d9d24ab86b5315ebc (patch)
treebc27c8e652e332afc1bdfe45641fca493477d331
parent4376d10284065c4dc7cde18ba9d960888dafdc69 (diff)
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=<parameter> and parameter = 0). git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOHDF5Util/trunk@104 7842ec3a-9562-4be5-9c5b-06ba18f2b668
-rw-r--r--src/DumpUtils.c21
1 files changed, 20 insertions, 1 deletions
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 */