mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Document variables with heavy SMP read access
Also move NodesSincePoll away from the same cache line of other heavy read accessed only variables. Fortunatly we don't have anymore write access contention, but still read access contention in some cases. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
b58ecb85c7
commit
2f760cdf8d
1 changed files with 15 additions and 14 deletions
|
@ -130,6 +130,9 @@ namespace {
|
||||||
|
|
||||||
/// Constants
|
/// Constants
|
||||||
|
|
||||||
|
// Search depth at iteration 1
|
||||||
|
const Depth InitialDepth = OnePly /*+ OnePly/2*/;
|
||||||
|
|
||||||
// Depth limit for selective search
|
// Depth limit for selective search
|
||||||
const Depth SelectiveDepth = 7 * OnePly;
|
const Depth SelectiveDepth = 7 * OnePly;
|
||||||
|
|
||||||
|
@ -187,12 +190,11 @@ namespace {
|
||||||
|
|
||||||
/// Variables initialized from UCI options
|
/// Variables initialized from UCI options
|
||||||
|
|
||||||
// Minimum number of full depth (i.e. non-reduced) moves at PV and non-PV
|
// Minimum number of full depth (i.e. non-reduced) moves at PV and non-PV nodes
|
||||||
// nodes
|
int LMRPVMoves, LMRNonPVMoves; // heavy SMP read access for the latter
|
||||||
int LMRPVMoves, LMRNonPVMoves;
|
|
||||||
|
|
||||||
// Depth limit for use of dynamic threat detection
|
// Depth limit for use of dynamic threat detection
|
||||||
Depth ThreatDepth;
|
Depth ThreatDepth; // heavy SMP read access
|
||||||
|
|
||||||
// Last seconds noise filtering (LSN)
|
// Last seconds noise filtering (LSN)
|
||||||
bool UseLSNFiltering;
|
bool UseLSNFiltering;
|
||||||
|
@ -201,19 +203,13 @@ namespace {
|
||||||
Value LSNValue;
|
Value LSNValue;
|
||||||
|
|
||||||
// Extensions. Array index 0 is used at non-PV nodes, index 1 at PV nodes.
|
// Extensions. Array index 0 is used at non-PV nodes, index 1 at PV nodes.
|
||||||
|
// There is heavy SMP read access on these arrays
|
||||||
Depth CheckExtension[2], SingleReplyExtension[2], PawnPushTo7thExtension[2];
|
Depth CheckExtension[2], SingleReplyExtension[2], PawnPushTo7thExtension[2];
|
||||||
Depth PassedPawnExtension[2], PawnEndgameExtension[2], MateThreatExtension[2];
|
Depth PassedPawnExtension[2], PawnEndgameExtension[2], MateThreatExtension[2];
|
||||||
|
|
||||||
// Search depth at iteration 1
|
|
||||||
const Depth InitialDepth = OnePly /*+ OnePly/2*/;
|
|
||||||
|
|
||||||
// Node counters, used only by thread[0]
|
|
||||||
int NodesSincePoll;
|
|
||||||
int NodesBetweenPolls = 30000;
|
|
||||||
|
|
||||||
// Iteration counters
|
// Iteration counters
|
||||||
int Iteration;
|
int Iteration;
|
||||||
BetaCounterType BetaCounter; // does not have internal data
|
BetaCounterType BetaCounter; // has per-thread internal data
|
||||||
|
|
||||||
// Scores and number of times the best move changed for each iteration
|
// Scores and number of times the best move changed for each iteration
|
||||||
IterationInfoType IterationInfo[PLY_MAX_PLUS_2];
|
IterationInfoType IterationInfo[PLY_MAX_PLUS_2];
|
||||||
|
@ -231,7 +227,7 @@ namespace {
|
||||||
bool InfiniteSearch;
|
bool InfiniteSearch;
|
||||||
bool PonderSearch;
|
bool PonderSearch;
|
||||||
bool StopOnPonderhit;
|
bool StopOnPonderhit;
|
||||||
bool AbortSearch;
|
bool AbortSearch; // heavy SMP read access
|
||||||
bool Quit;
|
bool Quit;
|
||||||
bool FailHigh;
|
bool FailHigh;
|
||||||
bool FailLow;
|
bool FailLow;
|
||||||
|
@ -263,6 +259,11 @@ namespace {
|
||||||
HANDLE SitIdleEvent[THREAD_MAX];
|
HANDLE SitIdleEvent[THREAD_MAX];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Node counters, used only by thread[0] but try to keep in different
|
||||||
|
// cache lines (64 bytes each) from the heavy SMP read accessed variables.
|
||||||
|
int NodesSincePoll;
|
||||||
|
int NodesBetweenPolls = 30000;
|
||||||
|
|
||||||
|
|
||||||
/// Functions
|
/// Functions
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue