Add MaxThreadCount default

This commit is contained in:
Asriel Camora
2023-10-10 00:39:38 -07:00
parent bdabbbdafa
commit 7327a1a844
+3
View File
@@ -43,6 +43,9 @@ public readonly record struct SolverConfig
ExplorationConstant = 4;
MaxStepCount = 30;
MaxRolloutStepCount = 99;
// Use 80% of all cores if less than 20 cores are available, otherwise use all but 4 cores. Keep at least 1 core.
MaxThreadCount = Math.Max(1, Math.Max(Environment.ProcessorCount - 4, (int)MathF.Floor(Environment.ProcessorCount * 0.8f)));
// Use 32 forks at minimum, or the number of cores, whichever is higher.
ForkCount = Math.Max(Environment.ProcessorCount, 32);
FurcatedActionCount = ForkCount / 2;
StrictActions = true;