diff options
author | allen <allen@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2000-09-21 15:53:36 +0000 |
---|---|---|
committer | allen <allen@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2000-09-21 15:53:36 +0000 |
commit | 5766dbcaec17c3873f5157d6c894a1575ee1d22e (patch) | |
tree | c2ca6376c074f161fc237600eee774a452165a43 /src | |
parent | d2e029a28dbe5d8964e25eb1cca03cbb01e0ca44 (diff) |
Make the option to report on storage steerable
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@278 b61c5cb5-eaca-4651-9a7a-d64986f99364
Diffstat (limited to 'src')
-rw-r--r-- | src/Storage.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/Storage.c b/src/Storage.c index 56fe96d..1506a98 100644 --- a/src/Storage.c +++ b/src/Storage.c @@ -29,7 +29,7 @@ static char *rcsid="$Header$"; CCTK_FILEVERSION(CactusPUGH_PUGH_Storage_c) -static int totalstorage = 0; /* Storage for GAs in Bytes */ +static float totalstorage = 0; /* Storage for GAs in Bytes */ static int totalnumber = 0; /* Number of stored GAs */ @@ -251,25 +251,29 @@ int PUGH_EnableGroupStorage(cGH *GH, const char *groupname) rc = -1; } + if (rc == 0) + { + /* get GA pointer of first var in group */ + GA = (pGA *) pughGH->variables[first_var][0]; + totalnumber += pgroup.numvars*pgroup.numtimelevels; + totalstorage += ((float)(GA->extras->npoints * GA->varsize * + pgroup.numtimelevels * pgroup.numvars))/(1024*1024); + } + /* Report on memory usage */ if (storage_verbose) { if (rc == 0) { - /* get GA pointer of first var in group */ - GA = (pGA *) pughGH->variables[first_var][0]; - /* Memory toggled */ - totalnumber += pgroup.numvars; - totalstorage += GA->extras->npoints * GA->varsize * - pgroup.numtimelevels * pgroup.numvars; - printf("Switched memory on for %s \n [Num Arrays: %d Total Size: %d]\n", + printf("Switched memory on for %s \n [Num Arrays: %d Total Size: %6.2fMB]\n", groupname,totalnumber,totalstorage); } else if (rc == 1) { /* Memory already on */ - printf("Memory already on for %s\n",groupname); + printf("Memory already on for %s\n [Num Arrays: %d Total Size: %6.2fMB]\n", + groupname,totalnumber,totalstorage); } } |