Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
FerFlow.jl
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Fernando Pérez Panadero
FerFlow.jl
Commits
8d880e20
Commit
8d880e20
authored
May 06, 2024
by
Fernando Pérez Panadero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now can run on existing configs.
parent
bd1d44b4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
36 deletions
+76
-36
main.jl
main.jl
+2
-3
src/io.jl
src/io.jl
+2
-22
src/mc.jl
src/mc.jl
+68
-5
src/meas.jl
src/meas.jl
+0
-2
src/utils.jl
src/utils.jl
+4
-4
No files found.
main.jl
View file @
8d880e20
...
...
@@ -22,11 +22,10 @@ include("./src/mc.jl")
global
log_file
=
open
(
"./output/"
*
params
[
"Run"
][
"name"
]
*
".log"
,
"w+"
)
write_log
()
load_fields
()
therm_or_readlist
()
end
@timeit
"Thermalization"
thermalize
()
while
isfile
(
"run_on"
)
while
RUN_ON
@timeit
"HMC"
Gauge_update
()
...
...
src/io.jl
View file @
8d880e20
...
...
@@ -29,7 +29,7 @@ function parse_commandline()
arg_type
=
String
"-c"
help
=
"Gauge configuration file"
help
=
"Gauge configuration
list
file"
arg_type
=
String
"--cern"
...
...
@@ -67,6 +67,7 @@ function load_structs()
global
N_noise
=
params
[
"Measurements"
][
"N_noise"
]
global
MCid
=
0
global
Nmc_acc
=
0
global
RUN_ON
=
true
return
nothing
end
...
...
@@ -154,27 +155,6 @@ function save_data()
end
"""
function load_gauge_field()
Returns the gauge field and computes the Csw term
"""
function
load_gauge_field
()
if
!
parsed_args
[
"cern"
]
println
(
log_file
,
"
\n
Reading gauge field with LGPU native convention from: "
,
parsed_args
[
"c"
],
"..."
)
U
,
_
=
read_cnfg
(
parsed_args
[
"c"
])
else
println
(
log_file
,
"
\n
Reading gauge field with CERN convention from: "
,
parsed_args
[
"c"
],
"..."
)
U
=
read_cnfg_cern
(
parsed_args
[
"c"
],
lp
)
end
f
=
open
(
parsed_args
[
"c"
],
"r"
)
println
(
log_file
,
"MD5 checksum of gauge config: "
,
bytes2hex
(
md5
(
f
)),
"
\n
"
)
close
(
f
)
Csw!
(
dws
,
U
,
gp
,
lp
)
return
U
end
function
read_cnfg_cern
(
path
::
String
,
lp
::
SpaceParm
)
Ucpu
=
Array
{
SU3
{
Float64
},
3
}(
undef
,
lp
.
bsz
,
lp
.
ndim
,
lp
.
rsz
)
...
...
src/mc.jl
View file @
8d880e20
...
...
@@ -5,20 +5,40 @@ using ArgParse
using
CUDA
function
therm
alize
()
function
therm
_or_readlist
()
println
(
log_file
,
"
\n
Starting simulation
\n
"
)
println
(
log_file
,
"Thermalizing..."
)
flush
(
log_file
)
if
parsed_args
[
"c"
]
==
nothing
println
(
log_file
,
"Thermalizing..."
)
flush
(
log_file
)
@timeit
"Thermalization"
for
_
in
1
:
params
[
"HMC"
][
"nth"
]
HMC!
(
U
,
intsch
,
lp
,
gp
,
ymws
)
end
for
_
in
1
:
params
[
"HMC"
][
"nth"
]
HMC!
(
U
,
intsch
,
lp
,
gp
,
ymws
)
else
println
(
log_file
,
"Loading gauge configurations from "
*
string
(
parsed_args
[
"c"
]))
read_config_list
()
end
f
=
open
(
"RUN_ON_"
*
params
[
"Run"
][
"name"
],
"w+"
)
close
(
f
)
return
nothing
end
function
Gauge_update
()
if
parsed_args
[
"c"
]
==
nothing
Gauge_update_hmc
()
global
RUN_ON
=
isfile
(
"RUN_ON_"
*
params
[
"Run"
][
"name"
])
else
load_gauge_field
()
global
RUN_ON
=
(
isfile
(
"RUN_ON_"
*
params
[
"Run"
][
"name"
])
&&
CONFIG_LIST
[
MCid
+
1
]
!=
""
)
end
return
nothing
end
function
Gauge_update_hmc
()
println
(
log_file
,
"Performing "
*
string
(
params
[
"HMC"
][
"dmeas"
])
*
" HMC steps..."
)
flush
(
log_file
)
...
...
@@ -42,5 +62,48 @@ function Gauge_update()
flush
(
log_file
)
return
nothing
end
function
read_config_list
()
global
CONFIG_LIST
=
Vector
{
String
}(
undef
,
0
)
f
=
open
(
parsed_args
[
"c"
],
"r"
)
while
true
push!
(
CONFIG_LIST
,
"./cnfg/"
*
readline
(
f
))
CONFIG_LIST
[
end
]
==
""
?
break
:
nothing
end
println
(
log_file
,
"Read "
,
length
(
CONFIG_LIST
)
-
1
,
" config names for analisis"
)
return
nothing
end
"""
function load_gauge_field()
Loads the gauge field and computes the Csw term
"""
function
load_gauge_field
()
global
MCid
=
MCid
+
1
if
!
parsed_args
[
"cern"
]
println
(
log_file
,
"
\n
Reading gauge field with LGPU native convention: "
,
CONFIG_LIST
[
MCid
],
"..."
)
global
U
,
_
=
read_cnfg
(
CONFIG_LIST
[
MCid
])
else
println
(
log_file
,
"
\n
Reading gauge field with CERN convention: "
,
CONFIG_LIST
[
MCid
],
"..."
)
global
U
=
read_cnfg_cern
(
CONFIG_LIST
[
MCid
],
lp
)
end
println
(
log_file
,
"Updated to Gauge configuration n"
*
string
(
MCid
))
f
=
open
(
CONFIG_LIST
[
MCid
],
"r"
)
println
(
log_file
,
"MD5 checksum of gauge config: "
,
bytes2hex
(
md5
(
f
)),
"
\n
"
)
close
(
f
)
println
(
log_file
,
"Plaq = "
,
plaquette
(
U
,
lp
,
gp
,
ymws
))
println
(
log_file
,
"Qtop = "
,
Qtop
(
U
,
gp
,
lp
,
ymws
))
Csw!
(
dws
,
U
,
gp
,
lp
)
U_CPU
.=
Array
(
U
)
flush
(
log_file
)
return
nothing
end
src/meas.jl
View file @
8d880e20
...
...
@@ -141,8 +141,6 @@ end
"""
function two_pt_rnd()
...
...
src/utils.jl
View file @
8d880e20
using
LatticeGPU
#
using LatticeGPU
using
ADerrors
using
BDIO
...
...
@@ -23,7 +23,7 @@ function read_ff(name::String)
BDIO_read
(
file
,
th
)
BDIO_read
(
file
,
nflow
)
flow_times
=
Vector
{
Float64
}(
undef
,
nflow
[
1
])
BDIO_read
(
file
,
flow_times
)
nflow
[
1
]
>
0
?
BDIO_read
(
file
,
flow_times
)
:
nothing
BDIO_read
(
file
,
N_noise
)
N_noise
=
N_noise
[
1
]
...
...
@@ -103,11 +103,11 @@ end
"""
function uwff(file::String)
Loads in the variables '
pp_corr','ap_corr','pp_corr_t','ap_corr_t' and 'Sigma
' the corresponding
Loads in the variables '
Epft', 'pp_corr', 'ap_corr', 'pp_corr_t','ap_corr_t', 'Sigma' and 'Sigma_cfl
' the corresponding
'uwreal' quantities. The indices are, when corresponding, eucliden time and flow times
"""
function
uwff
(
file
::
String
)
Eoft_mc
,
pp_corr_mc
,
ap_corr_mc
,
pp_corr_t_mc
,
ap_corr_t_mc
,
Sigma_mc
,
Phat_t_mc
=
read_ff
(
file
)
Eoft_mc
,
pp_corr_mc
,
ap_corr_mc
,
pp_corr_t_mc
,
ap_corr_t_mc
,
Sigma_mc
,
Sigma_cfl_mc
,
Phat_t_mc
=
read_ff
(
file
)
runame
=
String
(
split
(
split
(
file
,
"/"
)[
end
],
"."
)[
1
])
T
=
size
(
pp_corr_mc
)[
2
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment