One derivative with AD.

parent 7b2d14d5
This diff is collapsed.
...@@ -3,6 +3,8 @@ ADerrors = "5e92007d-7bf1-471c-8ceb-4591b8b567a9" ...@@ -3,6 +3,8 @@ ADerrors = "5e92007d-7bf1-471c-8ceb-4591b8b567a9"
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63" ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
BDIO = "375f315e-f2c4-11e9-2ef9-134f02f79e27" BDIO = "375f315e-f2c4-11e9-2ef9-134f02f79e27"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
Cthulhu = "f68482b8-f384-11e8-15f7-abe071a5a75f"
FormalSeries = "a55ae9b5-0907-4af6-81ab-c6ed2f8e0777"
LatticeGPU = "958c3683-801a-4582-9cfa-2d6e2ae1763b" LatticeGPU = "958c3683-801a-4582-9cfa-2d6e2ae1763b"
MD5 = "6ac74813-4b46-53a4-afec-0b5dc9d7885c" MD5 = "6ac74813-4b46-53a4-afec-0b5dc9d7885c"
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f" TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
...@@ -9,6 +9,7 @@ using CUDA ...@@ -9,6 +9,7 @@ using CUDA
using InteractiveUtils using InteractiveUtils
using BDIO using BDIO
using MD5 using MD5
using FormalSeries
reset_timer!() reset_timer!()
......
WARNING: ignoring conflicting import of FormalSeries.norm into Spinors
Activating project at `~/Git/ferflow_quenched_AD_test`
ERROR: LoadError: MethodError: no method matching +(::Series{ComplexF64, 2}, ::Series{Float64, 2})
Closest candidates are:
+(::Any, ::Any, !Matched::Any, !Matched::Any...) at operators.jl:591
+(::Series{T, N}) where {T, N} at ~/.julia/packages/FormalSeries/VrbHe/src/FormalSeriesTypes.jl:106
+(::Series{T, N}, !Matched::Number) where {T, N} at ~/.julia/packages/FormalSeries/VrbHe/src/FormalSeriesTypes.jl:108
...
Stacktrace:
[1] macro expansion
@ ~/Git/ferflow_quenched_AD_test/src/meas.jl:196 [inlined]
[2] macro expansion
@ ~/.julia/packages/TimerOutputs/Lw5SP/src/TimerOutput.jl:237 [inlined]
[3] Backflow_pt()
@ Main ~/Git/ferflow_quenched_AD_test/src/meas.jl:193
[4] macro expansion
@ ~/.julia/packages/TimerOutputs/Lw5SP/src/TimerOutput.jl:237 [inlined]
[5] top-level scope
@ ~/Git/ferflow_quenched_AD_test/main.jl:38
in expression starting at /home/fperez/Git/ferflow_quenched_AD_test/main.jl:29
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -66,13 +66,18 @@ function load_structs() ...@@ -66,13 +66,18 @@ function load_structs()
CUDA.device!(parsed_args["G"]) CUDA.device!(parsed_args["G"])
global lp = SpaceParm{4}(tuple(params["Space"]["size"]...), tuple(params["Space"]["blocks"]...),params["Space"]["bc"], (0,0,0,0,0,0)) global lp = SpaceParm{4}(tuple(params["Space"]["size"]...), tuple(params["Space"]["blocks"]...),params["Space"]["bc"], (0,0,0,0,0,0))
global gp = GaugeParm{Float64}(SU3{Float64},params["HMC"]["beta"],params["HMC"]["c0"],(params["HMC"]["cG"],0.0),(0.0,0.0),lp.iL); global gp = GaugeParm{Float64}(SU3{Float64},params["HMC"]["beta"],params["HMC"]["c0"],(params["HMC"]["cG"],0.0),(0.0,0.0),lp.iL);
global dws = DiracWorkspace(SU3fund,Float64,lp); global dws = DiracWorkspace(SU3fund,2,Float64,lp);
global ymws = YMworkspace(SU3,Float64,lp); global ymws = YMworkspace(SU3,Float64,lp);
global int = wfl_rk3(Float64, params["Frontflow"]["epsilon"], params["Backflow"]["tol"]) global int = wfl_rk3(Float64, params["Frontflow"]["epsilon"], params["Backflow"]["tol"])
global intsch = omf4(Float64,params["HMC"]["eps"], params["HMC"]["ns"]); global intsch = omf4(Float64,params["HMC"]["eps"], params["HMC"]["ns"]);
global fernames = [replace(k, "Fermion" => "") for k in keys(params) if startswith(k, "Fermion")] global fernames = [replace(k, "Fermion" => "") for k in keys(params) if startswith(k, "Fermion")]
global dpar = [DiracParam{Float64}(SU3fund,(1/(2*params["Fermion"*f]["kappa"])) - 4,params["Fermion"*f]["csw"],ntuple(i -> exp(((i!=4)*im*params["Fermion"*f]["theta"]/lp.iL[i]) + ((i==4)*im*params["Fermion"*f]["theta_t"]/lp.iL[i])),4),0.0,params["Fermion"*f]["ct"]) for f in fernames]; # SU3 assumed in the constructor
global dpar = [DiracParam{Float64}(
Series{Float64,2}(( (1/(2*params["Fermion"*f]["kappa"])) - 4, 1.0 )),
Series{Float64,2}(( params["Fermion"*f]["csw"], 0.0 )),
ntuple(i -> exp(((i!=4)*im*params["Fermion"*f]["theta"]/lp.iL[i]) + ((i==4)*im*params["Fermion"*f]["theta_t"]/lp.iL[i])), 4),
Series{Float64,2}(( 0.0, 0.0 )),
Series{Float64,2}(( params["Fermion"*f]["ct"], 0.0 )) ) for f in fernames];
global flow_times = params["Backflow"]["Flow_times"] global flow_times = params["Backflow"]["Flow_times"]
global MCid = 0 global MCid = 0
...@@ -89,7 +94,7 @@ end ...@@ -89,7 +94,7 @@ end
function write_log() function write_log()
println(log_file,"Running Ferflow.jl by ", params["Run"]["user"],". Name of the run: ",params["Run"]["name"]) println(log_file,"Running Ferflow.jl adfer v1.0 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: ")
...@@ -123,6 +128,8 @@ function write_log() ...@@ -123,6 +128,8 @@ function write_log()
println(log_file,"t_source backflow = ", params["Backflow"]["tsource"]) println(log_file,"t_source backflow = ", params["Backflow"]["tsource"])
println(log_file,"Backflow tolerance = ", params["Backflow"]["tol"]) println(log_file,"Backflow tolerance = ", params["Backflow"]["tol"])
println(log_file,"Dirac Param struct")
println(log_file,dpar)
flush(log_file) flush(log_file)
return nothing return nothing
end end
...@@ -130,14 +137,14 @@ end ...@@ -130,14 +137,14 @@ end
function save_data() function save_data()
ihdr = [convert(Int32,1730280201)] ihdr = [convert(Int32,1740655571)]
fname = "./output/"*params["Run"]["name"]*".bdio" fname = "./output/"*params["Run"]["name"]*".bdio"
if isfile(fname) if isfile(fname)
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 ferflow.jl") fb = BDIO_open(fname, "w", "BDIO output from ferflow.jl adfer v1.0")
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)
...@@ -148,9 +155,9 @@ function save_data() ...@@ -148,9 +155,9 @@ function save_data()
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, [convert(Int32, length(fernames))]) BDIO_write!(fb, [convert(Int32, length(fernames))])
for k in 1:length(fernames) for f in fernames
BDIO_write!(fb, [dpar[k].m0, dpar[k].csw]) BDIO_write!(fb, [params["Fermion"*f]["kappa"], params["Fermion"*f]["csw"]])
BDIO_write!(fb, [dpar[k].th[i] for i in 1:4]) BDIO_write!(fb, [params["Fermion"*f]["theta"],])
end end
BDIO_write!(fb, [convert(Int32,params["Frontflow"]["N_noise"])]) BDIO_write!(fb, [convert(Int32,params["Frontflow"]["N_noise"])])
BDIO_write!(fb, [convert(Int32,params["Frontflow"]["nsteps"])]) BDIO_write!(fb, [convert(Int32,params["Frontflow"]["nsteps"])])
...@@ -170,42 +177,65 @@ function save_data() ...@@ -170,42 +177,65 @@ function save_data()
for f in 1:length(dpar) for f in 1:length(dpar)
for noi in 1:params["Frontflow"]["N_noise"] for noi in 1:params["Frontflow"]["N_noise"]
BDIO_write!(fb,pp_corr_t0[:,noi,f]) BDIO_write!(fb, getindex.(getfield.(pp_corr_t0[:,noi,f], :c), 1))
BDIO_write!(fb,ap_corr_t0[:,noi,f]) BDIO_write!(fb, getindex.(getfield.(ap_corr_t0[:,noi,f], :c), 1))
BDIO_write!(fb,pphat_t0[:,noi,f]) BDIO_write!(fb, getindex.(getfield.(pphat_t0[:,noi,f], :c), 1))
BDIO_write!(fb,pptilde_t0[:,noi,f]) BDIO_write!(fb, getindex.(getfield.(pptilde_t0[:,noi,f], :c), 1))
for fl in 1:params["Frontflow"]["nsteps"]+1 for fl in 1:params["Frontflow"]["nsteps"]+1
BDIO_write!(fb,pp_corr_t[:,noi,fl,f]) BDIO_write!(fb, getindex.(getfield.(pp_corr_t[:,noi,fl,f], :c), 1))
BDIO_write!(fb,ap_corr_t[:,noi,fl,f]) BDIO_write!(fb, getindex.(getfield.(ap_corr_t[:,noi,fl,f], :c), 1))
BDIO_write!(fb, getindex.(getfield.(pphat_t[:,noi,fl,f], :c), 1))
BDIO_write!(fb,pphat_t[:,noi,fl,f]) BDIO_write!(fb, getindex.(getfield.(pptilde_t[:,noi,fl,f], :c), 1))
BDIO_write!(fb,pptilde_t[:,noi,fl,f]) end
end
end
for f in 1:length(dpar)
for noi in 1:params["Frontflow"]["N_noise"]
BDIO_write!(fb, getindex.(getfield.(pp_corr_t0[:,noi,f], :c), 2))
BDIO_write!(fb, getindex.(getfield.(ap_corr_t0[:,noi,f], :c), 2))
BDIO_write!(fb, getindex.(getfield.(pphat_t0[:,noi,f], :c), 2))
BDIO_write!(fb, getindex.(getfield.(pptilde_t0[:,noi,f], :c), 2))
for fl in 1:params["Frontflow"]["nsteps"]+1
BDIO_write!(fb, getindex.(getfield.(pp_corr_t[:,noi,fl,f], :c), 2))
BDIO_write!(fb, getindex.(getfield.(ap_corr_t[:,noi,fl,f], :c), 2))
BDIO_write!(fb, getindex.(getfield.(pphat_t[:,noi,fl,f], :c), 2))
BDIO_write!(fb, getindex.(getfield.(pptilde_t[:,noi,fl,f], :c), 2))
end end
end end
end end
BDIO_write!(fb, Eoft0)
BDIO_write!(fb,Eoft0) BDIO_write!(fb, Qt0)
BDIO_write!(fb,Qt0)
for fl in 1:params["Frontflow"]["nsteps"]+1 for fl in 1:params["Frontflow"]["nsteps"]+1
BDIO_write!(fb,Eoft[fl,:]) BDIO_write!(fb, Eoft[fl,:])
BDIO_write!(fb,Qt[fl,:]) BDIO_write!(fb, Qt[fl,:])
end end
for f in 1:length(dpar) for f in 1:length(dpar)
for noi in 1:params["Backflow"]["N_noise"] for noi in 1:params["Backflow"]["N_noise"]
for fl in 1:length(flow_times) for fl in 1:length(flow_times)
BDIO_write!(fb,pp_corr_tfl[:,noi,fl,f]) BDIO_write!(fb, getindex.(getfield.(pp_corr_tfl[:,noi,fl,f], :c), 1))
BDIO_write!(fb,ap_corr_tfl[:,noi,fl,f]) BDIO_write!(fb, getindex.(getfield.(ap_corr_tfl[:,noi,fl,f], :c), 1))
BDIO_write!(fb, getindex.(getfield.(Quark_cond[:,noi,fl,f], :c), 1))
BDIO_write!(fb,Quark_cond[:,noi,fl,f]) BDIO_write!(fb, getindex.(getfield.(Quark_cond_cfl[:,noi,fl,f], :c), 1))
BDIO_write!(fb,Quark_cond_cfl[:,noi,fl,f]) BDIO_write!(fb, getindex.(getfield.(Quark_cond2[:,noi,fl,f], :c), 1))
BDIO_write!(fb, getindex.(getfield.(Quark_cond2_cfl[:,noi,fl,f], :c), 1))
BDIO_write!(fb,Quark_cond2[:,noi,fl,f]) BDIO_write!(fb, getindex.(getfield.(ChiDchi[:,noi,fl,f], :c), 1))
BDIO_write!(fb,Quark_cond2_cfl[:,noi,fl,f]) BDIO_write!(fb, getindex.(getfield.(ChiDchi_cfl[:,noi,fl,f], :c), 1))
end
BDIO_write!(fb,ChiDchi[:,noi,fl,f]) end
BDIO_write!(fb,ChiDchi_cfl[:,noi,fl,f]) end
for f in 1:length(dpar)
for noi in 1:params["Backflow"]["N_noise"]
for fl in 1:length(flow_times)
BDIO_write!(fb, getindex.(getfield.(pp_corr_tfl[:,noi,fl,f], :c), 2))
BDIO_write!(fb, getindex.(getfield.(ap_corr_tfl[:,noi,fl,f], :c), 2))
BDIO_write!(fb, getindex.(getfield.(Quark_cond[:,noi,fl,f], :c), 2))
BDIO_write!(fb, getindex.(getfield.(Quark_cond_cfl[:,noi,fl,f], :c), 2))
BDIO_write!(fb, getindex.(getfield.(Quark_cond2[:,noi,fl,f], :c), 2))
BDIO_write!(fb, getindex.(getfield.(Quark_cond2_cfl[:,noi,fl,f], :c), 2))
BDIO_write!(fb, getindex.(getfield.(ChiDchi[:,noi,fl,f], :c), 2))
BDIO_write!(fb, getindex.(getfield.(ChiDchi_cfl[:,noi,fl,f], :c), 2))
end end
end end
end end
......
This diff is collapsed.
This diff is collapsed.
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