From 7796b0b0285020dbbd2e152347350fead628d1ff Mon Sep 17 00:00:00 2001 From: kalmar Date: Wed, 22 Mar 2017 13:24:17 +0100 Subject: [PATCH] finally fix for unbuffered output to solver-log --- src/sdps.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sdps.jl b/src/sdps.jl index 75ed6ea..ec5abfa 100644 --- a/src/sdps.jl +++ b/src/sdps.jl @@ -76,8 +76,12 @@ function solve_SDP(SDP_problem, solver) info(logger, Base.repr(SDP_problem)) # @time MathProgBase.writeproblem(SDP_problem, "/tmp/SDP_problem") - out = STDOUT + + # to change buffering mode of stdout to _IOLBF (line bufferin) + # see https://github.com/JuliaLang/julia/issues/8765 + ccall((:printf, "libc"), Int, (Ptr{UInt8},), "\n"); + o = redirect_stdout(solver_logger.handlers["solver_log"].io) # e = redirect_stderr(solver_logger.handlers["solver_log"].io)