From 56aed884161210688aa2ad6d5570a612a10ba73f Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Thu, 6 Apr 2023 16:16:27 +0200 Subject: [PATCH] =?UTF-8?q?use=20MKLDirect=20for=20G=E2=82=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/G₂_Adj.jl | 71 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 57 insertions(+), 14 deletions(-) diff --git a/scripts/G₂_Adj.jl b/scripts/G₂_Adj.jl index 339d99c..e9acfc9 100644 --- a/scripts/G₂_Adj.jl +++ b/scripts/G₂_Adj.jl @@ -1,6 +1,6 @@ using LinearAlgebra BLAS.set_num_threads(8) - +using MKL_jll ENV["OMP_NUM_THREADS"] = 4 using Groups @@ -84,16 +84,59 @@ unit = Δ warm = nothing -solve_in_loop( - model, - wd, - varP; - logdir = "./log/G2/r=$HALFRADIUS/Adj-InfΔ", - optimizer = scs_optimizer(; - eps = 1e-10, - max_iters = 50_000, - accel = 50, - alpha = 1.95, - ), - data = (elt = elt, unit = unit, halfradius = HALFRADIUS), -) +let status = JuMP.OPTIMIZE_NOT_CALLED, warm = warm, eps = 1e-9 + certified, λ = false, 0.0 + while status ≠ JuMP.OPTIMAL + @time status, warm = PropertyT.solve( + model, + scs_optimizer(; + linear_solver = SCS.MKLDirectSolver, + eps = eps, + max_iters = 100_000, + accel = 50, + alpha = 1.95, + ), + warm, + ) + + @info "reconstructing the solution" + Q = @time let wd = wd, Ps = [JuMP.value.(P) for P in varP], eps = eps + PropertyT.__droptol!.(Ps, 100eps) + Qs = real.(sqrt.(Ps)) + PropertyT.__droptol!.(Qs, eps) + + PropertyT.reconstruct(Qs, wd) + end + + @info "certifying the solution" + @time certified, λ = PropertyT.certify_solution( + elt, + unit, + JuMP.objective_value(model), + Q; + halfradius = HALFRADIUS, + augmented = true, + ) + end + + if certified && λ > 0 + Κ(λ, S) = round(sqrt(2λ / length(S)), Base.RoundDown; digits = 5) + @info "Certified result: $G has property (T):" N λ Κ(λ, S) + else + @info "Could NOT certify the result:" certified λ + end +end + +# solve_in_loop( +# model, +# wd, +# varP; +# logdir = "./log/G2/r=$HALFRADIUS/Adj-InfΔ", +# optimizer = scs_optimizer(; +# eps = 1e-10, +# max_iters = 50_000, +# accel = 50, +# alpha = 1.95, +# ), +# data = (elt = elt, unit = unit, halfradius = HALFRADIUS), +# )