diff options
author | goodale <goodale@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2000-02-16 18:56:09 +0000 |
---|---|---|
committer | goodale <goodale@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2000-02-16 18:56:09 +0000 |
commit | 539cd2636da010382f41c9ff1ba237ec080e5341 (patch) | |
tree | 4c3c41c66c3c895cfd2654658dc498fa7161aa9a | |
parent | ac4042b06624178a6317be37f936066c712e7d97 (diff) |
Changed to use the cache malloc available in the flesh.
Tom
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@163 b61c5cb5-eaca-4651-9a7a-d64986f99364
-rw-r--r-- | src/SetupPGF.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/SetupPGF.c b/src/SetupPGF.c index a2c126f..418c2a0 100644 --- a/src/SetupPGF.c +++ b/src/SetupPGF.c @@ -16,6 +16,7 @@ #include "cctk.h" #include "cctk_Parameters.h" +#include "cctk_Cache.h" #include "pugh.h" @@ -212,13 +213,14 @@ int EnableGFDataStorage(pGH *GH, pGF *GF) int i, dir, sz, ldir; int special_pad, cache_size, start; static int ive_blathered = 0; + char *temp_byte; if (zero_memory && !ive_blathered) { CCTK_INFO("Zeroing memory for allocated GFs at alloc time"); } - +#if 0 if (padding_active && !ive_blathered) { char *infomsg = (char *) malloc (200); @@ -226,6 +228,7 @@ int EnableGFDataStorage(pGH *GH, pGF *GF) CCTK_INFO(infomsg); free(infomsg); } +#endif ive_blathered = 1; @@ -299,6 +302,7 @@ int EnableGFDataStorage(pGH *GH, pGF *GF) } else { +#if 0 if (zero_memory) { GF->padddata = calloc (GH->npoints + padding_size, GF->varsize); @@ -327,9 +331,26 @@ int EnableGFDataStorage(pGH *GH, pGF *GF) "specified %d %d %d\n", special_pad, padding_size, cache_size); CCTK_WARN (0, msg); } +#endif + /* Use the Cactus Cache alignment function */ + GF->data = Util_CacheMalloc(GF->gfno, + GH->npoints * GF->varsize, + &(GF->padddata)); + + /* Zero the memory if desired. */ + if(GF->data && zero_memory) + { + for(temp_byte = (char *)GF->data; + temp_byte < ((char *)GF->data)+GH->npoints * GF->varsize; + temp_byte++) + { + *temp_byte = 0; + } + } } + if (!GF->padddata) { char *msg = (char *) malloc (80 + strlen (GF->name)); |