Commit 1749010e authored by Alberto Ramos's avatar Alberto Ramos

Main program finished

parent d533eaf2
......@@ -59,15 +59,21 @@ version = "3.5.0"
[[ChainRulesCore]]
deps = ["Compat", "LinearAlgebra", "SparseArrays"]
git-tree-sha1 = "3533f5a691e60601fe60c90d8bc47a27aa2907ec"
git-tree-sha1 = "f885e7e7c124f8c92650d61b9477b9ac2ee607dd"
uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
version = "1.11.0"
version = "1.11.1"
[[CodecZlib]]
deps = ["TranscodingStreams", "Zlib_jll"]
git-tree-sha1 = "ded953804d019afa9a3f98981d99b33e3db7b6da"
uuid = "944b1d66-785c-5afd-91f1-9de20f533193"
version = "0.7.0"
[[Compat]]
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
git-tree-sha1 = "31d0151f5716b655421d9d75b7fa74cc4e744df2"
git-tree-sha1 = "dce3e3fea680869eaa0b774b2e8343e9ff442313"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "3.39.0"
version = "3.40.0"
[[CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
......@@ -118,9 +124,9 @@ version = "8.1.2"
[[GPUCompiler]]
deps = ["ExprTools", "InteractiveUtils", "LLVM", "Libdl", "Logging", "TimerOutputs", "UUIDs"]
git-tree-sha1 = "ba475ea91facd7bde9f0f113f60e975882b4f5ca"
git-tree-sha1 = "77d915a0af27d474f0aaf12fcd46c400a552e84c"
uuid = "61eb1bfa-7361-4325-ad38-22787b887f55"
version = "0.13.6"
version = "0.13.7"
[[IOCapture]]
deps = ["Logging", "Random"]
......@@ -169,7 +175,7 @@ version = "0.0.11+0"
[[LatticeGPU]]
deps = ["CUDA", "Random", "TimerOutputs"]
git-tree-sha1 = "d1280b7894cab31b547a98576c0e51e57ea343d4"
git-tree-sha1 = "62d7728203bfe2cf4934648f9cc356cf16f69cf3"
repo-rev = "master"
repo-url = "https://igit.ific.uv.es/alramos/latticegpu.jl"
uuid = "958c3683-801a-4582-9cfa-2d6e2ae1763b"
......@@ -252,9 +258,9 @@ version = "0.5.5+0"
[[Parsers]]
deps = ["Dates"]
git-tree-sha1 = "f19e978f81eca5fd7620650d7dbea58f825802ee"
git-tree-sha1 = "ae4bbcadb2906ccc085cf52ac286dc1377dceccc"
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "2.1.0"
version = "2.1.2"
[[Pkg]]
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
......@@ -351,6 +357,12 @@ git-tree-sha1 = "7cb456f358e8f9d102a8b25e8dfedf58fa5689bc"
uuid = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
version = "0.5.13"
[[TranscodingStreams]]
deps = ["Random", "Test"]
git-tree-sha1 = "216b95ea110b5972db65aa90f88d8d89dcb8851c"
uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
version = "0.9.6"
[[UUIDs]]
deps = ["Random", "SHA"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
......
......@@ -2,6 +2,7 @@
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
BDIO = "375f315e-f2c4-11e9-2ef9-134f02f79e27"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
LatticeGPU = "958c3683-801a-4582-9cfa-2d6e2ae1763b"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
......
#
# Input file to reproduce results of
#
# M. Luscher. "Properties and uses of the
# Wilson flow in Lattice QCD"
# https://arxiv.org/pdf/1006.4518.pdf
# (see table 1)
#
[Run]
user = "alberto"
host = "artemisa"
name = "SU2_PBC_bt2.4_L12"
name = "SU3_PBC_bt5.96_L24x24x24x48"
seed = 1234
[Simulation]
group = "SU3" # Choose SU2, SU3
dimensions = 4
size = [12,12,12,12]
size = [24,24,24,48]
blocks = [4,4,4,4]
bcs = "SF" # Choose PERIODIC, SF
beta = 2.4
bcs = "PERIODIC" # Choose PERIODIC, SF
ntwist = [0,0,0,0,0,0]
beta = 5.96
c0 = 1.0 # 1.0 is Wilson action, 1.66... is LW, 3.648 is Iwasaki
cG = 0.0 # Only used with SF bcs
cG = 0.0 # Only used with SF bcs
[HMC]
integrator = "OMF4" # "LEAPFROPG", "OMF2", "OMF4"
ns = 10
ns = 20
eps = 0.1
nthm = 1000
ntraj = 10000
[Flow]
integrator = "RK3" # EULER, RK2, RK3
eps = 0.01
ns = 300
dtr = 10 # Frequency of flow measurements
......@@ -10,7 +10,7 @@
###
using LatticeGPU, TOML, BDIO, ArgParse, Random, CUDA, Pkg, InteractiveUtils, TimerOutputs, Printf
using LatticeGPU, TOML, BDIO, ArgParse, Random, CUDA, Pkg, InteractiveUtils, TimerOutputs, Printf, CodecZlib
function parse_commandline()
s = ArgParseSettings()
......@@ -41,7 +41,7 @@ function read_options(fname)
dim = s["Simulation"]["dimensions"]
lp = SpaceParm{dim}(Tuple(x for x in s["Simulation"]["size"]),
Tuple(x for x in s["Simulation"]["blocks"]),
BCS)
BCS, Tuple(x for x in s["Simulation"]["ntwist"]))
# Gauge Parameters
if s["Simulation"]["group"] == "SU2"
......@@ -66,13 +66,30 @@ function read_options(fname)
error("Unknown integrator")
end
if s["Flow"]["integrator"] == "EULER"
flwint = wfl_euler(T, s["Flow"]["eps"], 0.0)
elseif s["Flow"]["integrator"] == "RK2"
flwint = wfl_rk2(T, s["Flow"]["eps"], 0.0)
elseif s["Flow"]["integrator"] == "RK3"
flwint = wfl_rk3(T, s["Flow"]["eps"], 0.0)
else
error("Flow integrator not known")
end
flw_ns = s["Flow"]["ns"]
flw_dtr = s["Flow"]["dtr"]
# Write basic info to log file
flog = open(s["Run"]["name"]*".log", "w+")
println(flog, "\n## HMC LatticeGPU simulation")
flog = GzipCompressorStream(open(s["Run"]["name"]*".log.gz", "w+"))
if GRP == SU2
println(flog, "\n## HMC SU(2) LatticeGPU simulation")
else
println(flog, "\n## HMC SU(3) LatticeGPU simulation")
end
println(flog, lp)
println(flog, gp)
println(flog, int)
println(flog, flwint)
println(flog, " # [Enviroment Info]")
println(flog, "User: ", s["Run"]["user"])
......@@ -92,19 +109,19 @@ function read_options(fname)
BDIO_write!(fb, read(fname))
BDIO_write_hash!(fb)
# Random.seed!(CURAND.default_rng(), s["Run"]["seed"])
Random.seed!(CURAND.default_rng(), s["Run"]["seed"])
Random.seed!(s["Run"]["seed"])
nthm = s["HMC"]["nthm"]
nt = s["HMC"]["ntraj"]
return gp, lp, int, nthm, nt, fb, flog, GRP, T, BCS
return gp, lp, int, flwint, nthm, nt, flw_ns, flw_dtr, fb, flog, GRP, T, BCS
end
parsed_args = parse_commandline()
infile = parsed_args["i"]
gp, lp, int, nthm, nt, fb, flog, GRP, T, BCS = read_options(infile)
gp, lp, int, flwint, nthm, nt, flw_ns, flw_dtr, fb, flog, GRP, T, BCS = read_options(infile)
U = vector_field(GRP{T}, lp)
fill!(U, one(GRP{T}))
......@@ -134,7 +151,12 @@ for i in 1:nthm
end
end
Ecl = Array{T,2}(undef, flw_ns+1, div(nt,flw_dtr))
Epl = Array{T,2}(undef, flw_ns+1, div(nt,flw_dtr))
Qt = Array{T,2}(undef, flw_ns+1, div(nt,flw_dtr))
println(flog, "\n # Measurements")
kfl = 0
for i in 1:nt
k = i + nthm
dh[k], acc[k] = HMC!(U,int,lp, gp, ymws, noacc=true)
......@@ -149,10 +171,32 @@ for i in 1:nt
i, nt, acc[k] ? "true " : "false", dh[k], pl[k],
sfc[k,1], sfc[k,2])
end
ymws.U1 .= U
if i%flw_dtr == 0
global kfl = kfl + 1
for j in 1:flw_ns
Epl[j,kfl] = Eoft_plaq(U, gp, lp, ymws)
Ecl[j,kfl] = Eoft_clover(U, gp, lp, ymws)
Qt[j,kfl] = Qtop(U, gp, lp, ymws)
flw(U, flwint, 1, gp, lp, ymws)
if (j-1)%div(flw_ns,10) == 0
t = j*flwint.eps
@printf(flog, " FLOW t=%8.4f: %20.12e %20.12e %10.4e \n",
t, t^2*Epl[j,kfl], t^2*Ecl[j,kfl], Qt[j,kfl])
end
end
Epl[end,kfl] = Eoft_plaq(U, gp, lp, ymws)
Ecl[end,kfl] = Eoft_clover(U, gp, lp, ymws)
Qt[end,kfl] = Qtop(U, gp, lp, ymws)
end
U .= ymws.U1
end
print_timer(flog)
println(flog, "\n## END HMC LatticeGPU simulation")
close(flog)
# Measurements
......@@ -165,6 +209,9 @@ println(flog, "\n## END HMC LatticeGPU simulation")
# uid 9: dsdeta measurements
# uid 10: ddsdnu measurements
# uid 11: ddsdnu measurements
# uid 12: Epl measurements
# uid 13: Ecl measurements
# uid 14: Qtop measurements
function write_record(fb, uid, dt)
......@@ -178,10 +225,29 @@ function write_record(fb, uid, dt)
return nothing
end
function write_flow_record(fb, uid, dt)
BDIO_start_record!(fb, BDIO_BIN_F64LE, uid, true)
foo = [flwint.eps, convert(T,flw_ns)]
BDIO_write!(fb, foo)
for k in 1:div(nt,flw_dtr)
BDIO_write!(fb, dt[:,k])
end
BDIO_write_hash!(fb)
return nothing
end
write_record(fb, 2, dh)
write_record(fb, 4, pl)
write_record(fb, 8, sfc[:,1])
write_record(fb, 10, sfc[:,2])
if BCS == BC_SF_AFWB
write_record(fb, 8, sfc[:,1])
write_record(fb, 10, sfc[:,2])
end
write_flow_record(fb, 12, Epl)
write_flow_record(fb, 13, Ecl)
write_flow_record(fb, 14, Qt)
BDIO_close!(fb)
......
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