aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/commstate.hh
blob: 340d09ded882c1df6cd1fa9de8ce4892a16cb8fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef COMMSTATE_HH
#define COMMSTATE_HH

#include <queue>
#include <vector>

#include <mpi.h>



using namespace std;



class gdata;



// State information for communications
enum astate { state_recv, state_send, state_wait, state_done };

struct comm_state {
  astate thestate;
  comm_state ();
  void step ();
  bool done ();
  ~comm_state ();
  
private:
  // Forbid copying and passing by value
  comm_state (comm_state const &);
  comm_state& operator= (comm_state const &);
public:
  
  queue<gdata*> tmps1, tmps2;
  vector<MPI_Request> requests; // for use_waitall
};



#endif  // COMMSTATE_HH