diff options
author | Thomas Radke <tradke@aei.mpg.de> | 2005-04-18 17:00:00 +0000 |
---|---|---|
committer | Thomas Radke <tradke@aei.mpg.de> | 2005-04-18 17:00:00 +0000 |
commit | 4335d0a9249d02a60333136a5599d6203829982e (patch) | |
tree | c421cfbea04a1fda05a88ae370ca15f957498c96 /Carpet/CarpetLib/src/gdata.cc | |
parent | be47c8e1e575309e60efe43384ca28a5311d5477 (diff) |
CarpetLib: do nothing if box to be copied is empty
This fixes a bug in the collective buffers code which did call
copy_from_innerloop() even for empty boxes. The fortran routine called by
copy_from_innerloop() finally catched this bug in an assert statement.
darcs-hash:20050418170004-776a0-68fdda0131f273b80931a55d8abb5799dcf820c8.gz
Diffstat (limited to 'Carpet/CarpetLib/src/gdata.cc')
-rw-r--r-- | Carpet/CarpetLib/src/gdata.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Carpet/CarpetLib/src/gdata.cc b/Carpet/CarpetLib/src/gdata.cc index 3b50abbee..a5d7390f3 100644 --- a/Carpet/CarpetLib/src/gdata.cc +++ b/Carpet/CarpetLib/src/gdata.cc @@ -276,6 +276,7 @@ void gdata::copy_into_sendbuffer (comm_state& state, } else { // copy to remote processor assert (src->_has_storage); + assert (src->_owns_storage); assert (state.collbufs.at(proc()).sendbuf - state.collbufs.at(proc()).sendbufbase <= (state.collbufs.at(proc()).sendbufsize - box.size()) * @@ -318,11 +319,9 @@ void gdata::copy_into_sendbuffer (comm_state& state, void gdata::copy_from_recvbuffer (comm_state& state, const gdata* src, const ibbox& box) { - assert (src->proc() < state.collbufs.size()); - assert (state.collbufs[src->proc()].recvbuf - - state.collbufs[src->proc()].recvbufbase <= - (state.collbufs[src->proc()].recvbufsize-box.size()) * - state.vartypesize); + assert (state.collbufs.at(proc()).recvbuf - + state.collbufs.at(proc()).recvbufbase <= + (state.collbufs.at(proc()).recvbufsize-box.size()) * state.vartypesize); // copy this processor's data from the recv buffer const ibbox& ext = extent(); |