diff options
Diffstat (limited to 'src/DumpGH.c')
-rw-r--r-- | src/DumpGH.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/DumpGH.c b/src/DumpGH.c index 6a3f9df..4693549 100644 --- a/src/DumpGH.c +++ b/src/DumpGH.c @@ -317,8 +317,9 @@ static int Checkpoint (const cGH *GH, int called_from) { char filename[1024], tmpfilename[1024]; IOFile file; - int myproc, first_vindex, gindex, retval; + int dim, groupvarsize, myproc, first_vindex, gindex, retval; cGroup gdata; + cGroupDynamicData gdynamicdata; ioRequest *request; flexioGH *myGH; const ioGH *ioUtilGH; @@ -410,6 +411,12 @@ static int Checkpoint (const cGH *GH, int called_from) } 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) { @@ -428,6 +435,18 @@ static int Checkpoint (const cGH *GH, int called_from) 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 */ |