diff options
Diffstat (limited to 'src/DumpUtils.c')
-rw-r--r-- | src/DumpUtils.c | 21 |
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 */ |