aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/gdata.cc
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@aei.mpg.de>2005-01-01 19:38:00 +0000
committerErik Schnetter <schnetter@aei.mpg.de>2005-01-01 19:38:00 +0000
commit7f3c00d4f9aaab905e04ccc2ed9fbaeff841e4af (patch)
treeb268ab8a03aaf0c86239b73d399a5060b9705be6 /Carpet/CarpetLib/src/gdata.cc
parenta2898bab20198e06ab5121357cf1496550b05006 (diff)
CarpetLib: Move class commstate into its own file
darcs-hash:20050101193846-891bb-7bb505d29a25b04c0d23e792eea7ff404d1f4200.gz
Diffstat (limited to 'Carpet/CarpetLib/src/gdata.cc')
-rw-r--r--Carpet/CarpetLib/src/gdata.cc68
1 files changed, 1 insertions, 67 deletions
diff --git a/Carpet/CarpetLib/src/gdata.cc b/Carpet/CarpetLib/src/gdata.cc
index 2a921807c..55f1ce197 100644
--- a/Carpet/CarpetLib/src/gdata.cc
+++ b/Carpet/CarpetLib/src/gdata.cc
@@ -9,6 +9,7 @@
#include "util_Table.h"
#include "bbox.hh"
+#include "commstate.hh"
#include "defs.hh"
#include "dist.hh"
#include "vect.hh"
@@ -19,73 +20,6 @@ using namespace std;
-// Communication state control
-comm_state::comm_state ()
- : thestate(state_recv)
-{
-}
-
-void comm_state::step ()
-{
- DECLARE_CCTK_PARAMETERS;
-
- assert (thestate!=state_done);
- if (combine_recv_send) {
- switch (thestate) {
- case state_recv:
- assert (tmps1.empty());
- thestate = state_wait;
- break;
- case state_send:
- assert (0);
- case state_wait:
- assert (tmps1.empty());
- assert (tmps2.empty());
- thestate = state_done;
- break;
- case state_done:
- assert (0);
- default:
- assert (0);
- }
- } else {
- switch (thestate) {
- case state_recv:
- assert (tmps2.empty());
- thestate = state_send;
- break;
- case state_send:
- assert (tmps1.empty());
- thestate = state_wait;
- break;
- case state_wait:
- assert (tmps1.empty());
- assert (tmps2.empty());
- thestate = state_done;
- break;
- case state_done:
- assert (0);
- default:
- assert (0);
- }
- }
-}
-
-bool comm_state::done ()
-{
- return thestate==state_done;
-}
-
-comm_state::~comm_state ()
-{
- assert (thestate==state_recv || thestate==state_done);
- assert (tmps1.empty());
- assert (tmps2.empty());
- assert (requests.empty());
-}
-
-
-
// Hand out the next MPI tag
static int nexttag ()
{