stats.h
Go to the documentation of this file.
1 
11 #ifndef EDAX_STATS_H
12 #define EDAX_STATS_H
13 
14 #include "const.h"
15 #include "util.h"
16 
17 #include <stdio.h>
18 
19 /* To turn on a statistics, add an x to the end of the line starting with #define .*/
21 #define YBWC_STATS(x)
22 
23 #define HASH_STATS(x)
24 
25 #define HASH_COLLISIONS(x)
26 
27 #define SEARCH_STATS(x)
28 
29 #define SQUARE_STATS(x)
30 
31 #define CUTOFF_STATS(x)
32 
33 #define PROBCUT_STATS(x)
34 
36 #define COUNT_NODES 7
37 
38 #if COUNT_NODES & 1
39 
40  #define SEARCH_UPDATE_INTERNAL_NODES() (++search->n_nodes)
41 #else
42 
43  #define SEARCH_UPDATE_INTERNAL_NODES()
44 #endif
45 #if COUNT_NODES & 2
46 
47  #define SEARCH_UPDATE_EVAL_NODES() (++search->n_nodes)
48 #else
49 
50  #define SEARCH_UPDATE_EVAL_NODES()
51 #endif
52 #if COUNT_NODES & 4
53 
54  #define SEARCH_UPDATE_ALL_NODES() (++search->n_nodes)
55 #else
56 
57  #define SEARCH_UPDATE_ALL_NODES()
58 #endif
59 
61 typedef struct Statistics {
62  unsigned long long n_nodes;
63  unsigned long long n_task_nodes[MAX_THREADS];
64  unsigned long long n_task[MAX_THREADS];
65  unsigned long long n_parallel_nodes;
66 
67  unsigned long long n_hash_update;
68  unsigned long long n_hash_upgrade;
69  unsigned long long n_hash_new;
70  unsigned long long n_hash_remove;
71  unsigned long long n_hash_search;
72  unsigned long long n_hash_found;
73  unsigned long long n_hash_collision;
74  unsigned long long n_hash_n;
75 
76  unsigned long long n_PVS_root;
77  unsigned long long n_PVS_midgame;
78  unsigned long long n_NWS_midgame;
79  unsigned long long n_NWS_endgame;
80  unsigned long long n_PVS_shallow;
81  unsigned long long n_NWS_shallow;
82  unsigned long long n_search_solve;
83  unsigned long long n_search_solve_0;
84  unsigned long long n_board_solve_2;
85  unsigned long long n_search_solve_3;
86  unsigned long long n_search_solve_4;
87  unsigned long long n_search_eval_0;
88  unsigned long long n_search_eval_1;
89  unsigned long long n_search_eval_2;
90  unsigned long long n_cut_at_move_number[MAX_MOVE];
91  unsigned long long n_nocut_at_move_number[MAX_MOVE];
92  unsigned long long n_best_at_move_number[MAX_MOVE];
93  unsigned long long n_move_number[MAX_MOVE];
94 
95  unsigned long long n_split_try;
96  unsigned long long n_split_success;
97  unsigned long long n_master_helper;
98  unsigned long long n_waited_slave;
99  unsigned long long n_stopped_slave;
100  unsigned long long n_stopped_master;
101  unsigned long long n_wake_up;
102 
105  unsigned long long n_probcut_try;
109 
110  unsigned long long n_played_square[BOARD_SIZE][10];
111  unsigned long long n_good_square[BOARD_SIZE][10];
112 
113  unsigned long long n_NWS_candidate;
114  unsigned long long n_NWS_bad_candidate;
115 
116 } Statistics;
117 
118 extern Statistics statistics;
119 struct Search;
120 
121 void statistics_init(void);
122 void statistics_sum_nodes(struct Search*);
123 void statistics_print(FILE*);
124 
125 #endif
126 
unsigned long long n_probcut_low_cutoff
Definition: stats.h:106
unsigned long long n_cut_at_move_number[MAX_MOVE]
Definition: stats.h:90
unsigned long long n_esc_high_cutoff
Definition: stats.h:108
unsigned long long n_NWS_midgame
Definition: stats.h:78
unsigned long long n_search_eval_1
Definition: stats.h:88
#define MAX_THREADS
Definition: const.h:15
unsigned long long n_hash_new
Definition: stats.h:69
unsigned long long n_search_solve_0
Definition: stats.h:83
#define BOARD_SIZE
Definition: const.h:21
unsigned long long n_etc_try
Definition: stats.h:108
Statistics statistics
Definition: stats.c:21
unsigned long long n_probcut_low_try
Definition: stats.h:106
unsigned long long n_hash_try
Definition: stats.h:103
unsigned long long n_search_solve
Definition: stats.h:82
unsigned long long n_etc_high_cutoff
Definition: stats.h:108
unsigned long long n_NWS_bad_candidate
Definition: stats.h:114
unsigned long long n_search_eval_0
Definition: stats.h:87
unsigned long long n_hash_n
Definition: stats.h:74
void statistics_init(void)
Intialization of the statistics.
Definition: stats.c:26
unsigned long long n_best_at_move_number[MAX_MOVE]
Definition: stats.h:92
unsigned long long n_waited_slave
Definition: stats.h:98
unsigned long long n_task[MAX_THREADS]
Definition: stats.h:64
unsigned long long n_hash_search
Definition: stats.h:71
unsigned long long n_stability_try
Definition: stats.h:104
unsigned long long n_PVS_root
Definition: stats.h:76
unsigned long long n_hash_upgrade
Definition: stats.h:68
Definition: stats.h:61
unsigned long long n_PVS_shallow
Definition: stats.h:80
unsigned long long n_search_solve_4
Definition: stats.h:86
unsigned long long n_probcut_try
Definition: stats.h:105
unsigned long long n_board_solve_2
Definition: stats.h:84
void statistics_sum_nodes(struct Search *)
Cumulate node counts from the last search.
Definition: stats.c:97
Definition: search.h:95
unsigned long long n_hash_found
Definition: stats.h:72
unsigned long long n_nodes
Definition: stats.h:62
unsigned long long n_master_helper
Definition: stats.h:97
Miscellaneous utilities header.
unsigned long long n_NWS_shallow
Definition: stats.h:81
unsigned long long n_task_nodes[MAX_THREADS]
Definition: stats.h:63
unsigned long long n_search_eval_2
Definition: stats.h:89
unsigned long long n_good_square[BOARD_SIZE][10]
Definition: stats.h:111
unsigned long long n_wake_up
Definition: stats.h:101
unsigned long long n_probcut_high_cutoff
Definition: stats.h:107
unsigned long long n_search_solve_3
Definition: stats.h:85
unsigned long long n_stopped_slave
Definition: stats.h:99
unsigned long long n_probcut_high_try
Definition: stats.h:107
void statistics_print(FILE *)
Print statistics.
Definition: stats.c:112
unsigned long long n_split_success
Definition: stats.h:96
unsigned long long n_NWS_candidate
Definition: stats.h:113
unsigned long long n_hash_update
Definition: stats.h:67
unsigned long long n_split_try
Definition: stats.h:95
unsigned long long n_nocut_at_move_number[MAX_MOVE]
Definition: stats.h:91
unsigned long long n_stability_low_cutoff
Definition: stats.h:104
unsigned long long n_PVS_midgame
Definition: stats.h:77
unsigned long long n_hash_remove
Definition: stats.h:70
unsigned long long n_hash_low_cutoff
Definition: stats.h:103
unsigned long long n_hash_collision
Definition: stats.h:73
#define MAX_MOVE
Definition: const.h:18
struct Statistics Statistics
unsigned long long n_move_number[MAX_MOVE]
Definition: stats.h:93
unsigned long long n_parallel_nodes
Definition: stats.h:65
unsigned long long n_stopped_master
Definition: stats.h:100
unsigned long long n_played_square[BOARD_SIZE][10]
Definition: stats.h:110
unsigned long long n_hash_high_cutoff
Definition: stats.h:103
unsigned long long n_NWS_endgame
Definition: stats.h:79