1
0
mirror of https://github.com/kalmarek/SmallHyperbolic synced 2024-11-09 04:05:27 +01:00
SmallHyperbolic/runcomputations.jl

71 lines
2.2 KiB
Julia
Raw Normal View History

2020-01-20 01:19:50 +01:00
using Logging
2019-12-18 00:34:21 +01:00
using PropertyT
using PropertyT.LinearAlgebra
using PropertyT.SparseArrays
using PropertyT.JuMP
using PropertyT.AbstractAlgebra
using PropertyT.Groups
using PropertyT.GroupRings
using PropertyT.JLD
BLAS.set_num_threads(2)
ENV["OMP_NUM_THREADS"] = 2
if !haskey(ENV, "GAP_EXECUTABLE")
ENV["GAP_EXECUTABLE"] = "/usr/lib/gap/gap"
end
include(joinpath("src", "FPGroups_GAP.jl"))
include(joinpath("src", "groupparse.jl"))
include(joinpath("src", "utils.jl"))
2020-01-20 01:19:50 +01:00
const HALFRADIUS = 1
2019-12-18 00:34:21 +01:00
using SCS
2020-01-19 17:29:41 +01:00
2020-02-26 14:50:55 +01:00
with_SCS(iters=30_000, acceleration=10; eps=1e-10) = with_optimizer(SCS.Optimizer,
2019-12-18 00:34:21 +01:00
linear_solver=SCS.Direct,
2020-01-19 17:29:41 +01:00
max_iters=iters,
2020-02-26 14:50:55 +01:00
eps=eps,
2020-01-19 17:29:41 +01:00
alpha=(acceleration == 0 ? 1.95 : 1.5),
acceleration_lookback=acceleration,
2019-12-18 00:34:21 +01:00
warm_start=true)
2020-03-31 23:26:55 +02:00
groups244 = parse_grouppresentations("data/presentations_2_4_4.txt")
2020-01-27 14:28:52 +01:00
groups333 = parse_grouppresentations("data/presentations_3_3_3.txt")
2020-01-20 01:19:50 +01:00
groups334 = parse_grouppresentations("data/presentations_3_3_4.txt")
groups344 = parse_grouppresentations("data/presentations_3_4_4.txt")
groups444 = parse_grouppresentations("data/presentations_4_4_4.txt")
2020-02-12 01:12:49 +01:00
groups555 = parse_grouppresentations("data/presentations_5_5_5.txt")
2019-12-18 00:34:21 +01:00
2020-02-12 01:12:49 +01:00
2020-03-31 23:26:55 +02:00
groups = merge(groups244, groups333, groups334, groups344, groups444, groups555)
2020-01-19 17:29:41 +01:00
2020-01-20 01:19:50 +01:00
@assert length(ARGS) == 1
2020-01-19 17:29:41 +01:00
2020-01-20 01:19:50 +01:00
let GROUP = ARGS[1]
@assert haskey(groups, GROUP)
2020-01-20 02:18:55 +01:00
group_name = "log/$(GROUP)_r$(HALFRADIUS)"
2020-01-20 02:23:27 +01:00
mkpath(group_name)
2020-01-20 01:19:50 +01:00
open(joinpath(group_name, "full.log"), "a+") do logfile
logger = SimpleLogger(logfile)
global_logger(logger)
@info "" group_name
2020-02-26 14:48:09 +01:00
spectral_gap, λ = check_propertyT(groups[GROUP], group_name,
2020-01-20 01:19:50 +01:00
HALFRADIUS, Inf, AutomaticStructure, with_SCS(100_000, 50))
2020-02-26 14:48:09 +01:00
if spectral_gap < 0.0 && λ > 0.01 # there is still a chance to detect spectral gap
new_λ = round(0.8λ, sigdigits=3)
new_dir = joinpath(group_name, "$new_λ")
2020-01-22 23:11:49 +01:00
isdir(new_dir) || mkpath(new_dir)
cp(joinpath(group_name, "Inf", "warmstart.jld"), joinpath(new_dir, "warmstart.jld"), force=true)
check_propertyT(groups[GROUP], group_name,
HALFRADIUS, new_λ, AutomaticStructure, with_SCS(500_000, 0))
end
2020-01-20 01:19:50 +01:00
end
2019-12-18 00:34:21 +01:00
end