1 #include <../../nrnconf.h> 4 #ifdef NRNMPI // to end of file 17 static int bbs_poll_cnt_;
18 static int bbs_msg_cnt_;
38 printf(
"bbs_msg_cnt_=%d bbs_poll_cnt_=%d bbs_poll_=%d\n",
39 bbs_msg_cnt_, bbs_poll_cnt_,
47 nrnmpi_probe(&size, &tag, &source);
55 if (nrnmpi_iprobe(&size, &tag, &source) != 0) {
58 }
while (nrnmpi_iprobe(&size, &tag, &source) != 0);
68 recv = nrnmpi_newbuf(size);
70 tag = nrnmpi_bbsrecv(cid, recv);
73 nrnmpi_upkbegin(recv);
77 index = nrnmpi_getid(recv);
84 index = nrnmpi_getid(recv);
91 key = nrnmpi_getkey(recv);
98 key = nrnmpi_getkey(recv);
103 nrnmpi_bbssend(cid,
LOOK_YES, send);
110 key = nrnmpi_getkey(recv);
116 printf(
"handle sending back something\n");
125 key = nrnmpi_getkey(recv);
131 printf(
"handle sending back something\n");
133 nrnmpi_bbssend(cid,
TAKE, send);
137 printf(
"handle put_pending %s for %d\n", key, cid);
144 printf(
"handle LOOK_TAKE_TODO for cid=%x\n", cid);
148 printf(
"handle sending back id=%d\n", index);
150 nrnmpi_bbssend(cid, index+1, send);
156 index = nrnmpi_getid(recv);
158 printf(
"handle LOOK_TAKE_RESULT for %x pid=%d\n", cid, index);
162 printf(
"handle sending back id=%d\n", index);
164 nrnmpi_bbssend(cid, index+1, send);
171 printf(
"handle TAKE_TODO for %x\n", cid);
176 printf(
"handle sent back a context\n");
183 printf(
"handle sending back id=%d\n", index);
185 nrnmpi_bbssend(cid, index+1, send);
189 printf(
"handle add_looking_todo\n");
198 nrnmpi_pkbegin(recv);
199 nrnmpi_enddata(recv);
200 nrnmpi_bbssend(cid,
HELLO, recv);
203 printf(
"unknown message\n");
void post(const char *key)
bool look_take(const char *key)
bool look(const char *key)
static BBSDirectServer * server_
static void handle_block()
bool send_context(int cid)
void put_pending(const char *key, int cid)
int look_take_result(int parentid)
int remaining_context_cnt_
void post_todo(int parentid, int cid)
void add_looking_todo(int cid)