Distributed engine: the slave now receives stats in binary form.
[pachi.git] / distributed / distributed.h
blob9f1e708575f9ae1815b29d0040b54d361e3b0124
1 #ifndef ZZGO_DISTRIBUTED_DISTRIBUTED_H
2 #define ZZGO_DISTRIBUTED_DISTRIBUTED_H
4 #include <limits.h>
6 #include "engine.h"
7 #include "stats.h"
9 /* A coord path encodes coordinates from root child to a given node:
10 * A1->B2->C3 is encoded as coord(A1)<<18 + coord(B2)<<9 + coord(C3)
11 * for 19x19. In this version the table is not a transposition table
12 * so A1->B2->C3 and C3->B2->A1 are different.
13 * The depth is limited to 7 for 19x19 (9 for 9x9) to fit in 64 bits.
14 * path_t is signed to include pass and resign. */
15 typedef int64_t path_t;
16 #define PRIpath PRIx64
17 #define PATH_T_MAX INT64_MAX
19 /* Stats exchanged between master and slave. They are always
20 * incremental values to be added to what was last sent. */
21 struct incr_stats {
22 path_t coord_path;
23 struct move_stats incr;
26 #define DIST_GAMELEN 1000
28 #define force_reply(id) ((id) + DIST_GAMELEN)
29 #define prevent_reply(id) ((id) % DIST_GAMELEN)
30 #define move_number(id) ((id) % DIST_GAMELEN)
31 #define reply_disabled(id) ((id) < DIST_GAMELEN)
33 struct move_stats2 {
34 struct move_stats u;
35 struct move_stats amaf;
38 struct engine *engine_distributed_init(char *arg, struct board *b);
40 #endif