From 510b8ddc67fa2dc14b19a8b2f56cedb259a48af7 Mon Sep 17 00:00:00 2001 From: tradke Date: Mon, 24 Nov 2003 18:29:08 +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/IOFlexIO/trunk@300 ebee0441-1374-4afa-a3b5-247f3ba15b9a --- src/DumpGH.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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 */ -- cgit v1.2.3