diff options
author | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2004-01-16 12:38:32 +0000 |
---|---|---|
committer | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2004-01-16 12:38:32 +0000 |
commit | 92b2aa4e15699e7cd4ea7ec43167406e7ec4b786 (patch) | |
tree | cf47883cd973adab6d8e24db6f3af68030f7bb9b /src/comm | |
parent | 40a723f3e1ad78ba4c1765a5c13f3a7196b7e791 (diff) |
CCTK_{En,Dis}ableGroupStorage return not the number of time levels,
but only a flag. The default GroupStorage{In,De}crease routines have
to explicitly convert the flag.
Also only enable group storage if more than 0 time levels were
requested. This makes the pattern "enable 0 time levels in order to
find the number of active time levels" work.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@3510 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/comm')
-rw-r--r-- | src/comm/CactusDefaultComm.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/comm/CactusDefaultComm.c b/src/comm/CactusDefaultComm.c index f065b89d..75d133c3 100644 --- a/src/comm/CactusDefaultComm.c +++ b/src/comm/CactusDefaultComm.c @@ -643,9 +643,6 @@ int CactusDefaultGroupStorageIncrease (const cGH *GH, int n_groups, char *gname; - /* Avoid a warning about timelevels being unused. */ - (void) (timelevels + 0); - /* Has the normal group storage been overloaded ? */ if(CCTK_EnableGroupStorage != CactusDefaultEnableGroupStorage) { @@ -653,10 +650,22 @@ int CactusDefaultGroupStorageIncrease (const cGH *GH, int n_groups, { if(groups[i] >= 0) { - gname = CCTK_GroupName(groups[i]); - value = CCTK_EnableGroupStorage(GH, gname); - free (gname); - retval += value; + /* Since the old enable and disable group storage just returned true or + * false and did all timelevels, only enable storage if timelevels is + not 0 + */ + value = 0; + if(timelevels[i] != 0) + { + gname = CCTK_GroupName(groups[i]); + value = CCTK_EnableGroupStorage(GH, gname); + free (gname); + if (value) + { + value = CCTK_NumTimeLevelsI(groups[i]); + } + retval += value; + } if(status) { status[i] = value; @@ -754,6 +763,10 @@ int CactusDefaultGroupStorageDecrease (const cGH *GH, int n_groups, if(timelevels[i] == 0) { value = CCTK_DisableGroupStorage(GH, CCTK_GroupName(groups[i])); + if (value) + { + value = CCTK_NumTimeLevelsI(groups[i]); + } retval += value; } if(status) |