Now can run on existing configs.

parent bd1d44b4
......@@ -22,11 +22,10 @@ include("./src/mc.jl")
global log_file = open("./output/"*params["Run"]["name"]*".log","w+")
write_log()
load_fields()
therm_or_readlist()
end
@timeit "Thermalization" thermalize()
while isfile("run_on")
while RUN_ON
@timeit "HMC" Gauge_update()
......
......@@ -29,7 +29,7 @@ function parse_commandline()
arg_type = String
"-c"
help = "Gauge configuration file"
help = "Gauge configuration list file"
arg_type = String
"--cern"
......@@ -67,6 +67,7 @@ function load_structs()
global N_noise = params["Measurements"]["N_noise"]
global MCid = 0
global Nmc_acc = 0
global RUN_ON = true
return nothing
end
......@@ -154,27 +155,6 @@ function save_data()
end
"""
function load_gauge_field()
Returns the gauge field and computes the Csw term
"""
function load_gauge_field()
if !parsed_args["cern"]
println(log_file,"\nReading gauge field with LGPU native convention from: ", parsed_args["c"], "...")
U,_ = read_cnfg(parsed_args["c"])
else
println(log_file,"\nReading gauge field with CERN convention from: ", parsed_args["c"], "...")
U = read_cnfg_cern(parsed_args["c"],lp)
end
f = open(parsed_args["c"],"r")
println(log_file,"MD5 checksum of gauge config: ",bytes2hex(md5(f)),"\n")
close(f)
Csw!(dws, U, gp, lp)
return U
end
function read_cnfg_cern(path::String,lp::SpaceParm)
Ucpu = Array{SU3{Float64}, 3}(undef, lp.bsz, lp.ndim, lp.rsz)
......
......@@ -5,20 +5,40 @@ using ArgParse
using CUDA
function thermalize()
function therm_or_readlist()
println(log_file,"\n Starting simulation\n")
println(log_file,"Thermalizing...")
flush(log_file)
if parsed_args["c"] == nothing
println(log_file,"Thermalizing...")
flush(log_file)
@timeit "Thermalization" for _ in 1:params["HMC"]["nth"]
HMC!(U,intsch,lp,gp,ymws)
end
for _ in 1:params["HMC"]["nth"]
HMC!(U,intsch,lp,gp,ymws)
else
println(log_file,"Loading gauge configurations from "*string(parsed_args["c"]))
read_config_list()
end
f = open("RUN_ON_"*params["Run"]["name"],"w+")
close(f)
return nothing
end
function Gauge_update()
if parsed_args["c"] == nothing
Gauge_update_hmc()
global RUN_ON = isfile("RUN_ON_"*params["Run"]["name"])
else
load_gauge_field()
global RUN_ON = (isfile("RUN_ON_"*params["Run"]["name"]) && CONFIG_LIST[MCid+1] != "")
end
return nothing
end
function Gauge_update_hmc()
println(log_file,"Performing "*string(params["HMC"]["dmeas"])*" HMC steps...")
flush(log_file)
......@@ -42,5 +62,48 @@ function Gauge_update()
flush(log_file)
return nothing
end
function read_config_list()
global CONFIG_LIST = Vector{String}(undef,0)
f = open(parsed_args["c"],"r")
while true
push!(CONFIG_LIST,"./cnfg/"*readline(f))
CONFIG_LIST[end] == "" ? break : nothing
end
println(log_file,"Read ", length(CONFIG_LIST)-1, " config names for analisis")
return nothing
end
"""
function load_gauge_field()
Loads the gauge field and computes the Csw term
"""
function load_gauge_field()
global MCid = MCid + 1
if !parsed_args["cern"]
println(log_file,"\nReading gauge field with LGPU native convention: ", CONFIG_LIST[MCid], "...")
global U,_ = read_cnfg(CONFIG_LIST[MCid])
else
println(log_file,"\nReading gauge field with CERN convention: ", CONFIG_LIST[MCid], "...")
global U = read_cnfg_cern(CONFIG_LIST[MCid],lp)
end
println(log_file,"Updated to Gauge configuration n"*string(MCid))
f = open(CONFIG_LIST[MCid],"r")
println(log_file,"MD5 checksum of gauge config: ",bytes2hex(md5(f)),"\n")
close(f)
println(log_file,"Plaq = ", plaquette(U, lp, gp, ymws))
println(log_file,"Qtop = ", Qtop(U, gp, lp, ymws))
Csw!(dws,U,gp,lp)
U_CPU .= Array(U)
flush(log_file)
return nothing
end
......@@ -141,8 +141,6 @@ end
"""
function two_pt_rnd()
......
using LatticeGPU
# using LatticeGPU
using ADerrors
using BDIO
......@@ -23,7 +23,7 @@ function read_ff(name::String)
BDIO_read(file, th)
BDIO_read(file, nflow)
flow_times=Vector{Float64}(undef,nflow[1])
BDIO_read(file, flow_times)
nflow[1] > 0 ? BDIO_read(file, flow_times) : nothing
BDIO_read(file, N_noise)
N_noise = N_noise[1]
......@@ -103,11 +103,11 @@ end
"""
function uwff(file::String)
Loads in the variables 'pp_corr','ap_corr','pp_corr_t','ap_corr_t' and 'Sigma' the corresponding
Loads in the variables 'Epft', 'pp_corr', 'ap_corr', 'pp_corr_t','ap_corr_t', 'Sigma' and 'Sigma_cfl' the corresponding
'uwreal' quantities. The indices are, when corresponding, eucliden time and flow times
"""
function uwff(file::String)
Eoft_mc,pp_corr_mc,ap_corr_mc,pp_corr_t_mc,ap_corr_t_mc,Sigma_mc,Phat_t_mc = read_ff(file)
Eoft_mc,pp_corr_mc,ap_corr_mc,pp_corr_t_mc,ap_corr_t_mc,Sigma_mc,Sigma_cfl_mc,Phat_t_mc = read_ff(file)
runame = String(split(split(file,"/")[end],".")[1])
T = size(pp_corr_mc)[2]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment