Skip to content

Commit a9e063c

Browse files
committed
flush stderr
1 parent 86ae900 commit a9e063c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

mcts/mcts_main.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ std::pair<bool, std::string> GTPExecute(MCTSEngine &engine, const std::string &c
233233
engine.Move(-1, -1);
234234
}
235235
engine.Move(x, y);
236-
fprintf(stderr, "%s\n", engine.GetDebugger().GetLastMoveDebugStr().c_str());
236+
std::cerr << engine.GetDebugger().GetLastMoveDebugStr() << std::endl;
237237
return {true, ""};
238238
}
239239
if (op == "genmove") {
@@ -246,7 +246,7 @@ std::pair<bool, std::string> GTPExecute(MCTSEngine &engine, const std::string &c
246246
GoCoordId x = -1, y = -1;
247247
engine.GenMove(x, y);
248248
engine.Move(x, y);
249-
fprintf(stderr, "%s\n", engine.GetDebugger().GetLastMoveDebugStr().c_str());
249+
std::cerr << engine.GetDebugger().GetLastMoveDebugStr() << std::endl;
250250
return {true, EncodeMove(x, y)};
251251
}
252252
if (op == "final_score") {
@@ -267,6 +267,7 @@ void GTPServing(std::istream &in, std::ostream &out)
267267
{
268268
auto engine = InitEngine(FLAGS_config_path);
269269
InitMoves(*engine, FLAGS_init_moves);
270+
std::cerr << std::flush;
270271

271272
int id;
272273
bool has_id, succ;

scripts/start_gpu.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ echo log to %CD%\log >&2
1515
md log 2>NUL
1616

1717
echo start mcts_main >&2
18-
call x64\Release\mcts_main --config_path=%config% --gtp --log_dir=log --v=1
18+
x64\Release\mcts_main --config_path=%config% --gtp --log_dir=log --v=1
1919

2020
popd

0 commit comments

Comments
 (0)