aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/commstate.hh
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2013-08-06 18:20:01 -0400
committerErik Schnetter <schnetter@gmail.com>2013-08-06 18:20:01 -0400
commit2dedcb0e7340b0682d530dc26e764408b301e3b8 (patch)
tree07f2c893f26b07a3785ef53dc1f7c73b90cc4321 /Carpet/CarpetLib/src/commstate.hh
parent1843ac6e88b63d8eeaadfca723f4b2d13698cd62 (diff)
CarpetLib: Do not reallocate communication buffers; instead, keep them around
Diffstat (limited to 'Carpet/CarpetLib/src/commstate.hh')
-rw-r--r--Carpet/CarpetLib/src/commstate.hh22
1 files changed, 8 insertions, 14 deletions
diff --git a/Carpet/CarpetLib/src/commstate.hh b/Carpet/CarpetLib/src/commstate.hh
index b5f0c55b1..12b6e4f69 100644
--- a/Carpet/CarpetLib/src/commstate.hh
+++ b/Carpet/CarpetLib/src/commstate.hh
@@ -77,12 +77,8 @@ private:
bool did_post_recv;
// constructor for an instance of this structure
- procbufdesc() :
- sendbufsize(0), recvbufsize(0),
- sendbuf(NULL), recvbuf(NULL),
- did_post_send(false), did_post_recv(false)
- {
- }
+ procbufdesc();
+ void reinitialize();
};
@@ -99,26 +95,24 @@ private:
int datatypesize;
// per-process buffers
+ // TODO: make this scale (by using e.g. a map)
vector<procbufdesc> procbufs; // [dist::size()]
// constructor for an instance of this structure
- typebufdesc() :
- in_use(false),
- mpi_datatype(MPI_DATATYPE_NULL), datatypesize(0)
- {
- }
+ typebufdesc();
};
// datatype buffers
- vector<typebufdesc> typebufs; // [type]
+ static bool typebufs_busy;
+ static vector<typebufdesc> typebufs; // [type]
// outstanding requests for posted send/recv communications
- vector<MPI_Request> srequests;
- vector<MPI_Request> rrequests;
+ static vector<MPI_Request> srequests;
+ static vector<MPI_Request> rrequests;
static inline
MPI_Request & push_back (vector<MPI_Request> & reqs)