NEURON
bbssrv2mpi.h
Go to the documentation of this file.
1 #ifndef bbslsrv2_h
2 #define bbslsrv2_h
3 
4 #include <nrnmpiuse.h>
5 #include <InterViews/resource.h>
6 
7 class MpiMessageList;
8 class MpiPendingList;
9 class MpiWorkList;
10 class MpiReadyList;
11 class MpiLookingToDoList;
12 class MpiResultList;
13 struct bbsmpibuf;
14 
15 void bbs_handle();
16 
17 class BBSDirectServer {
18  public:
20  virtual ~BBSDirectServer();
21 
22  void post(const char* key, bbsmpibuf*);
23  bool look(const char* key, bbsmpibuf**);
24  bool look_take(const char* key, bbsmpibuf**);
25  bool take_pending(const char* key, int* cid);
26  void put_pending(const char* key, int cid);
27  static BBSDirectServer* server_;
28  static void handle(); // all remote requests
29  static void handle_block();
30  static void handle1(int size, int tag, int source);
31  void start();
32  void done();
33 
34  void post_todo(int parentid, int cid, bbsmpibuf*);
35  void context(bbsmpibuf*);
36  bool send_context(int cid); // sends if not sent already
37  void post_result(int id, bbsmpibuf*);
38  int look_take_todo(bbsmpibuf**);
39  int look_take_result(int parentid, bbsmpibuf**);
40  void context_wait();
41 
42  private:
43  void add_looking_todo(int cid);
44 
45  private:
46  MpiMessageList* messages_;
47  MpiPendingList* pending_;
48  MpiWorkList* work_;
49  MpiLookingToDoList* looking_todo_;
50  MpiReadyList* todo_;
51  MpiResultList* results_;
52  MpiLookingToDoList* send_context_;
53  int next_id_;
54  bbsmpibuf* context_buf_;
56 };
57 
58 #endif
void bbs_handle()
Definition: datapath.cpp:33
void add_looking_todo(int cid)
MpiReadyList * todo_
Definition: bbssrv2mpi.h:50
void post(const char *key, bbsmpibuf *)
void post_result(int id, bbsmpibuf *)
bool look_take(const char *key, bbsmpibuf **)
bool look(const char *key, bbsmpibuf **)
MpiLookingToDoList * looking_todo_
Definition: bbssrv2mpi.h:49
static void handle()
int look_take_result(int parentid, bbsmpibuf **)
void put_pending(const char *key, int cid)
MpiLookingToDoList * send_context_
Definition: bbssrv2mpi.h:52
bbsmpibuf * context_buf_
Definition: bbssrv2mpi.h:54
static void handle1(int size, int tag, int source)
virtual ~BBSDirectServer()
int look_take_todo(bbsmpibuf **)
static BBSDirectServer * server_
Definition: bbslsrv2.h:18
MpiMessageList * messages_
Definition: bbssrv2mpi.h:46
MpiPendingList * pending_
Definition: bbssrv2mpi.h:47
bool send_context(int cid)
bool take_pending(const char *key, int *cid)
void context(bbsmpibuf *)
int remaining_context_cnt_
Definition: bbslsrv2.h:37
MpiWorkList * work_
Definition: bbssrv2mpi.h:48
MpiResultList * results_
Definition: bbssrv2mpi.h:51
void post_todo(int parentid, int cid, bbsmpibuf *)
static void handle_block()
#define key
Definition: spt2queue.cpp:20