Changes in IO. Reader.

parent 6df52e76
......@@ -14,6 +14,7 @@ reset_timer!()
include("./src/io.jl")
include("./src/meas.jl")
include("./src/mc.jl")
@timeit "Input reading and space allocation" begin
read_input()
......
......@@ -114,10 +114,11 @@ function save_data()
BDIO_start_record!(fb, BDIO_BIN_GENERIC, 1)
BDIO_write!(fb, [convert(Int32, 4)])
BDIO_write!(fb, [convert(Int32, lp.iL[i]) for i in 1:4])
BDIO_write!(fb, [dpar.m0, dpar.csw, dpar.ct,params["Fermion"]["Cfl"]])
BDIO_write!(fb, [dpar.m0, dpar.csw, params["Fermion"]["Cfl"]])
BDIO_write!(fb, [dpar.th[i] for i in 1:4])
BDIO_write!(fb, [convert(Int32,length(flow_times))])
BDIO_write!(fb, flow_times)
BDIO_write!(fb, [N_noise,])
BDIO_write!(fb, [convert(Int32,N_noise)])
BDIO_write_hash!(fb)
end
......@@ -125,14 +126,14 @@ function save_data()
BDIO_start_record!(fb, BDIO_BIN_GENERIC, 8)
for fl in 1:length(flow_times)
for noi in 1:N_noise
BDIO_write!(fb,pp_corr_t0)
BDIO_write!(fb,ap_corr_t0)
for noi in 1:N_noise
BDIO_write!(fb,pp_corr_t0[:,noi])
BDIO_write!(fb,ap_corr_t0[:,noi])
BDIO_write!(fb,pp_corr_t)
BDIO_write!(fb,ap_corr_t)
BDIO_write!(fb,Quark_cond)
for fl in 1:length(flow_times)
BDIO_write!(fb,pp_corr_t[:,noi,fl])
BDIO_write!(fb,ap_corr_t[:,noi,fl])
BDIO_write!(fb,Quark_cond[noi,fl])
end
end
......
using LatticeGPU
using TOML
using TimerOutputs
using ArgParse
using CUDA
function thermalize()
println(log_file,"\n Starting simulation\n")
println(log_file,"Thermalizing...")
flush(log_file)
for _ in 1:params["HMC"]["nth"]
HMC!(U,intsch,lp,gp,ymws)
end
return nothing
end
function Gauge_update()
println(log_file,"Performing "*string(params["HMC"]["dmeas"])*" HMC steps...")
flush(log_file)
for _ in 1:params["HMC"]["dmeas"]
_,acc = HMC!(U,intsch,lp,gp,ymws)
acc ? nothing : println(log_file,"Rejected HCM step")
end
global MCid = MCid + 1
println(log_file,"Updated to Gauge configuration n"*string(MCid))
Csw!(dws,U,gp,lp)
U_CPU .= Array(U)
flush(log_file)
return nothing
end
......@@ -26,45 +26,6 @@ function load_fields()
end
function thermalize()
println(log_file,"\n Starting simulation\n")
println(log_file,"Thermalizing...")
flush(log_file)
for _ in 1:params["HMC"]["nth"]
HMC!(U,intsch,lp,gp,ymws)
end
return nothing
end
function Gauge_update()
println(log_file,"Performing "*string(params["HMC"]["dmeas"])*" HMC steps...")
flush(log_file)
for _ in 1:params["HMC"]["dmeas"]
_,acc = HMC!(U,intsch,lp,gp,ymws)
acc ? nothing : println(log_file,"Rejected HCM step")
end
global MCid = MCid + 1
println(log_file,"Updated to Gauge configuration n"*string(MCid))
Csw!(dws,U,gp,lp)
U_CPU .= Array(U)
flush(log_file)
return nothing
end
"""
function two_pt()
......@@ -72,7 +33,7 @@ Stores the two point function in the variables 'pp_corr_t0', 'ap_corr_t0', 'pp_c
"""
function two_pt()
println(log_file,"\nMeasuring 2pt...")
println(log_file,"Measuring 2pt...")
flush(log_file)
for noi in 1:N_noise
......@@ -92,8 +53,6 @@ function two_pt()
end end end
end
delta_t = 0.0
neps = int.eps_ini
for fl in 1:length(flow_times)
......@@ -117,7 +76,12 @@ function two_pt()
copyto!(U,U_CPU)
end
println(log_file,"Finished measuring 2pt\n")
pp_corr_t0 .= pp_corr_t0./prod(lp.iL[1:3])
ap_corr_t0 .= ap_corr_t0./prod(lp.iL[1:3])
pp_corr_t .= pp_corr_t./prod(lp.iL[1:3])
ap_corr_t .= pp_corr_t./prod(lp.iL[1:3])
println(log_file,"Finished measuring 2pt")
flush(log_file)
return nothing
......@@ -125,6 +89,11 @@ end
"""
function one_pt()
Stores the one point function in the variable 'Quark_cond'.
"""
function one_pt()
copyto!(U,U_CPU)
......@@ -133,7 +102,7 @@ function one_pt()
println(log_file,"Measuring 1pt at t = "*string(flow_times[fl])*"...")
flush(log_file)
for noi in 1:N_noise
for noi in 1:N_noise
pfrandomize!(psi,lp)
......@@ -153,7 +122,9 @@ function one_pt()
end
end
println(log_file,"Finished measuring 1pt\n")
Quark_cond .= Quark_cond./prod(lp.iL)
println(log_file,"Finished measuring 1pt")
return nothing
end
......
using LatticeGPU
using ADerrors
using BDIO
function read_ff(name::String)
file = BDIO_open(name,"r","FerFlow correlators")
while BDIO_get_uinfo(file) != 1
BDIO_seek!(file)
end
dims=Vector{Int32}(undef,1)
iL=Vector{Int32}(undef,4)
dpars=Vector{Float64}(undef,3) # m0,csw,Cfl
th=Vector{ComplexF64}(undef,4)
nflow=Vector{Int32}(undef,1)
N_noise=Vector{Int32}(undef,1)
BDIO_read(file, dims)
BDIO_read(file, iL)
BDIO_read(file, dpars)
BDIO_read(file, th)
BDIO_read(file, nflow)
flow_times=Vector{Float64}(undef,nflow)
BDIO_read(file, flow_times)
BDIO_read(file, N_noise)
N_noise = N_noise[1]
nflow = nflow[1]
TvecR = Vector{Float64}(undef,iL[4]);
TvecC = Vector{ComplexF64}(undef,iL[4]);
CN = Vector{ComplexF64}(undef,1);
pp_corr = Array{Float64}(undef,1,iL[4],N_noise);
ap_corr = Array{ComplexF64}(undef,1,iL[4],N_noise);
pp_corr_t = Array{Float64}(undef,1,iL[4],N_noise,nflow);
ap_corr_t = Array{ComplexF64}(undef,1,iL[4],N_noise,nflow);
Sigma = Array{ComplexF64}(undef,1,N_noise,nflow);
pp_corr_mc = Array{Float64}(undef,0,iL[4],N_noise);
ap_corr_mc = Array{ComplexF64}(undef,0,iL[4],N_noise);
pp_corr_t_mc = Array{Float64}(undef,0,iL[4],N_noise,nflow);
ap_corr_t_mc = Array{ComplexF64}(undef,0,iL[4],N_noise,nflow);
Sigma_mc = Array{ComplexF64}(undef,0,N_noise,nflow);
while BDIO_get_uinfo(file) != 8
BDIO_seek!(file)
end
while BDIO_get_uinfo(file) == 8
for noi in 1:N_noise
BDIO_read(file,TvecR)
pp_corr[1,:,noi] .= TvecR
BDIO_read(file,TvecC)
ap_corr[1,:,noi] .= TvecC
for fl in 1:nflow
BDIO_read(file,TvecR)
pp_corr_t[1,:,noi,fl].= TvecR
BDIO_read(file,TvecC)
ap_corr_t[1,:,noi,fl].= TvecC
BDIO_read(file,CN)
Sigma[1,noi,fl]= CN[1]
end
end
pp_corr_mc=[pp_corr_mc;pp_corr]
ap_corr_mc=[ap_corr_mc;ap_corr]
pp_corr_t_mc=[pp_corr_t_mc;pp_corr_t]
ap_corr_t_mc=[ap_corr_t_mc;ap_corr_t]
Sigma_mc=[Sigma_mc;Sigma]
BDIO_seek!(file,2)
end
BDIO_close!(file)
return pp_corr_mc,ap_corr_mc,pp_corr_t_mc,ap_corr_t_mc,Sigma_mc
end
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