Changes in 1pt and minor bug fix

parent af973362
...@@ -19,7 +19,7 @@ include("./src/mc.jl") ...@@ -19,7 +19,7 @@ include("./src/mc.jl")
@timeit "Input reading and space allocation" begin @timeit "Input reading and space allocation" begin
read_input() read_input()
load_structs() load_structs()
global log_file = open("./output/"*params["Run"]["name"]*".log","w+") global log_file = open("./output/"*params["Run"]["name"]*".log","a")
write_log() write_log()
load_fields() load_fields()
therm_or_readlist() therm_or_readlist()
......
...@@ -79,7 +79,7 @@ end ...@@ -79,7 +79,7 @@ end
function write_log() function write_log()
println(log_file,"Running Fermass.jl by ", params["Run"]["user"],". Name of the run: ",params["Run"]["name"]) println(log_file,"Running Ferflow.jl by ", params["Run"]["user"],". Name of the run: ",params["Run"]["name"])
println(log_file,"") println(log_file,"")
print(log_file,"Calling: ") print(log_file,"Calling: ")
...@@ -117,7 +117,7 @@ function save_data() ...@@ -117,7 +117,7 @@ function save_data()
fb = BDIO_open(fname, "a") fb = BDIO_open(fname, "a")
println(log_file,"\nAppending output to "*fname*"\n") println(log_file,"\nAppending output to "*fname*"\n")
else else
fb = BDIO_open(fname, "w", "BDIO output from sfcf.jl") fb = BDIO_open(fname, "w", "BDIO output from ferflow.jl")
println(log_file,"Creating new BDIO output file "*fname) println(log_file,"Creating new BDIO output file "*fname)
BDIO_start_record!(fb, BDIO_BIN_GENERIC, 14) BDIO_start_record!(fb, BDIO_BIN_GENERIC, 14)
...@@ -146,10 +146,8 @@ function save_data() ...@@ -146,10 +146,8 @@ function save_data()
for fl in 1:length(flow_times) for fl in 1:length(flow_times)
BDIO_write!(fb,pp_corr_t[:,noi,fl]) BDIO_write!(fb,pp_corr_t[:,noi,fl])
BDIO_write!(fb,ap_corr_t[:,noi,fl]) BDIO_write!(fb,ap_corr_t[:,noi,fl])
## Testblock 4 : Changed the saving of Sigma BDIO_write!(fb,Quark_cond[:,noi,fl])
BDIO_write!(fb,[Quark_cond[:,noi,fl]]) BDIO_write!(fb,Quark_cond_cfl[:,noi,fl])
BDIO_write!(fb,[Quark_cond_cfl[:,noi,fl]])
##
BDIO_write!(fb,[phat_t[noi,fl]]) BDIO_write!(fb,[phat_t[noi,fl]])
end end
end end
......
...@@ -32,7 +32,7 @@ function Gauge_update() ...@@ -32,7 +32,7 @@ function Gauge_update()
global RUN_ON = isfile("RUN_ON_"*params["Run"]["name"]) global RUN_ON = isfile("RUN_ON_"*params["Run"]["name"])
else else
load_gauge_field() load_gauge_field()
global RUN_ON = (isfile("RUN_ON_"*params["Run"]["name"]) && CONFIG_LIST[MCid+1] != "") global RUN_ON = (isfile("RUN_ON_"*params["Run"]["name"]) && CONFIG_LIST[MCid+1] != "./cnfg/")
end end
return nothing return nothing
......
...@@ -25,14 +25,8 @@ function load_fields() ...@@ -25,14 +25,8 @@ function load_fields()
global Eofpla = Array{Complex{Float64}}(undef,lp.iL[4],lp.npls); global Eofpla = Array{Complex{Float64}}(undef,lp.iL[4],lp.npls);
global phat_t = Array{Float64}(undef,N_noise,length(flow_times)); global phat_t = Array{Float64}(undef,N_noise,length(flow_times));
# global Quark_cond = Array{Complex{Float64}}(undef,N_noise,length(flow_times));
# global Quark_cond_cfl = Array{Complex{Float64}}(undef,N_noise,length(flow_times));
## Test block 1
global Quark_cond = Array{Complex{Float64}}(undef,lp.iL[4],N_noise,length(flow_times)); global Quark_cond = Array{Complex{Float64}}(undef,lp.iL[4],N_noise,length(flow_times));
global Quark_cond_cfl = Array{Complex{Float64}}(undef,lp.iL[4],N_noise,length(flow_times)); global Quark_cond_cfl = Array{Complex{Float64}}(undef,lp.iL[4],N_noise,length(flow_times));
##
return nothing return nothing
end end
...@@ -71,11 +65,10 @@ function two_pt() ...@@ -71,11 +65,10 @@ function two_pt()
end end end end end end
end end
delta_t = 0.0 delta_t = flow_times .- [0.0,flow_times[1:end-1]...]
neps = int.eps_ini neps = int.eps_ini
for fl in 1:length(flow_times) for fl in 1:length(flow_times)
delta_t = flow_times[fl] - delta_t _,epslist = flw_adapt(U, psi, int, delta_t[fl], neps, gp, dpar, lp, ymws, dws)
_,epslist = flw_adapt(U, psi, int, delta_t, neps, gp, dpar, lp, ymws, dws)
neps = epslist[end] neps = epslist[end]
if noi ==1 if noi ==1
...@@ -128,9 +121,9 @@ function one_pt() ...@@ -128,9 +121,9 @@ function one_pt()
for noi in 1:N_noise for noi in 1:N_noise
## Testblock 6 : added tsource ## The change in the field before randomize should be moved to the package
psi .= 0.0*psi
pfrandomize!(psi,lp,params["Fermion"]["tsource"]) pfrandomize!(psi,lp,params["Fermion"]["tsource"])
##
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)
...@@ -147,31 +140,22 @@ function one_pt() ...@@ -147,31 +140,22 @@ function one_pt()
flush(log_file) flush(log_file)
@timeit "CPU to GPU" 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_cfl[noi,fl] = -sum(norm2.(dws.sp))
#### Test block 2
Quark_cond[:,noi,fl] .= zero(ComplexF64) Quark_cond[:,noi,fl] .= zero(ComplexF64)
Quark_cond_cfl[:,noi,fl] .= zero(ComplexF64) Quark_cond_cfl[:,noi,fl] .= zero(ComplexF64)
for t in 1:lp.iL[4] for t in 1:lp.iL[4]
for i in 1:lp.iL[1] for j in 1:lp.iL[2] for k in 1:lp.iL[3] for i in 1:lp.iL[1] for j in 1:lp.iL[2] for k in 1:lp.iL[3]
b,r = point_index(CartesianIndex{lp.ndim}((i,j,k,t)),lp) b,r = point_index(CartesianIndex{lp.ndim}((i,j,k,t)),lp)
CUDA.@allowscalar Quark_cond[t,noi,fl] += dot(dws.sp[b,r],psi[b,r]) CUDA.@allowscalar Quark_cond[t,noi,fl] += dot(dws.sp[b,r],psi[b,r])
CUDA.@allowscalar Quark_cond_cfl[t,noi,fl] += -norm2.(dws.sp[b,r]) CUDA.@allowscalar Quark_cond_cfl[t,noi,fl] += -norm2(dws.sp[b,r])
end end end end end end
end end
#######
@timeit "CPU to GPU" copyto!(U,U_CPU) @timeit "CPU to GPU" copyto!(U,U_CPU)
end end
end end
## Testblock 3 : Changed division V4 to prod(...)
Quark_cond .= Quark_cond./prod(lp.iL[1:3]) Quark_cond .= Quark_cond./prod(lp.iL[1:3])
Quark_cond_cfl .= Quark_cond_cfl./prod(lp.iL[1:3]) Quark_cond_cfl .= Quark_cond_cfl./prod(lp.iL[1:3])
##
println(log_file,"Finished measuring 1pt") println(log_file,"Finished measuring 1pt")
return nothing return nothing
...@@ -194,11 +178,10 @@ function two_pt_rnd() ...@@ -194,11 +178,10 @@ function two_pt_rnd()
pfrandomize!(psi,lp) pfrandomize!(psi,lp)
delta_t = 0.0 delta_t = flow_times .- [0.0,flow_times[1:end-1]...]
neps = int.eps_ini neps = int.eps_ini
for fl in 1:length(flow_times) for fl in 1:length(flow_times)
delta_t = flow_times[fl] - delta_t _,epslist = flw_adapt(U, psi, int, delta_t[fl], neps, gp, dpar, lp, ymws, dws)
_,epslist = flw_adapt(U, psi, int, delta_t, neps, gp, dpar, lp, ymws, dws)
neps = epslist[end] neps = epslist[end]
phat_t[noi,fl] = sum(norm2.(psi)) phat_t[noi,fl] = sum(norm2.(psi))
......
...@@ -38,18 +38,18 @@ function read_ff(name::String) ...@@ -38,18 +38,18 @@ function read_ff(name::String)
ap_corr = Array{ComplexF64}(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); pp_corr_t = Array{Float64}(undef,1,iL[4],N_noise,nflow);
ap_corr_t = Array{ComplexF64}(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); Sigma = Array{ComplexF64}(undef,1,iL[4],N_noise,nflow);
Phat_t = Array{Float64}(undef,1,N_noise,nflow); Phat_t = Array{Float64}(undef,1,N_noise,nflow);
Sigma_cfl = Array{ComplexF64}(undef,1,N_noise,nflow); Sigma_cfl = Array{ComplexF64}(undef,1,iL[4],N_noise,nflow);
Eoft = Array{Complex{Float64}}(undef,1,1+nflow,iL[4]); Eoft = Array{Complex{Float64}}(undef,1,1+nflow,iL[4]);
pp_corr_mc = Array{Float64}(undef,0,iL[4],N_noise); pp_corr_mc = Array{Float64}(undef,0,iL[4],N_noise);
ap_corr_mc = Array{ComplexF64}(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); 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); ap_corr_t_mc = Array{ComplexF64}(undef,0,iL[4],N_noise,nflow);
Sigma_mc = Array{ComplexF64}(undef,0,N_noise,nflow); Sigma_mc = Array{ComplexF64}(undef,0,iL[4],N_noise,nflow);
Phat_t_mc = Array{Float64}(undef,0,N_noise,nflow); Phat_t_mc = Array{Float64}(undef,0,N_noise,nflow);
Sigma_cfl_mc = Array{ComplexF64}(undef,0,N_noise,nflow); Sigma_cfl_mc = Array{ComplexF64}(undef,0,iL[4],N_noise,nflow);
Eoft_mc = Array{Complex{Float64}}(undef,0,1+nflow,iL[4]); Eoft_mc = Array{Complex{Float64}}(undef,0,1+nflow,iL[4]);
while BDIO_get_uinfo(file) != 8 while BDIO_get_uinfo(file) != 8
...@@ -72,10 +72,10 @@ function read_ff(name::String) ...@@ -72,10 +72,10 @@ function read_ff(name::String)
BDIO_read(file,TvecC) BDIO_read(file,TvecC)
ap_corr_t[1,:,noi,fl].= TvecC ap_corr_t[1,:,noi,fl].= TvecC
BDIO_read(file,CN) BDIO_read(file,TvecC)
Sigma[1,noi,fl]= CN[1] Sigma[1,:,noi,fl] .= TvecC
BDIO_read(file,CN) BDIO_read(file,TvecC)
Sigma_cfl[1,noi,fl]= CN[1] Sigma_cfl[1,:,noi,fl] .= TvecC
BDIO_read(file,RN) BDIO_read(file,RN)
Phat_t[1,noi,fl]= RN[1] Phat_t[1,noi,fl]= RN[1]
end end
...@@ -126,8 +126,8 @@ function uwff(file::String) ...@@ -126,8 +126,8 @@ function uwff(file::String)
global pp_corr_t = [uwreal(sum(pp_corr_t_mc,dims = 3)[:,i,1,k]./Ns,runame) for i in 1:T, k in 1:Nfl] global pp_corr_t = [uwreal(sum(pp_corr_t_mc,dims = 3)[:,i,1,k]./Ns,runame) for i in 1:T, k in 1:Nfl]
global ap_corr_t = [uwreal(real.(sum(ap_corr_t_mc,dims = 3)[:,i,1,k]./Ns),runame) for i in 1:T,k in 1:Nfl] global ap_corr_t = [uwreal(real.(sum(ap_corr_t_mc,dims = 3)[:,i,1,k]./Ns),runame) for i in 1:T,k in 1:Nfl]
global Sigma = [uwreal(real.(sum(Sigma_mc,dims = 2)[:,1,i]./Ns),runame) for i in 1:Nfl] global Sigma = [uwreal(real.(sum(Sigma_mc,dims = 3)[:,i,1,k]./Ns),runame) for i in 1:T, k in 1:Nfl]
global Sigma_cfl = [uwreal(real.(sum(Sigma_cfl_mc,dims = 2)[:,1,i]./Ns),runame) for i in 1:Nfl] global Sigma_cfl = [uwreal(real.(sum(Sigma_cfl_mc,dims = 3)[:,i,1,k]./Ns),runame) for i in 1:T, k in 1:Nfl]
global Phat_t = [uwreal(sum(Phat_t_mc,dims = 2)[:,1,i]./Ns,runame) for i in 1:Nfl] global Phat_t = [uwreal(sum(Phat_t_mc,dims = 2)[:,1,i]./Ns,runame) for i in 1:Nfl]
return nothing return nothing
......
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