Typo in io and utils and Timings in meas

parent 211ba7f2
...@@ -127,7 +127,7 @@ function save_data() ...@@ -127,7 +127,7 @@ function save_data()
BDIO_start_record!(fb, BDIO_BIN_GENERIC, 1) BDIO_start_record!(fb, BDIO_BIN_GENERIC, 1)
BDIO_write!(fb, [convert(Int32, 4)]) BDIO_write!(fb, [convert(Int32, 4)])
BDIO_write!(fb, [convert(Int32, lp.iL[i]) for i in 1:4]) BDIO_write!(fb, [convert(Int32, lp.iL[i]) for i in 1:4])
BDIO_write!(fb, [dpar.m0, dpar.csw, params["Fermion"]["Cfl"]]) BDIO_write!(fb, [dpar.m0, dpar.csw])
BDIO_write!(fb, [dpar.th[i] for i in 1:4]) BDIO_write!(fb, [dpar.th[i] for i in 1:4])
BDIO_write!(fb, [convert(Int32,length(flow_times))]) BDIO_write!(fb, [convert(Int32,length(flow_times))])
length(flow_times) > 0 ? BDIO_write!(fb, flow_times) : nothing length(flow_times) > 0 ? BDIO_write!(fb, flow_times) : nothing
......
...@@ -88,13 +88,13 @@ function two_pt() ...@@ -88,13 +88,13 @@ function two_pt()
end end
end end
copyto!(U,U_CPU) @timeit "CPU to GPU" copyto!(U,U_CPU)
end end
pp_corr_t0 .= pp_corr_t0./prod(lp.iL[1:3]) pp_corr_t0 .= pp_corr_t0./prod(lp.iL[1:3])
ap_corr_t0 .= ap_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]) pp_corr_t .= pp_corr_t./prod(lp.iL[1:3])
ap_corr_t .= pp_corr_t./prod(lp.iL[1:3]) ap_corr_t .= ap_corr_t./prod(lp.iL[1:3])
println(log_file,"Finished measuring 2pt") println(log_file,"Finished measuring 2pt")
flush(log_file) flush(log_file)
...@@ -112,7 +112,7 @@ The final result is 'Quark_cond' + C_fl*'Quark_cond_cfl' ...@@ -112,7 +112,7 @@ The final result is 'Quark_cond' + C_fl*'Quark_cond_cfl'
""" """
function one_pt() function one_pt()
copyto!(U,U_CPU) @timeit "CPU to GPU" copyto!(U,U_CPU)
for fl in 1:length(flow_times) for fl in 1:length(flow_times)
println(log_file,"Measuring 1pt at t = "*string(flow_times[fl])*"...") println(log_file,"Measuring 1pt at t = "*string(flow_times[fl])*"...")
...@@ -124,20 +124,22 @@ function one_pt() ...@@ -124,20 +124,22 @@ function one_pt()
backflow(psi, U, flow_times[fl], params["Measurements"]["Nsaves"], gp, dpar, lp, ymws, dws) backflow(psi, U, flow_times[fl], params["Measurements"]["Nsaves"], gp, dpar, lp, ymws, dws)
psi_CPU .= Array(psi) @timeit "GPU to CPU" psi_CPU .= Array(psi)
dws.sp .= dmul.(Gamma{5},psi) @timeit "Inversion" begin
g5Dw!(psi,U,dws.sp,dpar,dws,lp) dws.sp .= dmul.(Gamma{5},psi)
g5Dw!(psi,U,dws.sp,dpar,dws,lp)
niter = CG!(psi,U,DwdagDw!,dpar,lp,dws,params["Measurements"]["maxiter"], params["Measurements"]["tolerance"]) niter = CG!(psi,U,DwdagDw!,dpar,lp,dws,params["Measurements"]["maxiter"], params["Measurements"]["tolerance"])
end
println(log_file,"CG converged after ",niter," iterations with residue ",CUDA.mapreduce(x -> norm2(x), +, dws.sr)) println(log_file,"CG converged after ",niter," iterations with residue ",CUDA.mapreduce(x -> norm2(x), +, dws.sr))
copyto!(dws.sp,psi_CPU) @timeit "CPU to GPU" copyto!(dws.sp,psi_CPU)
Quark_cond[noi,fl] = sum(dot.(dws.sp,psi)) Quark_cond[noi,fl] = sum(dot.(dws.sp,psi))
Quark_cond_cfl[noi,fl] = sum(-norm2.(dws.sp)) Quark_cond_cfl[noi,fl] = -sum(norm2.(dws.sp))
copyto!(U,U_CPU) @timeit "CPU to GPU" copyto!(U,U_CPU)
end end
end end
......
...@@ -32,7 +32,7 @@ function read_ff(name::String) ...@@ -32,7 +32,7 @@ function read_ff(name::String)
TvecC = Vector{ComplexF64}(undef,iL[4]); TvecC = Vector{ComplexF64}(undef,iL[4]);
CN = Vector{ComplexF64}(undef,1); CN = Vector{ComplexF64}(undef,1);
RN = Vector{Float64}(undef,1); RN = Vector{Float64}(undef,1);
ET = Vector{ComplexF64}(undef,nflow+1); ET = Vector{ComplexF64}(undef,1+nflow);
pp_corr = Array{Float64}(undef,1,iL[4],N_noise); pp_corr = Array{Float64}(undef,1,iL[4],N_noise);
ap_corr = Array{ComplexF64}(undef,1,iL[4],N_noise); ap_corr = Array{ComplexF64}(undef,1,iL[4],N_noise);
...@@ -80,8 +80,10 @@ function read_ff(name::String) ...@@ -80,8 +80,10 @@ function read_ff(name::String)
Phat_t[1,noi,fl]= RN[1] Phat_t[1,noi,fl]= RN[1]
end end
end end
BDIO_read(file,ET) for time in 1:iL[4]
Eoft[1,:] .= ET BDIO_read(file,ET)
Eoft[1,:,time] .= ET
end
Eoft_mc=[Eoft_mc;Eoft] Eoft_mc=[Eoft_mc;Eoft]
pp_corr_mc=[pp_corr_mc;pp_corr] pp_corr_mc=[pp_corr_mc;pp_corr]
......
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