From 7f3c00d4f9aaab905e04ccc2ed9fbaeff841e4af Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 1 Jan 2005 19:38:00 +0000 Subject: CarpetLib: Move class commstate into its own file darcs-hash:20050101193846-891bb-7bb505d29a25b04c0d23e792eea7ff404d1f4200.gz --- Carpet/CarpetLib/src/gdata.cc | 68 +------------------------------------------ 1 file changed, 1 insertion(+), 67 deletions(-) (limited to 'Carpet/CarpetLib/src/gdata.cc') 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 () { -- cgit v1.2.3