Rev 154 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 154 | Rev 156 | ||
---|---|---|---|
Line 124... | Line 124... | ||
124 | if (nargs != 6) { |
124 | if (nargs != 6) { |
125 | printf("usage: adaptive NPS hmin hmax pmin pmax\n"); |
125 | printf("usage: adaptive NPS hmin hmax pmin pmax\n"); |
126 | return 1; |
126 | return 1; |
127 | } |
127 | } |
128 | if (nargs > 1) { |
128 | if (nargs > 1) { |
129 | adaptive_hash = atoiKMB(args[ |
129 | adaptive_hash = (int) atoiKMB(args[1]); // Pierre-Marie Baty -- added type cast |
130 | adaptive_hash_min = atoiKMB(args[ |
130 | adaptive_hash_min = (size_t) atoiKMB(args[2]); // Pierre-Marie Baty -- added type cast |
131 | adaptive_hash_max = atoiKMB(args[ |
131 | adaptive_hash_max = (size_t) atoiKMB(args[3]); // Pierre-Marie Baty -- added type cast |
132 | adaptive_hashp_min = atoiKMB(args[ |
132 | adaptive_hashp_min = (size_t) atoiKMB(args[4]); // Pierre-Marie Baty -- added type cast |
133 | adaptive_hashp_max = atoiKMB(args[ |
133 | adaptive_hashp_max = (size_t) atoiKMB(args[5]); // Pierre-Marie Baty -- added type cast |
134 | } |
134 | } |
135 | Print(32, "adaptive estimated NPS = %s\n", DisplayKMB(adaptive_hash, 1)); |
135 | Print(32, "adaptive estimated NPS = %s\n", DisplayKMB(adaptive_hash, 1)); |
136 | Print(32, "adaptive minimum hsize = %s\n", DisplayKMB(adaptive_hash_min, |
136 | Print(32, "adaptive minimum hsize = %s\n", DisplayKMB(adaptive_hash_min, |
137 | 1)); |
137 | 1)); |
138 | Print(32, "adaptive maximum hsize = %s\n", DisplayKMB(adaptive_hash_max, |
138 | Print(32, "adaptive maximum hsize = %s\n", DisplayKMB(adaptive_hash_max, |
Line 322... | Line 322... | ||
322 | ************************************************************ |
322 | ************************************************************ |
323 | */ |
323 | */ |
324 | else if (OptionMatch("bookw", *args)) { |
324 | else if (OptionMatch("bookw", *args)) { |
325 | if (nargs > 1) { |
325 | if (nargs > 1) { |
326 | if (OptionMatch("frequency", args[1])) |
326 | if (OptionMatch("frequency", args[1])) |
327 | book_weight_freq = atof |
327 | book_weight_freq = (float) atof(args[2]); // Pierre-Marie Baty -- added type cast |
328 | else if (OptionMatch("evaluation", args[1])) |
328 | else if (OptionMatch("evaluation", args[1])) |
329 | book_weight_eval = atof |
329 | book_weight_eval = (float) atof(args[2]); // Pierre-Marie Baty -- added type cast |
330 | else if (OptionMatch("learning", args[1])) |
330 | else if (OptionMatch("learning", args[1])) |
331 | book_weight_learn = atof |
331 | book_weight_learn = (float) atof(args[2]); // Pierre-Marie Baty -- added type cast |
332 | } else { |
332 | } else { |
333 | Print(32, "frequency (freq)..............%4.2f\n", book_weight_freq); |
333 | Print(32, "frequency (freq)..............%4.2f\n", book_weight_freq); |
334 | Print(32, "static evaluation (eval)......%4.2f\n", book_weight_eval); |
334 | Print(32, "static evaluation (eval)......%4.2f\n", book_weight_eval); |
335 | Print(32, "learning (learn)..............%4.2f\n", book_weight_learn); |
335 | Print(32, "learning (learn)..............%4.2f\n", book_weight_learn); |
336 | } |
336 | } |
Line 868... | Line 868... | ||
868 | return 2; |
868 | return 2; |
869 | if (nargs > 1) { |
869 | if (nargs > 1) { |
870 | allow_memory = 0; |
870 | allow_memory = 0; |
871 | if (xboard) |
871 | if (xboard) |
872 | Print(4095, "Warning-- xboard 'memory' option disabled\n"); |
872 | Print(4095, "Warning-- xboard 'memory' option disabled\n"); |
873 | new_hash_size = atoiKMB(args[ |
873 | new_hash_size = (size_t) atoiKMB(args[1]); // Pierre-Marie Baty -- added type cast |
874 | if (new_hash_size < 64 * 1024) { |
874 | if (new_hash_size < 64 * 1024) { |
875 | printf("ERROR. Minimum hash table size is 64K bytes.\n"); |
875 | printf("ERROR. Minimum hash table size is 64K bytes.\n"); |
876 | return 1; |
876 | return 1; |
877 | } |
877 | } |
878 | hash_table_size = ((1ull) << MSB(new_hash_size)) / 16; |
878 | hash_table_size = ((1ull) << MSB(new_hash_size)) / 16; |
Line 910... | Line 910... | ||
910 | size_t old_hash_size = hash_path_size, new_hash_size; |
910 | size_t old_hash_size = hash_path_size, new_hash_size; |
911 | 911 | ||
912 | if (thinking || pondering) |
912 | if (thinking || pondering) |
913 | return 2; |
913 | return 2; |
914 | if (nargs > 1) { |
914 | if (nargs > 1) { |
915 | new_hash_size = atoiKMB(args[ |
915 | new_hash_size = (size_t) atoiKMB(args[1]); // Pierre-Marie Baty -- added type cast |
916 | if (new_hash_size < 64 * 1024) { |
916 | if (new_hash_size < 64 * 1024) { |
917 | printf("ERROR. Minimum phash table size is 64K bytes.\n"); |
917 | printf("ERROR. Minimum phash table size is 64K bytes.\n"); |
918 | return 1; |
918 | return 1; |
919 | } |
919 | } |
920 | hash_path_size = ((1ull) << MSB(new_hash_size / sizeof(HPATH_ENTRY))); |
920 | hash_path_size = ((1ull) << MSB(new_hash_size / sizeof(HPATH_ENTRY))); |
Line 946... | Line 946... | ||
946 | return 2; |
946 | return 2; |
947 | if (nargs > 1) { |
947 | if (nargs > 1) { |
948 | allow_memory = 0; |
948 | allow_memory = 0; |
949 | if (xboard) |
949 | if (xboard) |
950 | Print(4095, "Warning-- xboard 'memory' option disabled\n"); |
950 | Print(4095, "Warning-- xboard 'memory' option disabled\n"); |
951 | new_hash_size = atoiKMB(args[ |
951 | new_hash_size = (size_t) atoiKMB(args[1]); // Pierre-Marie Baty -- added type cast |
952 | if (new_hash_size < 16 * 1024) { |
952 | if (new_hash_size < 16 * 1024) { |
953 | printf("ERROR. Minimum pawn hash table size is 16K bytes.\n"); |
953 | printf("ERROR. Minimum pawn hash table size is 16K bytes.\n"); |
954 | return 1; |
954 | return 1; |
955 | } |
955 | } |
956 | pawn_hash_table_size = |
956 | pawn_hash_table_size = |
Line 1216... | Line 1216... | ||
1216 | int optimal_hash_size; |
1216 | int optimal_hash_size; |
1217 | 1217 | ||
1218 | TimeSet(think); |
1218 | TimeSet(think); |
1219 | time_limit /= 100; |
1219 | time_limit /= 100; |
1220 | positions_per_move = time_limit * adaptive_hash / 16; |
1220 | positions_per_move = time_limit * adaptive_hash / 16; |
1221 | optimal_hash_size = |
1221 | optimal_hash_size = (int) (positions_per_move * 16); // Pierre-Marie Baty -- added type cast |
1222 | printf("optimal=%d\n", optimal_hash_size); |
1222 | printf("optimal=%d\n", optimal_hash_size); |
1223 | optimal_hash_size = Max(optimal_hash_size, adaptive_hash_min) |
1223 | optimal_hash_size = Max(optimal_hash_size, (int) adaptive_hash_min); // Pierre-Marie Baty -- added type cast |
1224 | optimal_hash_size = Min(optimal_hash_size, adaptive_hash_max) |
1224 | optimal_hash_size = Min(optimal_hash_size, (int) adaptive_hash_max); // Pierre-Marie Baty -- added type cast |
1225 | sprintf(buffer, "hash=%d\n", optimal_hash_size); |
1225 | sprintf(buffer, "hash=%d\n", optimal_hash_size); |
1226 | Option(tree); |
1226 | Option(tree); |
1227 | percent = |
1227 | percent = |
1228 | (float) (optimal_hash_size - |
1228 | (float) (optimal_hash_size - |
1229 | adaptive_hash_min) / (float) (adaptive_hash_max - |
1229 | adaptive_hash_min) / (float) (adaptive_hash_max - |
1230 | adaptive_hash_min); |
1230 | adaptive_hash_min); |
1231 | optimal_hash_size = |
1231 | optimal_hash_size = (int) // Pierre-Marie Baty -- added type cast |
1232 | adaptive_hashp_min + percent * (adaptive_hashp_max - |
1232 | (adaptive_hashp_min + percent * (adaptive_hashp_max - |
1233 | adaptive_hashp_min); |
1233 | adaptive_hashp_min)); |
1234 | optimal_hash_size = Max(optimal_hash_size, adaptive_hashp_min) |
1234 | optimal_hash_size = Max(optimal_hash_size, (int) adaptive_hashp_min); // Pierre-Marie Baty -- added type cast |
1235 | sprintf(buffer, "hashp=%d\n", optimal_hash_size); |
1235 | sprintf(buffer, "hashp=%d\n", optimal_hash_size); |
1236 | Option(tree); |
1236 | Option(tree); |
1237 | } |
1237 | } |
1238 | } |
1238 | } |
1239 | /* |
1239 | /* |
Line 1714... | Line 1714... | ||
1714 | mode = tournament_mode; |
1714 | mode = tournament_mode; |
1715 | printf("use 'settc' command if a game is restarted after Crafty\n"); |
1715 | printf("use 'settc' command if a game is restarted after Crafty\n"); |
1716 | printf("has been terminated for any reason.\n"); |
1716 | printf("has been terminated for any reason.\n"); |
1717 | } else if (!strcmp(args[1], "normal")) { |
1717 | } else if (!strcmp(args[1], "normal")) { |
1718 | mode = normal_mode; |
1718 | mode = normal_mode; |
1719 | book_weight_learn = 1. |
1719 | book_weight_learn = 1.0f; // Pierre-Marie Baty -- fixed constant truncation |
1720 | book_weight_freq = 1. |
1720 | book_weight_freq = 1.0f; // Pierre-Marie Baty -- fixed constant truncation |
1721 | book_weight_eval = 0. |
1721 | book_weight_eval = 0.5f; // Pierre-Marie Baty -- fixed constant truncation |
1722 | } else if (!strcmp(args[1], "match")) { |
1722 | } else if (!strcmp(args[1], "match")) { |
1723 | mode = normal_mode; |
1723 | mode = normal_mode; |
1724 | book_weight_learn = 1. |
1724 | book_weight_learn = 1.0f; // Pierre-Marie Baty -- fixed constant truncation |
1725 | book_weight_freq = 0. |
1725 | book_weight_freq = 0.2f; // Pierre-Marie Baty -- fixed constant truncation |
1726 | book_weight_eval = 0. |
1726 | book_weight_eval = 0.1f; // Pierre-Marie Baty -- fixed constant truncation |
1727 | } else { |
1727 | } else { |
1728 | printf("usage: mode normal|tournament|match\n"); |
1728 | printf("usage: mode normal|tournament|match\n"); |
1729 | mode = normal_mode; |
1729 | mode = normal_mode; |
1730 | book_weight_learn = 1. |
1730 | book_weight_learn = 1.0f; // Pierre-Marie Baty -- fixed constant truncation |
1731 | book_weight_freq = 1. |
1731 | book_weight_freq = 1.0f; // Pierre-Marie Baty -- fixed constant truncation |
1732 | book_weight_eval = 0. |
1732 | book_weight_eval = 0.5f; // Pierre-Marie Baty -- fixed constant truncation |
1733 | } |
1733 | } |
1734 | } |
1734 | } |
1735 | if (mode == tournament_mode) |
1735 | if (mode == tournament_mode) |
1736 | printf("tournament mode.\n"); |
1736 | printf("tournament mode.\n"); |
1737 | else if (mode == normal_mode) |
1737 | else if (mode == normal_mode) |
Line 1851... | Line 1851... | ||
1851 | else if (OptionMatch("noise", *args)) { |
1851 | else if (OptionMatch("noise", *args)) { |
1852 | if (nargs < 2) { |
1852 | if (nargs < 2) { |
1853 | printf("usage: noise <n>\n"); |
1853 | printf("usage: noise <n>\n"); |
1854 | return 1; |
1854 | return 1; |
1855 | } |
1855 | } |
1856 | noise_level = atof |
1856 | noise_level = (unsigned int) (atof(args[1]) * 100); // Pierre-Marie Baty -- added type cast |
1857 | Print(32, "noise level set to %.2f seconds.\n", |
1857 | Print(32, "noise level set to %.2f seconds.\n", |
1858 | (float) noise_level / 100.0); |
1858 | (float) noise_level / 100.0); |
1859 | } |
1859 | } |
1860 | /* |
1860 | /* |
1861 | ************************************************************ |
1861 | ************************************************************ |
Line 3405... | Line 3405... | ||
3405 | return 3; |
3405 | return 3; |
3406 | allow_cores = 0; |
3406 | allow_cores = 0; |
3407 | if (xboard) |
3407 | if (xboard) |
3408 | Print(4095, "Warning-- xboard 'cores' option disabled\n"); |
3408 | Print(4095, "Warning-- xboard 'cores' option disabled\n"); |
3409 | smp_max_threads = atoi(args[1]); |
3409 | smp_max_threads = atoi(args[1]); |
3410 | if (smp_max_threads > hardware_processors |
3410 | if (smp_max_threads > (int) hardware_processors) { // Pierre-Marie Baty -- added type cast |
3411 | Print(4095, "ERROR - machine has %d processors.\n", |
3411 | Print(4095, "ERROR - machine has %d processors.\n", |
3412 | hardware_processors); |
3412 | hardware_processors); |
3413 | Print(4095, "ERROR - max threads can not exceed this limit.\n"); |
3413 | Print(4095, "ERROR - max threads can not exceed this limit.\n"); |
3414 | smp_max_threads = hardware_processors; |
3414 | smp_max_threads = hardware_processors; |
3415 | } |
3415 | } |
Line 3526... | Line 3526... | ||
3526 | else if (OptionMatch("st", *args)) { |
3526 | else if (OptionMatch("st", *args)) { |
3527 | if (nargs < 2) { |
3527 | if (nargs < 2) { |
3528 | printf("usage: st <time>\n"); |
3528 | printf("usage: st <time>\n"); |
3529 | return 1; |
3529 | return 1; |
3530 | } |
3530 | } |
3531 | search_time_limit = atof |
3531 | search_time_limit = (int) (atof(args[1]) * 100); // Pierre-Marie Baty -- added type cast |
3532 | Print(32, "search time set to %.2f.\n", |
3532 | Print(32, "search time set to %.2f.\n", |
3533 | (float) search_time_limit / 100.0); |
3533 | (float) search_time_limit / 100.0); |
3534 | } |
3534 | } |
3535 | /* |
3535 | /* |
3536 | ************************************************************ |
3536 | ************************************************************ |