update SL_orbit.jl
This commit is contained in:
parent
8a022c03e0
commit
563c69db28
39
SL_orbit.jl
39
SL_orbit.jl
@ -1,5 +1,5 @@
|
|||||||
using ArgParse
|
using ArgParse
|
||||||
using SCS
|
using SCS.SCSSolver
|
||||||
|
|
||||||
using Nemo
|
using Nemo
|
||||||
using PropertyT
|
using PropertyT
|
||||||
@ -82,12 +82,23 @@ end
|
|||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
function cpuinfo_physicalcores()
|
||||||
|
maxcore = -1
|
||||||
|
for line in eachline("/proc/cpuinfo")
|
||||||
|
if startswith(line, "core id")
|
||||||
|
maxcore = max(maxcore, parse(Int, split(line, ':')[2]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
maxcore < 0 && error("failure to read core ids from /proc/cpuinfo")
|
||||||
|
return maxcore + 1
|
||||||
|
end
|
||||||
|
|
||||||
function parse_commandline()
|
function parse_commandline()
|
||||||
settings = ArgParseSettings()
|
settings = ArgParseSettings()
|
||||||
|
|
||||||
@add_arg_table settings begin
|
@add_arg_table settings begin
|
||||||
"--tol"
|
"--tol"
|
||||||
help = "set numerical tolerance for the SDP solver (default: 1e-5)"
|
help = "set numerical tolerance for the SDP solver"
|
||||||
arg_type = Float64
|
arg_type = Float64
|
||||||
default = 1e-14
|
default = 1e-14
|
||||||
"--iterations"
|
"--iterations"
|
||||||
@ -95,27 +106,27 @@ function parse_commandline()
|
|||||||
arg_type = Int
|
arg_type = Int
|
||||||
default = 200000
|
default = 200000
|
||||||
"--upper-bound"
|
"--upper-bound"
|
||||||
help = "Set an upper bound for the spectral gap (default: Inf)"
|
help = "Set an upper bound for the spectral gap"
|
||||||
arg_type = Float64
|
arg_type = Float64
|
||||||
default = Inf
|
default = Inf
|
||||||
"--cpus"
|
"--cpus"
|
||||||
help = "Set number of cpus used by solver (default: auto)"
|
help = "Set number of cpus used by solver"
|
||||||
arg_type = Int
|
arg_type = Int
|
||||||
required = false
|
required = false
|
||||||
"-N"
|
"-N"
|
||||||
help = "Consider automorphisms of free group on N generators (default: N=2)"
|
help = "Consider elementary matrices EL(N)"
|
||||||
arg_type = Int
|
arg_type = Int
|
||||||
default = 2
|
default = 2
|
||||||
"-p"
|
"-p"
|
||||||
help = "Matrices over filed of p-elements (default: p=0 => over ZZ)"
|
help = "Matrices over field of p-elements (p=0 => over ZZ)"
|
||||||
arg_type = Int
|
arg_type = Int
|
||||||
default = 0
|
default = 0
|
||||||
"--radius"
|
"--radius"
|
||||||
help = "Find the decomposition over B_r(e,S)"
|
help = "Radius of ball B_r(e,S) to find solution over"
|
||||||
arg_type = Int
|
arg_type = Int
|
||||||
default = 2
|
default = 2
|
||||||
"-X"
|
"-X"
|
||||||
help = "Matrices are over ZZ⟨X⟩"
|
help = "Consider EL(N, ZZ⟨X⟩)"
|
||||||
action = :store_true
|
action = :store_true
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -131,6 +142,13 @@ end
|
|||||||
function main()
|
function main()
|
||||||
parsed_args = parse_commandline()
|
parsed_args = parse_commandline()
|
||||||
|
|
||||||
|
if parsed_args["cpus"] ≠ nothing
|
||||||
|
if parsed_args["cpus"] > cpuinfo_physicalcores()
|
||||||
|
warn("Number of specified cores exceeds the physical core cound. Performance will suffer.")
|
||||||
|
end
|
||||||
|
BLAS.set_num_threads(parsed_args["cpus"])
|
||||||
|
end
|
||||||
|
|
||||||
N = parsed_args["N"]
|
N = parsed_args["N"]
|
||||||
p = parsed_args["p"]
|
p = parsed_args["p"]
|
||||||
|
|
||||||
@ -151,7 +169,6 @@ function main()
|
|||||||
|
|
||||||
dirname = "$(dirname)_$(upper_bound)_r=$radius"
|
dirname = "$(dirname)_$(upper_bound)_r=$radius"
|
||||||
|
|
||||||
isdir(dirname) || mkdir(dirname)
|
|
||||||
logger = PropertyT.setup_logging(dirname)
|
logger = PropertyT.setup_logging(dirname)
|
||||||
|
|
||||||
info(logger, "Group: $dirname")
|
info(logger, "Group: $dirname")
|
||||||
@ -162,11 +179,11 @@ function main()
|
|||||||
G, S = SL_generatingset(N, p, parsed_args["X"])
|
G, S = SL_generatingset(N, p, parsed_args["X"])
|
||||||
info(logger, G)
|
info(logger, G)
|
||||||
info(logger, "Symmetric generating set of size $(length(S))")
|
info(logger, "Symmetric generating set of size $(length(S))")
|
||||||
info(logger, S)
|
# info(logger, S)
|
||||||
AutS = WreathProduct(FiniteField(2,1, "a")[1], PermutationGroup(N))
|
AutS = WreathProduct(FiniteField(2,1, "a")[1], PermutationGroup(N))
|
||||||
# AutS = PermutationGroup(N)
|
# AutS = PermutationGroup(N)
|
||||||
|
|
||||||
solver = SCS.SCSSolver(eps=tol, max_iters=iterations, verbose=true, linearsolver=SCS.Direct)
|
solver = SCSSolver(eps=tol, max_iters=iterations, linearsolver=SCS.Direct)
|
||||||
|
|
||||||
sett = Settings(dirname, N, G, S, AutS, radius, solver, upper_bound, tol)
|
sett = Settings(dirname, N, G, S, AutS, radius, solver, upper_bound, tol)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user