1 #include <../../nrnconf.h>
18 static int bbs_poll_cnt_;
19 static int bbs_msg_cnt_;
39 printf(
"bbs_msg_cnt_=%d bbs_poll_cnt_=%d bbs_poll_=%d\n",
49 nrnmpi_probe(&size, &tag, &source);
57 if (nrnmpi_iprobe(&size, &tag, &source) != 0) {
60 }
while (nrnmpi_iprobe(&size, &tag, &source) != 0);
70 recv = nrnmpi_newbuf(size);
72 tag = nrnmpi_bbsrecv(cid, recv);
75 nrnmpi_upkbegin(recv);
79 index = nrnmpi_getid(recv);
86 index = nrnmpi_getid(recv);
93 key = nrnmpi_getkey(recv);
100 key = nrnmpi_getkey(recv);
105 nrnmpi_bbssend(cid,
LOOK_YES, send);
108 nrnmpi_bbssend(cid,
LOOK_NO,
nullptr);
112 key = nrnmpi_getkey(recv);
118 printf(
"handle sending back something\n");
127 key = nrnmpi_getkey(recv);
133 printf(
"handle sending back something\n");
135 nrnmpi_bbssend(cid,
TAKE, send);
139 printf(
"handle put_pending %s for %d\n",
key, cid);
146 printf(
"handle LOOK_TAKE_TODO for cid=%x\n", cid);
152 nrnmpi_bbssend(cid,
index + 1, send);
158 index = nrnmpi_getid(recv);
160 printf(
"handle LOOK_TAKE_RESULT for %x pid=%d\n", cid,
index);
166 nrnmpi_bbssend(cid,
index + 1, send);
173 printf(
"handle TAKE_TODO for %x\n", cid);
177 printf(
"handle sent back a context\n");
186 nrnmpi_bbssend(cid,
index + 1, send);
190 printf(
"handle add_looking_todo\n");
199 nrnmpi_pkbegin(recv);
200 nrnmpi_enddata(recv);
201 nrnmpi_bbssend(cid,
HELLO, recv);
204 printf(
"unknown message\n");
int look_take_result(int parentid)
void add_looking_todo(int cid)
bool look(const char *key)
bool look_take(const char *key)
void post_todo(int parentid, int cid)
void post(const char *key)
void put_pending(const char *key, int cid)
static BBSDirectServer * server_
bool send_context(int cid)
int remaining_context_cnt_
static void handle_block()