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 private:
42  void add_looking_todo(int cid);
43 private:
44  MpiMessageList* messages_;
45  MpiPendingList* pending_;
46  MpiWorkList* work_;
47  MpiLookingToDoList* looking_todo_;
48  MpiReadyList* todo_;
49  MpiResultList* results_;
50  MpiLookingToDoList* send_context_;
51  int next_id_;
52  bbsmpibuf* context_buf_;
54 };
55 
56 #endif
MpiLookingToDoList * send_context_
Definition: bbssrv2mpi.h:50
void post(const char *key)
static void handle()
bool look_take(const char *key)
bool look(const char *key)
bool take_pending(const char *key, int *cid)
MpiReadyList * todo_
Definition: bbssrv2mpi.h:48
static BBSDirectServer * server_
Definition: bbslsrv2.h:18
void context(int ncid, int *cids)
static void handle_block()
bool send_context(int cid)
void put_pending(const char *key, int cid)
MpiPendingList * pending_
Definition: bbssrv2mpi.h:45
static void handle1()
#define key
Definition: spt2queue.cpp:20
MpiLookingToDoList * looking_todo_
Definition: bbssrv2mpi.h:47
bbsmpibuf * context_buf_
Definition: bbssrv2mpi.h:52
virtual ~BBSDirectServer()
MpiMessageList * messages_
Definition: bbssrv2mpi.h:44
void post_result(int id)
int look_take_result(int parentid)
MpiWorkList * work_
Definition: bbssrv2mpi.h:46
int remaining_context_cnt_
Definition: bbslsrv2.h:35
void bbs_handle()
Definition: datapath.cpp:29
void post_todo(int parentid, int cid)
void add_looking_todo(int cid)
MpiResultList * results_
Definition: bbssrv2mpi.h:49