aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2006-09-04 02:04:00 +0000
committerErik Schnetter <schnetter@cct.lsu.edu>2006-09-04 02:04:00 +0000
commitef07b6a8550ee08bb0b915019f9a7aacb1f1da07 (patch)
treea7838010ca0f7be5969d26861123f0e04ade1ead /Carpet/CarpetLib
parent66f9bf71c5eb12a1ca81b53712acb02b3e07e41d (diff)
CarpetLib: Poison communications buffers as well
When CarpetLib::poison_new_memory is set, poison communications buffers as well. darcs-hash:20060904020453-dae7b-762dfc46dcaea77cdff48fcd5e63805bf14e6dc0.gz
Diffstat (limited to 'Carpet/CarpetLib')
-rw-r--r--Carpet/CarpetLib/src/commstate.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/Carpet/CarpetLib/src/commstate.cc b/Carpet/CarpetLib/src/commstate.cc
index ec4bbf667..7a5caca3b 100644
--- a/Carpet/CarpetLib/src/commstate.cc
+++ b/Carpet/CarpetLib/src/commstate.cc
@@ -1,3 +1,5 @@
+#include <cstring>
+
#include "cctk.h"
#include "cctk_Parameters.h"
@@ -59,6 +61,7 @@ comm_state::comm_state ()
void comm_state::step ()
{
+ DECLARE_CCTK_PARAMETERS;
assert (thestate != state_done);
switch (thestate) {
case state_post:
@@ -91,6 +94,12 @@ void comm_state::step ()
procbuf.sendbufbase = new char[procbuf.sendbufsize*datatypesize];
procbuf.recvbufbase = new char[procbuf.recvbufsize*datatypesize];
+ // TODO: this may be a bit extreme, and it is only for
+ // internal consistency checking
+ if (poison_new_memory) {
+ memset (procbuf.sendbufbase, poison_value, procbuf.sendbufsize*datatypesize);
+ memset (procbuf.recvbufbase, poison_value, procbuf.recvbufsize*datatypesize);
+ }
procbuf.sendbuf = procbuf.sendbufbase;
procbuf.recvbuf = procbuf.recvbufbase;