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