Skip to content

Commit

Permalink
Merge pull request #66 from akio-tomiya/1.3.0
Browse files Browse the repository at this point in the history
JLD2 bug fix
  • Loading branch information
cometscome authored Dec 17, 2024
2 parents a34127f + e592a83 commit 4c08bc0
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "LatticeQCD"
uuid = "8a12f9b3-8daf-4285-9aa6-f1d88d857ae8"
authors = ["Akio Tomiya", "Yuki Nagai"]
version = "1.3.0"
version = "1.3.1"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
3 changes: 3 additions & 0 deletions src/system/lqcd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,15 @@ function run_LQCD_file(filenamein::String; MPIparallel=false)
@error "$filenamein is not supported. use a TOML format."
end


parameters = construct_Params_from_TOML(filename)
Random.seed!(parameters.randomseed)


univ = Univ(parameters)



println_verbose_level1(univ, "# ", pwd())

println_verbose_level1(univ, "# ", Dates.now())
Expand Down
14 changes: 7 additions & 7 deletions src/system/parameters_TOML.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,21 @@ function construct_Params_from_TOML(parameters)
load_fp = open(logfile, "w")
value_Params[pos] = load_fp

if haskey(parameters["Physical setting(fermions)"],"Dirac_operator")
if haskey(parameters["Physical setting(fermions)"], "Dirac_operator")
if parameters["Physical setting(fermions)"]["Dirac_operator"] == "Domainwall"
pairs = [("M","Domainwall_M"),("m","Domainwall_m"),("N5","Domainwall_L5")]
pairs = [("M", "Domainwall_M"), ("m", "Domainwall_m"), ("N5", "Domainwall_L5")]
param = parameters["Physical setting(fermions)"]
for pair in pairs
if haskey(param,pair[1])
if haskey(param,pair[2]) == false
if haskey(param, pair[1])
if haskey(param, pair[2]) == false
param[pair[2]] = param[pair[1]]
end
if param[pair[1]] == nothing
param[pair[2]] = param[pair[1]]
end
end
if haskey(param,pair[2])
if haskey(param,pair[1]) == false
if haskey(param, pair[2])
if haskey(param, pair[1]) == false
param[pair[1]] = param[pair[2]]
end
if param[pair[2]] == nothing
Expand All @@ -153,7 +153,7 @@ function construct_Params_from_TOML(parameters)
end
end
end



if haskey(parameters["Measurement set"], "measurement_basedir") &&
Expand Down
21 changes: 12 additions & 9 deletions src/system/universe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function is_quenched(univ::Univ)
end


function Univ(p::Params; MPIparallel = false, PEs = nothing)
function Univ(p::Params; MPIparallel=false, PEs=nothing)
Dim = length(p.L)
L = Tuple(p.L)
NC = p.NC
Expand All @@ -38,22 +38,22 @@ function Univ(p::Params; MPIparallel = false, PEs = nothing)

if p.initial == "cold" || p.initial == "hot" || p.initial == "one instanton"
if Dim == 2
U = Initialize_Gaugefields(NC, Nwing, L..., condition = p.initial)
U = Initialize_Gaugefields(NC, Nwing, L..., condition=p.initial)
else
U = Initialize_Gaugefields(NC, Nwing, L..., condition = p.initial)
U = Initialize_Gaugefields(NC, Nwing, L..., condition=p.initial)
end
else
if Dim == 2
U = Initialize_Gaugefields(NC, Nwing, L..., condition = "cold")
U = Initialize_Gaugefields(NC, Nwing, L..., condition="cold")
else
U = Initialize_Gaugefields(NC, Nwing, L..., condition = "cold")
U = Initialize_Gaugefields(NC, Nwing, L..., condition="cold")
end

end
close(p.load_fp)
logfilename = pwd() * "/" * p.log_dir * "/" * p.logfile
verbose_print =
Verbose_print(p.verboselevel, myid = get_myrank(U[1]), filename = logfilename)
Verbose_print(p.verboselevel, myid=get_myrank(U[1]), filename=logfilename)

if p.initial == "cold" || p.initial == "hot" || p.initial == "one instanton"
else
Expand All @@ -66,6 +66,9 @@ function Univ(p::Params; MPIparallel = false, PEs = nothing)
elseif p.loadU_format == "BridgeText"
filename = p.initial
load_BridgeText!(filename, U, L, NC)
elseif p.loadU_format == "JLD"
filename = p.initial
U = loadU(filename)
else
error("loadU_format should be ILDG or BridgeText. Now $(p.loadU_format)")
end
Expand All @@ -82,7 +85,7 @@ function Univ(p::Params; MPIparallel = false, PEs = nothing)
if p.use_autogeneratedstaples
error("p.use_autogeneratedstaples = true is not supported yet!")
else
plaqloop = make_loops_fromname("plaquette", Dim = Dim)
plaqloop = make_loops_fromname("plaquette", Dim=Dim)
append!(plaqloop, plaqloop')
βinp = p.β / 2
push!(gauge_action, βinp, plaqloop)
Expand All @@ -104,7 +107,7 @@ function Univ(p::Params; MPIparallel = false, PEs = nothing)
params["mass"] = p.mass
parameters_action["Nf"] = p.Nf
elseif p.Dirac_operator == "Wilson"
x = Initialize_pseudofermion_fields(U[1], "Wilson", nowing = true)
x = Initialize_pseudofermion_fields(U[1], "Wilson", nowing=true)
params["Dirac_operator"] = "Wilson"
params["κ"] = p.hop
params["r"] = p.r
Expand All @@ -120,7 +123,7 @@ function Univ(p::Params; MPIparallel = false, PEs = nothing)
params["mass"] = mass
params["L5"] = L5
params["M"] = M
x = Initialize_pseudofermion_fields(U[1], "Domainwall", L5 = L5, nowing = true)
x = Initialize_pseudofermion_fields(U[1], "Domainwall", L5=L5, nowing=true)
else
error("not supported")
end
Expand Down
6 changes: 3 additions & 3 deletions src/system/wizard.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ import ..Parameters_TOML: demo_TOML, construct_Params_from_TOML

function get_filename_extension(loadtype::Fileformat)
if loadtype == JLD
ext = ".jld"
ext = "jld2"
elseif loadtype == ILDG
ext = ".ildg"
ext = "ildg"
elseif loadtype == BridgeText
ext = ".txt"
ext = "txt"
else
error("error!")
end
Expand Down

0 comments on commit 4c08bc0

Please sign in to comment.