mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-11-27 01:10:28 +01:00
look for warmstart in the solutions dir
This commit is contained in:
parent
e94662e615
commit
c849ead0ac
@ -137,13 +137,18 @@ function λandP(name::String)
|
|||||||
return λ, P
|
return λ, P
|
||||||
end
|
end
|
||||||
|
|
||||||
function λandP(name::String, SDP_problem::JuMP.Model, varλ, varP)
|
function λandP(name::String, SDP_problem::JuMP.Model, varλ, varP, warmstart=false)
|
||||||
add_handler(solver_logger,
|
add_handler(solver_logger,
|
||||||
DefaultHandler(joinpath(name, "solver_$(string(now())).log"),
|
DefaultHandler(joinpath(name, "solver_$(string(now())).log"),
|
||||||
DefaultFormatter("{date}| {msg}")),
|
DefaultFormatter("{date}| {msg}")),
|
||||||
"solver_log")
|
"solver_log")
|
||||||
|
if warmstart && isfile(joinpath(name, "warmstart.jld"))
|
||||||
|
ws = load(joinpath(name, "warmstart.jld"), "warmstart")
|
||||||
|
else
|
||||||
|
ws = nothing
|
||||||
|
end
|
||||||
|
|
||||||
λ, P, warmstart = compute_λandP(SDP_problem, varλ, varP)
|
λ, P, warmstart = compute_λandP(SDP_problem, varλ, varP, warmstart=ws)
|
||||||
|
|
||||||
remove_handler(solver_logger, "solver_log")
|
remove_handler(solver_logger, "solver_log")
|
||||||
|
|
||||||
@ -152,7 +157,6 @@ function λandP(name::String, SDP_problem::JuMP.Model, varλ, varP)
|
|||||||
if λ > 0
|
if λ > 0
|
||||||
save(λ_fname, "λ", λ)
|
save(λ_fname, "λ", λ)
|
||||||
save(P_fname, "P", P)
|
save(P_fname, "P", P)
|
||||||
@show warmstart[1]
|
|
||||||
save(joinpath(name, "warmstart.jld"), "warmstart", warmstart)
|
save(joinpath(name, "warmstart.jld"), "warmstart", warmstart)
|
||||||
else
|
else
|
||||||
throw(ErrorException("Solver did not produce a valid solution!: λ = $λ"))
|
throw(ErrorException("Solver did not produce a valid solution!: λ = $λ"))
|
||||||
|
Loading…
Reference in New Issue
Block a user