diff options
author | tradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a> | 2003-11-24 18:29:08 +0000 |
---|---|---|
committer | tradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a> | 2003-11-24 18:29:08 +0000 |
commit | 510b8ddc67fa2dc14b19a8b2f56cedb259a48af7 (patch) | |
tree | 6fb1c0b9652fcc77cb1744563a1c39484f2bd3dd | |
parent | 3c47388339f53268fb54753bae549220338319fc (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/IOFlexIO/trunk@300 ebee0441-1374-4afa-a3b5-247f3ba15b9a
-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 */ |